/* ── Full Vocal Course · [full_vocal_course] · Full Vocal v3 ───────────── */

/* ── Conteneur extérieur (carte) ───────────────────────────────────── */
.fvc-app {
    --fvc-blue:        #2563EB;
    --fvc-blue-light:  #EFF6FF;
    --fvc-blue-mid:    #DBEAFE;
    --fvc-cyan:        #0891B2;
    --fvc-green:       #16A34A;
    --fvc-red:         #DC2626;
    --fvc-bg:          #FFFFFF;
    --fvc-bg-soft:     #F8FAFC;
    --fvc-border:      #E2E8F0;
    --fvc-text:        #1E293B;
    --fvc-muted:       #64748B;
    --fvc-hint:        #94A3B8;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--fvc-bg);
    border: 1px solid var(--fvc-border);
    border-radius: 20px;
    box-shadow: 0 6px 32px rgba(37,99,235,0.10), 0 1px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    max-width: 680px;
    margin: 2rem auto;
}

/* ── Panneau de conversation ────────────────────────────────────────── */
.fvc-wrap {
    display: flex;
    flex-direction: column;
}

/* ── Écran de configuration (accent + coach) ─────────────────────── */
.fvc-setup {
    padding: 2.25rem 1.5rem 2rem;
    background: linear-gradient(165deg, var(--fvc-blue-light) 0%, var(--fvc-bg) 65%);
}

.fvc-setup.hidden { display: none !important; }

.fvc-setup-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.1rem;
}

.fvc-setup-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--fvc-blue), var(--fvc-cyan));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(37,99,235,0.32);
}

.fvc-setup-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--fvc-text);
    margin: 0;
    letter-spacing: -0.01em;
}

.fvc-setup-sub {
    font-size: 13px;
    color: var(--fvc-muted);
    margin: -0.6rem 0 0.25rem;
    max-width: 320px;
}

.fvc-setup-block {
    width: 100%;
    max-width: 360px;
    text-align: left;
}

.fvc-setup-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--fvc-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.55rem;
}

/* Sélecteur d'accent (cartes) */
.fvc-accent-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.fvc-accent-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 0.5rem;
    border-radius: 14px;
    border: 1.5px solid var(--fvc-border);
    background: var(--fvc-bg);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
    font-family: inherit;
}
.fvc-accent-btn:hover {
    border-color: var(--fvc-blue);
    background: var(--fvc-blue-light);
}
.fvc-accent-btn:active { transform: scale(0.98); }

.fvc-accent-btn.active {
    border-color: var(--fvc-blue);
    background: linear-gradient(135deg, var(--fvc-blue-light), var(--fvc-blue-mid));
    box-shadow: 0 0 0 3px rgba(37,99,235,0.14);
}

.fvc-accent-flag {
    font-size: 26px;
    line-height: 1;
}

.fvc-accent-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fvc-text);
}
.fvc-accent-btn.active .fvc-accent-name { color: var(--fvc-blue); }

/* Liste déroulante des coachs (style moderne, flèche custom) */
.fvc-select-wrap {
    position: relative;
}
.fvc-select-wrap select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--fvc-text);
    background: var(--fvc-bg);
    border: 1.5px solid var(--fvc-border);
    border-radius: 12px;
    padding: 0.75rem 2.25rem 0.75rem 0.95rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.fvc-select-wrap select:hover { border-color: var(--fvc-blue); }
.fvc-select-wrap select:focus {
    outline: none;
    border-color: var(--fvc-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.14);
}
.fvc-select-wrap::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid var(--fvc-muted);
    border-bottom: 1.5px solid var(--fvc-muted);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

/* Bouton démarrer */
.fvc-start-btn {
    width: 100%;
    max-width: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    margin-top: 0.25rem;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--fvc-blue), var(--fvc-cyan));
    color: #fff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37,99,235,0.32);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.fvc-start-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 9px 26px rgba(37,99,235,0.42);
}
.fvc-start-btn:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.fvc-start-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}


.fvc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--fvc-border);
    background: var(--fvc-bg);
    gap: 0.75rem;
    flex-shrink: 0;
}

.fvc-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.fvc-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--fvc-blue-light);
    color: var(--fvc-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fvc-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fvc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fvc-subtitle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 11px;
    color: var(--fvc-muted);
    margin-top: 1px;
}

.fvc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22C55E;
    display: inline-block;
    animation: fvc-pulse-dot 2s ease-in-out infinite;
}
@keyframes fvc-pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.fvc-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.fvc-btn-reset {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--fvc-border);
    background: var(--fvc-bg-soft);
    color: var(--fvc-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.fvc-btn-reset:hover {
    background: var(--fvc-blue-light);
    color: var(--fvc-blue);
    border-color: var(--fvc-blue);
}

/* ── Zone messages (bulles) ──────────────────────────────────────── */
.fvc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.1rem 1.25rem;
    background: var(--fvc-bg-soft);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
    min-height: 220px;
    max-height: 340px;
}

.fvc-messages::-webkit-scrollbar { width: 4px; }
.fvc-messages::-webkit-scrollbar-track { background: transparent; }
.fvc-messages::-webkit-scrollbar-thumb { background: var(--fvc-border); border-radius: 2px; }

/* ── Bulles style landing page ───────────────────────────────────── */
/* On réutilise les classes du code HTML fourni : demo-row, demo-avatar, demo-bubble */
.fvc-wrap .demo-row {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    animation: fvc-fade-in 0.2s ease;
}
@keyframes fvc-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fvc-wrap .demo-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.fvc-wrap .avatar-ai {
    background: var(--fvc-blue-light);
    color: var(--fvc-blue);
}

.fvc-wrap .avatar-user {
    background: var(--fvc-blue);
    color: #fff;
    order: 2;  /* droite */
}

.fvc-wrap .demo-bubble {
    padding: 0.6rem 0.9rem;
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 82%;
    position: relative;
}

/* Bulle IA */
.fvc-wrap .demo-bubble.ai {
    background: var(--fvc-bg);
    border: 1px solid var(--fvc-border);
    color: var(--fvc-text);
    border-bottom-left-radius: 3px;
}

/* Bulle utilisateur */
.fvc-wrap .demo-bubble.user {
    background: var(--fvc-blue);
    color: #fff;
    border-bottom-right-radius: 3px;
    margin-left: auto;
}

/* Rangée user : avatar à droite */
.fvc-wrap .demo-row:has(.avatar-user) {
    flex-direction: row-reverse;
    align-self: flex-end;
}

/* Bulle erreur */
.fvc-wrap .demo-bubble.bubble-error {
    background: #FEF2F2 !important;
    border-color: #FECACA !important;
    color: #B91C1C !important;
}

/* Bouton réécouter dans la bulle */
.fvc-replay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(37,99,235,0.18);
    border: none;
    cursor: pointer;
    margin-left: 0.4rem;
    vertical-align: middle;
    transition: background 0.15s;
    flex-shrink: 0;
}
.fvc-replay-btn:hover { background: rgba(37,99,235,0.35); }

/* Typing indicator */
.fvc-wrap .fvc-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.55rem 0.9rem;
    min-width: 56px;
}
.fvc-wrap .tb {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--fvc-hint);
    display: inline-block;
    animation: fvc-bounce 1.2s ease-in-out infinite;
}
.fvc-wrap .tb:nth-child(1) { animation-delay: 0s; }
.fvc-wrap .tb:nth-child(2) { animation-delay: 0.2s; }
.fvc-wrap .tb:nth-child(3) { animation-delay: 0.4s; }
@keyframes fvc-bounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
    40%            { transform: scale(1);  opacity: 1; }
}

/* ── Zone micro (identique landing page) ─────────────────────────── */
.fvc-mic-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.75rem 1rem 1.5rem;
    background: var(--fvc-bg);
    border-top: 1px solid var(--fvc-border);
    gap: 0.6rem;
    flex-shrink: 0;
}

/* ── Barres d'onde ───────────────────────────────────────────────── */
/* Style identique au HTML fourni, mais via classes plugin */
.fvc-wave-bars {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 28px;
    opacity: 0;
    transition: opacity 0.3s;
}

.fvc-wave-bars.bars-listening,
.fvc-wave-bars.bars-speaking {
    opacity: 1;
}

.fvc-wave-bars .wb {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: var(--fvc-blue);
}

/* Barres écoute : rouge pulsant */
.fvc-wave-bars.bars-listening .wb {
    background: #EF4444;
    animation: wb-listen 0.9s ease-in-out infinite alternate;
}
.fvc-wave-bars.bars-listening .wb:nth-child(1) { height: 8px;  animation-delay: 0s; }
.fvc-wave-bars.bars-listening .wb:nth-child(2) { height: 18px; animation-delay: 0.1s; }
.fvc-wave-bars.bars-listening .wb:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.fvc-wave-bars.bars-listening .wb:nth-child(4) { height: 22px; animation-delay: 0.3s; }
.fvc-wave-bars.bars-listening .wb:nth-child(5) { height: 10px; animation-delay: 0.4s; }
.fvc-wave-bars.bars-listening .wb:nth-child(6) { height: 20px; animation-delay: 0.5s; }
.fvc-wave-bars.bars-listening .wb:nth-child(7) { height: 8px;  animation-delay: 0.6s; }

@keyframes wb-listen {
    0%   { transform: scaleY(0.4); opacity: 0.5; }
    100% { transform: scaleY(1);   opacity: 1; }
}

/* Barres lecture TTS : bleu/cyan */
.fvc-wave-bars.bars-speaking .wb {
    background: var(--fvc-blue);
    animation: wb-speak 1s ease-in-out infinite alternate;
}
.fvc-wave-bars.bars-speaking .wb:nth-child(1) { height: 6px;  animation-delay: 0s; }
.fvc-wave-bars.bars-speaking .wb:nth-child(2) { height: 16px; animation-delay: 0.12s; }
.fvc-wave-bars.bars-speaking .wb:nth-child(3) { height: 10px; animation-delay: 0.24s; }
.fvc-wave-bars.bars-speaking .wb:nth-child(4) { height: 20px; animation-delay: 0.36s; }
.fvc-wave-bars.bars-speaking .wb:nth-child(5) { height: 8px;  animation-delay: 0.48s; }
.fvc-wave-bars.bars-speaking .wb:nth-child(6) { height: 18px; animation-delay: 0.60s; }
.fvc-wave-bars.bars-speaking .wb:nth-child(7) { height: 6px;  animation-delay: 0.72s; }

@keyframes wb-speak {
    0%   { transform: scaleY(0.35); opacity: 0.6; }
    100% { transform: scaleY(1);    opacity: 1; }
}

/* ── Bouton micro central (identique landing page) ───────────────── */
/* Style identique à .mic-ring-outer + .wave-ring + .mic-btn */
.fvc-mic-ring-outer {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Anneaux (identiques aux .wave-ring du HTML fourni) */
.fvc-wave-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1.5px solid rgba(37,99,235,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Anneaux actifs pendant écoute */
.fvc-mic-ring-outer.rings-listening .fvc-wave-ring,
.fvc-mic-ring-outer.rings-speaking  .fvc-wave-ring {
    opacity: 1;
    animation: fvc-ring-expand 2.4s ease-out infinite;
}
.fvc-mic-ring-outer.rings-listening .fvc-wave-ring { border-color: rgba(220,38,38,0.35); }
.fvc-mic-ring-outer.rings-speaking  .fvc-wave-ring { border-color: rgba(37,99,235,0.35); }

.fvc-wave-ring:nth-child(1) { animation-delay: 0s; }
.fvc-wave-ring:nth-child(2) { animation-delay: 0.8s; }
.fvc-wave-ring:nth-child(3) { animation-delay: 1.6s; }

@keyframes fvc-ring-expand {
    0%   { transform: scale(0.82); opacity: 0.7; }
    100% { transform: scale(1.85); opacity: 0; }
}

/* Bouton micro (identique .mic-btn landing page) */
.fvc-mic-btn {
    position: relative;
    z-index: 2;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--fvc-blue), #0891B2);
    box-shadow: 0 4px 20px rgba(37,99,235,0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.fvc-mic-btn:hover { transform: scale(1.06); box-shadow: 0 6px 26px rgba(37,99,235,0.45); }
.fvc-mic-btn:active { transform: scale(0.96); }

.fvc-mic-btn svg {
    width: 26px;
    height: 26px;
}

/* États couleur du bouton */
.fvc-mic-btn.fvc-listening {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    box-shadow: 0 4px 20px rgba(220,38,38,0.4);
    animation: fvc-btn-listen-pulse 1s ease-in-out infinite;
}
@keyframes fvc-btn-listen-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(220,38,38,0.4); }
    50%       { box-shadow: 0 4px 28px rgba(220,38,38,0.7); }
}

.fvc-mic-btn.fvc-thinking {
    background: linear-gradient(135deg, #64748B, #475569);
    box-shadow: 0 4px 20px rgba(100,116,139,0.35);
    animation: fvc-btn-spin-glow 2s linear infinite;
}
@keyframes fvc-btn-spin-glow {
    0%   { box-shadow: 0 4px 20px rgba(100,116,139,0.3); }
    50%  { box-shadow: 0 4px 28px rgba(37,99,235,0.5); }
    100% { box-shadow: 0 4px 20px rgba(100,116,139,0.3); }
}

.fvc-mic-btn.fvc-speaking {
    background: linear-gradient(135deg, #2563EB, #06B6D4);
    animation: fvc-btn-speaking 1.5s ease-in-out infinite;
}
@keyframes fvc-btn-speaking {
    0%, 100% { box-shadow: 0 4px 20px rgba(37,99,235,0.35); }
    50%       { box-shadow: 0 4px 32px rgba(6,182,212,0.6); }
}

.fvc-mic-btn.fvc-error {
    background: linear-gradient(135deg, #EF4444, #B91C1C);
    box-shadow: 0 4px 20px rgba(220,38,38,0.5);
}

.fvc-mic-btn.fvc-disabled {
    background: var(--fvc-border);
    box-shadow: none;
    cursor: not-allowed;
}

/* ── Label statut sous le micro ──────────────────────────────────── */
/* Identique à .mic-label de la landing page */
.fvc-mic-label {
    font-size: 13px;
    color: var(--fvc-muted);
    text-align: center;
    min-height: 18px;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: 0.01em;
}

/* ── Utilitaires ─────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .fvc-app         { margin: 0.75rem; border-radius: 14px; }
    .fvc-setup       { padding: 1.75rem 1.1rem 1.5rem; }
    .fvc-setup-title { font-size: 17px; }
    .fvc-wrap        { margin: 0; border-radius: 0; }
    .fvc-header      { padding: 0.65rem 0.875rem; flex-wrap: wrap; }
    .fvc-messages    { max-height: 260px; padding: 0.875rem; }
    .fvc-mic-area    { padding: 1.25rem 1rem 1.1rem; }
    .fvc-mic-btn     { width: 60px; height: 60px; }
    .fvc-mic-ring-outer { width: 76px; height: 76px; }
}
