/* ==========================================================
   PAGE CARTE — styles spécifiques
   (la base visuelle vient de style.css : variables, navbar,
   boutons, badges, titres, footer)
   ========================================================== */


/* ---------- NAVBAR (barre en haut de page, sans le hero vidéo) ---------- */

.carte-topbar {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding: 0 20px;
    position: relative;
    z-index: 5;
}

.logo a {
    display: block;
    line-height: 0;
}


/* ---------- INDICATEUR D'ÉTAPES (navbar) ---------- */
/* Progression dans le parcours (carte -> questionnaire -> résultats).
   Sur cette page, la première étape est celle qui est active. */

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--text);
    font-weight: 300;
    font-size: 14px;
    color: var(--bleu);
    opacity: 0.45;
}

.step.is-active {
    opacity: 1;
}

.step.is-done {
    opacity: 0.65;
}

.step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid currentColor;
    font-size: 11px;
}

.step.is-active .step-badge {
    background: var(--bleu);
    border-color: var(--bleu);
    color: var(--noir);
}


/* ---------- FOOTER : colonne "Sections" ---------- */
/* Mêmes étapes que la navbar, avec le même code visuel : pastille numérotée,
   étape courante en pleine opacité, étapes verrouillées atténuées.
   Le `.step-badge` ci-dessus est réutilisé tel quel. */

.footer-col ul li.footer-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--text);
    font-weight: 300;
    font-size: 14px;
    color: var(--bleu);
}

/* Spécificité volontairement au-dessus de `.footer-col ul li a` (style.css),
   qui forcerait sinon la couleur blanche des liens de footer. */
.footer-col .footer-steps a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

/* Étape 1 — la seule accessible depuis cette page */
.footer-step.is-active .step-badge {
    background: var(--bleu);
    border-color: var(--bleu);
    color: var(--noir);
}

/* Étapes 2 et 3 — verrouillées : en blanc, comme les autres liens du footer,
   plutôt qu'en bleu (le bleu est réservé à l'étape accessible). La pastille et
   le cadenas suivent automatiquement, tous deux en `currentColor`.
   Sélecteur plus spécifique que `.footer-col ul li.footer-step` ci-dessus,
   sinon la couleur bleue l'emporterait. */
.footer-col ul li.footer-step.is-locked {
    color: var(--blanc);
    opacity: 0.45;
    cursor: not-allowed;
}

.footer-step-lock {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}


/* ---------- SECTION PRINCIPALE ---------- */

.carte-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 80px auto 130px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    text-align: center;
    box-sizing: border-box;
}

.carte-section .section-title {
    margin-bottom: 30px;
}

.carte-section .section-subtitle {
    margin-bottom: 60px;
}


/* ---------- CARTE (conteneur type "card" du site) ---------- */

.carte-card {
    width: 100%;
    max-width: 980px;
    box-sizing: border-box;
}

.carte-card .card-header {
    margin-bottom: 25px;
}

.carte {
    width: 100%;
}

.carte svg {
    display: block;
    width: 100%;
    height: auto;
}


/* ---------- DÉPARTEMENTS (SVG) ---------- */

.carte path.departement {
    fill: #16181d;
    stroke: rgba(103, 178, 255, 0.35);
    stroke-width: 1px;
    stroke-linecap: round;
    stroke-linejoin: round;
    cursor: pointer;
    transition: fill 0.2s ease;

    /* Supprime le délai de 300ms sur mobile */
    touch-action: manipulation;

    /* Empêche la zone grise au clic sur certains téléphones */
    -webkit-tap-highlight-color: transparent;
}

/* Département sélectionné : contour sombre pour garder les
   frontières visibles entre départements bleus adjacents */
.carte g path.departement.selectionne,
.carte g path.departement.selectionne:hover {
    fill: var(--bleu);
    stroke: rgba(0, 0, 0, 0.55);
}

/* Uniquement pour les appareils avec souris/trackpad (PC) */
@media (hover: hover) {
    .carte g path.departement:hover {
        fill: rgba(103, 178, 255, 0.4);
    }
}

/* Sur mobile : on ne touche jamais à la couleur au toucher */
@media (hover: none) {
    .carte g path.departement:hover,
    .carte g path.departement:active,
    .carte g path.departement:focus {
        outline: none !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    }
}


/* ---------- MESSAGE D'ERREUR ---------- */

#error-message {
    margin-top: 30px;
    text-align: center;
    color: #ff6b6b;
    font-family: var(--text);
    font-weight: 300;
    font-size: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#error-message.show {
    opacity: 1;
}


/* ---------- BOUTONS D'ACTION ---------- */

.carte-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 35px;
}

.carte-actions .btn {
    min-width: 150px;
    padding: 12px 24px;
}

/* Variante "contour" pour les actions secondaires */
.btn-ghost {
    background: transparent;
    color: var(--bleu);
    border: 0.5px solid var(--bleu);
}

.btn-ghost:hover {
    background-color: rgba(103, 178, 255, 0.12);
    color: var(--bleu-clair);
}


/* ---------- RESPONSIVE ---------- */

@media (max-width: 1024px) {

    .carte-section {
        margin: 50px auto 80px;
    }

    .carte-section .section-title {
        font-size: 36px;
        margin-bottom: 20px;
    }

    .carte-section .cursive-title {
        font-size: 42px;
    }

    .carte-section .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 40px;
    }

}

@media (max-width: 600px) {

    .carte-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .carte-actions .btn {
        width: 100%;
        max-width: 320px;
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {

    .carte-section .section-title {
        font-size: 44px;
    }

    .carte-section .cursive-title {
        font-size: 50px;
    }
}


/* Téléphone : le contour de 0,5 px des boutons « contour » (RETOUR, TOUT
   (DÉ)SÉLECTIONNER) perdait son trait gauche sur iPhone, Safari arrondissant
   ce demi-pixel selon la position du bouton. 1 px est toujours tracé ; le bleu
   un peu adouci garde un trait proche de l'original. */
@media (max-width: 768px) {
    .btn-ghost {
        border: 1px solid rgba(103, 178, 255, 0.75);
    }
}
