/*
 * fg-wizard.css — Wizard d'identification conversationnel
 * S'intègre dans le thème AFLA : hérite du fond coloré du template de page.
 * Les variables --afla-* sont définies dans afla-style.css.
 */

/* ── Conteneur principal ──────────────────────────────────────────────── */

.fg-wizard-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px 48px;
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    color: #fff;
    box-sizing: border-box;
}

.fg-wizard-container * {
    box-sizing: border-box;
}

/* ── Barre de progression ─────────────────────────────────────────────── */

.fg-wizard-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin-bottom: 40px;
    overflow: hidden;
}

.fg-wizard-progress-bar {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* ── Corps animé ──────────────────────────────────────────────────────── */

.fg-wizard-body {
    /* opacity géré par JS pour les transitions */
}

/* ── Chargement initial ───────────────────────────────────────────────── */

.fg-wizard-loading {
    display: flex;
    justify-content: center;
    padding: 32px 0;
}

.fg-wizard-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fg-wizard-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: fg-dot-pulse 1.2s infinite ease-in-out;
}

.fg-wizard-dots span:nth-child(2) { animation-delay: 0.2s; }
.fg-wizard-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes fg-dot-pulse {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1;   }
}

/* ── Bloc question ────────────────────────────────────────────────────── */

.fg-wizard-question {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fg-wizard-q-text {
    font-family: var(--afla-fh, 'Barlow Condensed', 'Arial Narrow', sans-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 8px;
}

/* ── Input texte / date / number ─────────────────────────────────────── */

.fg-wizard-input-wrap {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.fg-wizard-input {
    flex: 1;
    min-width: 0;
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--afla-ink, #1C1C1C);
    background: #fff;
    border: none;
    border-radius: 100px;
    padding: 14px 22px;
    outline: none;
    transition: box-shadow 0.2s ease;
    -webkit-appearance: none;
}

.fg-wizard-input::placeholder {
    color: #aaa;
}

.fg-wizard-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.fg-wizard-input[type="date"] {
    padding: 12px 22px;
}

/* ── Bouton Valider / Suivant ─────────────────────────────────────────── */

.fg-wizard-next-btn {
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--afla-ink, #1C1C1C);
    border: none;
    border-radius: 100px;
    padding: 14px 28px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.1s ease;
    letter-spacing: 0.02em;
}

.fg-wizard-next-btn:hover {
    background: var(--afla-rouge-3, #8B0A30);
    transform: translateY(-1px);
}

.fg-wizard-next-btn:active {
    transform: translateY(0);
}

.fg-wizard-next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Boutons Oui / Non ────────────────────────────────────────────────── */

.fg-wizard-yesno {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.fg-wizard-yn-btn {
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 100px;
    padding: 14px 36px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.fg-wizard-yn-btn[data-value="yes"] {
    background: #fff;
    color: var(--afla-rouge-2, #CC1045);
}

.fg-wizard-yn-btn[data-value="no"] {
    background: transparent;
    color: #fff;
}

.fg-wizard-yn-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.fg-wizard-yn-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Hint (indice / compte candidats) ────────────────────────────────── */

.fg-wizard-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    font-style: italic;
}

.fg-wizard-hint-match {
    color: rgba(255, 255, 255, 0.9);
    font-style: normal;
    font-weight: 600;
}

/* ── Erreur champ ─────────────────────────────────────────────────────── */

.fg-wizard-error {
    font-size: 0.85rem;
    color: #FFD0D8;
    font-weight: 500;
}

/* ── Bouton "Je ne sais pas" ──────────────────────────────────────────── */

.fg-wizard-skip-wrap {
    padding-top: 4px;
}

.fg-wizard-skip-btn {
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0 0 2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    letter-spacing: 0.01em;
}

.fg-wizard-skip-btn:hover {
    color: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.7);
}

.fg-wizard-skip-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── États finaux ─────────────────────────────────────────────────────── */

.fg-wizard-result {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Le message principal reprend le style des questions */
.fg-wizard-result .fg-wizard-q-text {
    margin-bottom: 0;
}

.fg-wizard-result h3 {
    font-family: var(--afla-fh, 'Barlow Condensed', sans-serif);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

/* Icône ✓ identifié */
.fg-wizard-check-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.fg-wizard-redirect-msg {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.65) !important;
    font-style: italic;
}

/* ── Bloc aide (formulaire email / tél / message) ─────────────────────── */

.fg-wizard-help-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.fg-wizard-help-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fg-wizard-help-field {
    width: 100%;
}

.fg-wizard-help-textarea {
    border-radius: 20px !important;
    resize: vertical;
    min-height: 80px;
    padding: 14px 22px !important;
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    font-size: 1rem;
}


.fg-wizard-help-feedback {
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 1.2em;
}

.fg-wizard-help-feedback.fg-wizard-help-ok {
    color: rgba(255, 255, 255, 0.9);
}

.fg-wizard-help-feedback.fg-wizard-help-err {
    color: #FFD0D8;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .fg-wizard-q-text {
        font-size: 1.6rem;
    }

    .fg-wizard-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .fg-wizard-next-btn {
        width: 100%;
        text-align: center;
    }

    .fg-wizard-yn-btn {
        flex: 1;
        padding: 14px 20px;
    }
}

/* ── Page de connexion (fg_acces) ─────────────────────────────────────── */

.fg-wizard-alert {
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.fg-wizard-alert-error {
    background: rgba(255, 255, 255, 0.15);
    color: #FFD0D8;
    border: 1px solid rgba(255, 180, 180, 0.4);
}

.fg-wizard-alert-success {
    background: rgba(255, 255, 255, 0.15);
    color: #D0FFE0;
    border: 1px solid rgba(150, 255, 180, 0.4);
}

.fg-wizard-remember {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.fg-wizard-links {
    margin-top: 24px;
}

.fg-wizard-links details summary {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    display: inline;
    cursor: pointer;
    padding-bottom: 2px;
}

.fg-wizard-links details summary:hover {
    color: rgba(255, 255, 255, 0.95);
}

.fg-wizard-links p {
    margin-top: 16px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
}

.fg-wizard-links p a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

/* ── Sélecteurs de date (mobile-friendly) ─────────────────────────────── */

.fg-wizard-date-parts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.fg-wizard-date-sel {
    flex: 1;
    min-width: 80px;
    cursor: pointer;
    appearance: auto;
}

/* ── Skip button agrandi (wizard activation) ──────────────────────────── */

.fg-wizard-skip-btn--lg {
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.5);
    padding-bottom: 3px;
}

.fg-wizard-skip-btn--lg:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.85);
}

/* ── Selfie step ──────────────────────────────────────────────────────── */

.fg-act-selfie-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.fg-act-selfie-preview {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.fg-act-selfie-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Écran compte déjà actif ──────────────────────────────────────────── */

.fg-wizard-already-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    align-items: flex-start;
}
