/* ============================================================================
   tests-extra.css — Extensions au main.css du funnel pour les pages dynamiques
   (index, intro test, capture email, résultat).

   Reprend la palette + le bg du funnel mais ajoute :
   - Grille catégories + cards de tests (page index)
   - Page intro test (cover + intro_html + CTA)
   - Page email capture
   - Page résultat enrichie (sections sources/specialiste)
   - Footer pied de page (les pages funnel n'en ont pas)
   ============================================================================ */

/* ----- Hero subtitle (page index) ----- */
.hero-sub {
    color: #6B7294;
    font-size: 16px;
    margin: 12px 0 0;
    max-width: 640px;
    text-align: center;
    line-height: 1.55;
}

/* ----- Override : badges "Votre situation/symptôme/solution/résultats" ----- */
/* main.css fixe width:143px ce qui force le retour à la ligne pour les libellés
   plus longs. On passe en auto + nowrap pour rester sur une seule ligne. */
.sm-btn-text-2,
.sm-btn-text-3,
.sm-btn-text-4,
.sm-btn-text-5 {
    width: auto !important;
    padding-left: 18px;
    padding-right: 18px;
    white-space: nowrap;
}

/* ----- Loading state ----- */
.loading-state {
    text-align: center;
    color: #6B7294;
    padding: 3rem 1rem;
    font-size: 16px;
}

/* ============================================================================
   Page index : catégories + grille tests
   ============================================================================ */

/* Override de .main-box-2 (720px par défaut) pour la home : on a besoin de
   place pour afficher 4 colonnes de cards. */
.main-box-2.main-box-wide {
    width: 100%;
    max-width: 1320px;
    padding-left: 32px;
    padding-right: 32px;
}
@media (max-width: 820px) {
    .main-box-2.main-box-wide { padding-left: 18px; padding-right: 18px; }
}

.cat-section { margin-bottom: 32px; }
.cat-title {
    font-size: 14px;
    font-weight: 700;
    color: #6B7294;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 14px;
    padding: 0 4px;
}
.tests-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
@media (max-width: 820px) { .tests-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .tests-grid { grid-template-columns: 1fr; } }
.test-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(19,32,85,0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    border: 1px solid #E2E4ED;
}
.test-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(19,32,85,0.1);
    border-color: #5B65DE;
    text-decoration: none;
    color: inherit;
}
.test-card-cover {
    width: 100%;
    aspect-ratio: 16/9;
    background: #ECEFFE;
    background-size: cover;
    background-position: center;
}
.test-card-cover-placeholder {
    background: linear-gradient(135deg, #ECEFFE, #F7F7FD);
}
.test-card-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.test-card h3 {
    font-size: 17px;
    color: #132055;
    margin: 0 0 6px;
    line-height: 1.3;
    font-weight: 700;
}
.test-card p {
    color: #6B7294;
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.test-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    font-size: 13px;
}
.test-card-meta { color: #6B7294; }
.test-card-cta { color: #5B65DE; font-weight: 600; }

/* ============================================================================
   Page test : intro + cover image + article SEO long
   ============================================================================ */

.test-cover {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 14px;
    background: #ECEFFE;
    background-size: cover;
    background-position: center;
    margin-bottom: 24px;
}
.intro-html {
    color: #132055;
    line-height: 1.65;
    font-size: 16px;
    margin-bottom: 24px;
}
.intro-html p { margin: 12px 0; }
.intro-html strong { color: #132055; }
.intro-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: #6B7294;
    margin-bottom: 24px;
    padding-top: 16px;
    border-top: 1px solid #E2E4ED;
    flex-wrap: wrap;
}
.intro-meta span:not(.dot) { white-space: nowrap; }
.intro-meta .dot { opacity: 0.4; }

/* ----- Article SEO long (sous le bouton Commencer) ----- */
.seo-long-html {
    color: #132055;
    line-height: 1.7;
    font-size: 15.5px;
}
.seo-long-html .seo-section { margin-bottom: 32px; }
.seo-long-html h2 {
    font-size: 22px;
    color: #132055;
    margin: 0 0 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.seo-long-html h3 {
    font-size: 17px;
    color: #132055;
    margin: 18px 0 10px;
    font-weight: 600;
}
.seo-long-html p { margin: 12px 0; }
.seo-long-html a { color: #5B65DE; }
.seo-long-html ul, .seo-long-html ol { padding-left: 1.4rem; margin: 8px 0; }
.seo-long-html strong, .seo-long-html b { color: #132055; }

/* ============================================================================
   Page test : capture email (design "Quelques informations à votre sujet")
   ============================================================================ */

/* Lien "← Retour" en haut à gauche */
.identify-back-link {
    display: inline-block;
    color: #6B7294;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 18px;
    transition: color 0.15s;
}
.identify-back-link:hover { color: #132055; text-decoration: none; }

/* Sous-titre gris au-dessus du titre */
.identify-subtitle {
    color: #6B7294;
    font-size: 16px;
    margin: 0 0 8px;
    text-align: center;
}

/* Champs : libellés type question + inputs sans bordure (fond gris très clair) */
.identify-fields { margin-top: 28px; margin-bottom: 22px; }
.identify-field { margin-bottom: 22px; }
.identify-field label {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #132055;
    margin-bottom: 12px;
    line-height: 1.3;
}
.identify-field input {
    width: 100%;
    padding: 18px 20px;
    border: none;
    background: #F5F6FB;
    border-radius: 14px;
    font-size: 17px;
    font-family: inherit;
    color: #132055;
    transition: all 0.15s;
}
.identify-field input::placeholder { color: #B0B5CC; }
.identify-field input:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 2px #5B65DE;
}

/* Checkbox CGU custom */
.identify-cgu {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    color: #132055;
    font-size: 15px;
    margin-bottom: 18px;
    user-select: none;
}
.identify-cgu input[type="checkbox"] {
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 1.5px solid #C9CCF5;
    border-radius: 6px;
    background: #F5F6FB;
    cursor: pointer;
    margin-top: 2px;
    position: relative;
    transition: all 0.15s;
}
.identify-cgu input[type="checkbox"]:checked {
    background: #5B65DE;
    border-color: #5B65DE;
}
.identify-cgu input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.identify-cgu a { color: #5B65DE; }
.identify-error {
    display: none;
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 14px;
}
.identify-disclaimer {
    font-size: 13px;
    color: #6B7294;
    margin-top: 12px;
    text-align: center;
}
.identify-disclaimer a { color: #5B65DE; }

/* ============================================================================
   Page résultat : sections additionnelles (sources, spécialiste, CTA)
   ============================================================================ */

.result-cta-card {
    background: linear-gradient(135deg, #ECEFFE, #F0F7FF);
    border: 1px solid #DBEAFE;
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    margin-top: 16px;
}
.result-cta-card h2 {
    color: #132055;
    margin: 0 0 8px;
    font-size: 22px;
}
.result-cta-card p {
    color: #2E3557;
    margin: 0 0 20px;
    line-height: 1.5;
}

.result-section {
    background: #fff;
    border: 1px solid #E2E4ED;
    border-radius: 16px;
    padding: 24px 22px;
    margin-top: 16px;
}
.result-section-label {
    font-size: 13px;
    font-weight: 700;
    color: #6B7294;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 12px;
}
.result-section .long-html { line-height: 1.7; font-size: 15px; }
.result-section .long-html h2,
.result-section .long-html h3 { color: #132055; margin: 16px 0 8px; font-size: 18px; }
.result-section .long-html p { margin: 10px 0; }
.result-section .long-html a { color: #5B65DE; }
.result-section .long-html strong { color: #132055; }

.result-disclaimer {
    background: #FEF3C7;
    border: 1px solid #FBBF24;
    color: #92400E;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 16px;
    line-height: 1.5;
}

/* Recommandé badge dans le hero du résultat */
.recommended-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #5B65DE;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

/* ============================================================================
   Loader steps (page résultat — animation "Analyse en cours")
   ============================================================================ */

.steps-2-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    max-width: 420px;
    margin: 24px auto 0;
}
.steps-2-mobile .step-2 {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 14px;
    color: #6B7294;
    font-size: 16px;
    font-weight: 600;
    opacity: 0.45;
    transition: all 0.4s ease;
}
.steps-2-mobile .step-2.active {
    background: #ECEFFE;
    color: #132055;
    opacity: 1;
}
.steps-2-mobile .step-2.done {
    background: #ECEFFE;
    color: #132055;
    opacity: 1;
}

/* Override dep-heading (funnel) : largeur fixe 313px → auto pour s'adapter au label */
.dep-heading {
    width: auto !important;
    max-width: 100%;
    padding: 12px 24px !important;
    white-space: nowrap;
}
.blue-inner h3 { font-size: 18px; font-weight: 600; }

/* rs-line / rs-text retirés le 2026-05-13 (cf. main.css). */

/* Check pill (badge violet rond avec coche blanche) — design funnel */
.steps-2-mobile .check-pill {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #C9CCF5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}
.steps-2-mobile .step-2.active .check-pill,
.steps-2-mobile .step-2.done .check-pill {
    background: #5B65DE;
}
.steps-2-mobile .check-mark {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

/* ============================================================================
   Footer (les pages funnel n'en ont pas)
   ============================================================================ */

.page-footer {
    background: #fff;
    border-top: 1px solid #E2E4ED;
    padding: 28px 20px 22px;
    text-align: center;
    font-size: 13px;
    color: #6B7294;
    margin-top: 60px;
}
.page-footer a { color: #6B7294; }
.page-footer a:hover { color: #5B65DE; }
.footer-links { margin-top: 8px; }
.footer-links a + a::before { content: " · "; opacity: 0.5; }

/* ============================================================================
   Verrouillage du résultat (overlay flou + modal "Créer MDP" ou "Se connecter")
   ============================================================================ */

/* Quand .is-locked est appliqué sur #state-result, on floute le contenu en
   dessous et on bloque les interactions. Le modal lui n'est pas dans #state-result
   donc reste net. */
#state-result.is-locked {
    filter: blur(7px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.4s ease;
}

.lock-overlay {
    position: fixed;
    inset: 0;
    background: rgba(19, 32, 85, 0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    backdrop-filter: blur(2px);
    animation: lockFadeIn 0.35s ease-out;
}
@keyframes lockFadeIn { from { opacity: 0; } to { opacity: 1; } }

.lock-modal {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(19, 32, 85, 0.25);
    padding: 36px 32px 28px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    animation: lockSlideUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes lockSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.lock-icon { font-size: 38px; margin-bottom: 8px; line-height: 1; }
.lock-title {
    font-size: 22px;
    font-weight: 700;
    color: #132055;
    margin: 0 0 10px;
    line-height: 1.3;
}
.lock-subtitle {
    color: #6B7294;
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 22px;
}

.lock-field { text-align: left; margin-bottom: 16px; }
.lock-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #132055;
    margin-bottom: 8px;
}
.lock-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #E2E4ED;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    color: #132055;
    transition: all 0.15s;
}
.lock-field input:focus {
    outline: none;
    border-color: #5B65DE;
    box-shadow: 0 0 0 3px rgba(91, 101, 222, 0.12);
}
.lock-pwhint {
    font-size: 12.5px;
    color: #6B7294;
    margin-top: 7px;
    line-height: 1.4;
}

.lock-error {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 14px;
    text-align: left;
}

.lock-cta { width: 100%; margin-top: 4px; justify-content: center; }

.lock-footer-link {
    margin-top: 14px;
    font-size: 13.5px;
}
.lock-footer-link a { color: #6B7294; text-decoration: none; }
.lock-footer-link a:hover { color: #5B65DE; }

/* ============================================================================
   Teaser "Déverrouiller gratuitement" — affiché entre le score et l'analyse
   ============================================================================ */

.unlock-teaser {
    background: linear-gradient(135deg, #ECEFFE 0%, #F0F7FF 100%);
    border: 1.5px dashed #C9CCF5;
    border-radius: 18px;
    padding: 28px 24px 26px;
    text-align: center;
    margin-top: 16px;
}
.unlock-teaser .unlock-icon {
    font-size: 38px;
    line-height: 1;
    margin-bottom: 8px;
}
.unlock-teaser .unlock-tagline {
    color: #132055;
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 18px;
}
.unlock-teaser .custom-btn { justify-content: center; }

/* ============================================================================
   Wizard d'inscription (7 étapes) en fin de test — habillage "tests".
   Réutilise .main-content-box / .identify-field / .identify-cgu / .identify-error
   / .custom-btn / .steps-wrapper. Ajoute : champ code 6 chiffres, pastilles
   sexe, lien "renvoyer", jauge de robustesse MDP, écrans terminaux.
   Palette : #5B65DE / #132055 / #6B7294 — Kumbh Sans (héritée).
   ============================================================================ */

/* Un "écran" du wizard : seul l'écran .is-active est visible dans #state-signup. */
.su-screen { display: none; }
.su-screen.is-active { display: block; }

/* Compteur "Étape n / 7" sous la barre de progression */
.su-count {
    text-align: center;
    color: #6B7294;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: -12px 0 18px;
}

/* Sous-titre par étape (ex. l'e-mail rappelé sur l'écran code) */
.su-hint {
    color: #6B7294;
    font-size: 15px;
    text-align: center;
    margin: 0 0 6px;
}
.su-hint b { color: #132055; font-weight: 600; }

/* Champ OTP à 6 cases séparées — vrai champ code (auto-avance, collage,
   chiffres only côté JS). PAS un champ password : inputmode=numeric +
   data-*-ignore côté HTML → aucun gestionnaire de mots de passe ne s'y greffe.
   Look "tests" : cases carrées arrondies, bordure, focus bleu #5B65DE. */
.su-otp {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 12px auto 0;
    max-width: 340px;
}
.su-otp-cell {
    width: 48px;
    height: 58px;
    flex: 0 0 auto;
    padding: 0;
    border: 1.5px solid #E2E4ED;
    background: #F5F6FB;
    border-radius: 12px;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    color: #132055;
    font-family: inherit;
    caret-color: #5B65DE;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    -moz-appearance: textfield;
}
.su-otp-cell::-webkit-outer-spin-button,
.su-otp-cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.su-otp-cell:focus {
    outline: none;
    background: #fff;
    border-color: #5B65DE;
    box-shadow: 0 0 0 3px #ECEFFE;
}
.su-otp-cell.error { border-color: #FCA5A5; background: #FEF2F2; box-shadow: 0 0 0 3px #FEE2E2; }
/* Mobile étroit : cases un peu plus petites pour tenir sur une ligne */
@media (max-width: 400px) {
    .su-otp { gap: 7px; }
    .su-otp-cell { width: 42px; height: 52px; font-size: 22px; }
}

/* Voyant LIVE de correspondance des mots de passe (étape 5). Le champ
   « Confirmez » prend une bordure rouge/verte + un message sous le champ. */
.su-match {
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    min-height: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.su-match.ok { color: #16A34A; }
.su-match.ko { color: #DC2626; }
.su-match.ok::before { content: '✓'; font-weight: 700; }
.su-match.ko::before { content: '✕'; font-weight: 700; }
/* Bordures du champ confirm (surcharge le focus tests via box-shadow interne) */
.identify-field input.su-ok { box-shadow: 0 0 0 2px #22C55E; background: #F0FDF4; }
.identify-field input.su-ok:focus { box-shadow: 0 0 0 2px #22C55E; }
.identify-field input.su-ko { box-shadow: 0 0 0 2px #FCA5A5; background: #FEF2F2; }
.identify-field input.su-ko:focus { box-shadow: 0 0 0 2px #F87171; }

/* Lien "renvoyer le code" + timer de cooldown */
.su-resend-row {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #6B7294;
}
.su-resend-row a {
    color: #5B65DE;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.su-resend-row a[aria-disabled="true"] {
    color: #B0B5CC;
    cursor: default;
    pointer-events: none;
}
.su-resend-timer { color: #B0B5CC; }

/* Lien "modifier mon adresse e-mail" (sous le code e-mail) */
.su-edit-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #6B7294;
    cursor: pointer;
    text-decoration: none;
}
.su-edit-link:hover { color: #132055; }

/* Liens secondaires de l'écran "compte existant" (mot de passe oublié /
   modifier l'adresse) : empilés, centrés, discrets. */
.su-login-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}
.su-login-links a {
    font-size: 14px;
    color: #6B7294;
    cursor: pointer;
    text-decoration: none;
}
.su-login-links a:hover { color: #5B65DE; text-decoration: underline; }

/* Pastilles de sexe (étape naissance) */
.su-sex-group { display: flex; gap: 12px; margin-top: 6px; }
.su-sex-pill {
    flex: 1;
    text-align: center;
    padding: 14px 10px;
    border: 1.5px solid #E2E4ED;
    border-radius: 14px;
    background: #F5F6FB;
    color: #132055;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.su-sex-pill.on {
    border-color: #5B65DE;
    background: #ECEFFE;
    box-shadow: 0 0 0 1px #5B65DE inset;
}

/* Jauge de robustesse du mot de passe */
.su-pw-bar {
    height: 6px;
    border-radius: 50px;
    background: #EBECFB;
    overflow: hidden;
    margin-top: 12px;
}
.su-pw-bar > span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 50px;
    background: #5B65DE;
    transition: width 0.25s ease, background 0.25s ease;
}
.su-pw-label {
    font-size: 13px;
    color: #6B7294;
    margin-top: 6px;
    min-height: 16px;
}

/* Aide de saisie (règles MDP, note SMS) */
.su-field-help {
    font-size: 13px;
    color: #6B7294;
    margin-top: 8px;
    line-height: 1.4;
}

/* Message d'info doux (cooldown SMS, indispo) — non bloquant */
.su-info {
    display: none;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E3A8A;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 14px;
}
.su-info.show { display: block; }

/* Écran terminal "mineur" (cul-de-sac) */
.su-terminal {
    text-align: center;
    padding: 12px 0 4px;
}
.su-terminal .su-terminal-icon { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.su-terminal p { color: #6B7294; font-size: 16px; line-height: 1.5; }

/* Spinner de reprise d'état au boot du wizard */
.su-boot {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #6B7294;
    padding: 40px 0;
}
.su-boot .spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #EBECFB;
    border-top-color: #5B65DE;
    border-radius: 50%;
    display: inline-block;
    animation: suSpin 0.7s linear infinite;
}
@keyframes suSpin { to { transform: rotate(360deg); } }
