@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/satoshi-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/satoshi-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/satoshi-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/satoshi-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Chillax';
  src: url('../fonts/chillax-200.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Chillax';
  src: url('../fonts/chillax-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Chillax';
  src: url('../fonts/chillax-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Chillax';
  src: url('../fonts/chillax-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Chillax';
  src: url('../fonts/chillax-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
    --noir: #000000;
    --bleu: #67B2FF;
    --bleu-doux: #5a95d6; /* variante moins lumineuse pour le survol des boutons, comme dans style.css */
    --blanc: #F8FAFC;
    --gris1: #111214;

    --title1: 'Satoshi', sans-serif;
    --text: 'Chillax', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--noir);
    color: var(--blanc);
    font-family: var(--text);
    display: flex;
    flex-direction: column;
    /* La navbar reste collée en haut (comme sur carte/resultats) ; c'est la
       carte du questionnaire qui se centre dans la hauteur restante, via ses
       marges verticales `auto` (voir .container). */
    justify-content: flex-start;
    align-items: center;
    gap: 26px;
    padding-top: 30px;
    padding-bottom: 44px;
    /* Correction Safari : Hauteur dynamique */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* Halo bleu très léger en fond, pour une touche de profondeur */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(48% 38% at 50% 46%, rgba(103, 178, 255, 0.03), transparent 70%);
    pointer-events: none;
}

/* ---------- NAVBAR (reprise de celle de resultats_parcoursup ; cette page
   ne charge pas style.css, les règles sont donc recopiées ici) ---------- */

.qcm-topbar {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 20px;
    position: relative;
    z-index: 5;
}

.navbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    background: rgba(21, 21, 23, 0.77);
    border: 0.5px solid var(--bleu);
    border-radius: 20px;
    padding: 16px 30px;
    gap: 40px;
}

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

.logo img {
    height: 32px;
    display: block;
}

.nav-links {
    display: flex;
    gap: 35px;
    list-style: none;
    align-items: center;
    margin: 0 auto;
}

.btn {
    background: var(--bleu);
    color: var(--noir);
    border: none;
    padding: 10px 12px;
    border-radius: 5px;
    font-family: var(--text);
    font-weight: 300;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(90, 149, 214, 0.15);
}

.btn:active {
    transform: translateY(0);
}


/* ---------- INDICATEUR D'ÉTAPES (navbar) ---------- */
/* Progression dans le parcours (carte -> questionnaire -> résultats).
   Sur cette page, la deuxième é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);
}

.container {
    background: linear-gradient(180deg, rgba(103, 178, 255, 0.035), transparent 40%), var(--gris1);
    color: var(--blanc);
    border: 0.5px solid var(--bleu);
    border-radius: 24px;
    padding: 40px;
    max-width: 700px;
    width: 95%;

    /* Structure Flex pour bloquer la page */
    display: flex;
    flex-direction: column;
    max-height: 80dvh;
    /* Centre la carte dans la hauteur laissée libre sous la navbar */
    margin: auto 0;

    box-shadow: 0 0 90px rgba(103, 178, 255, 0.13);
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
}

.question {
    width: 100%;
    margin-bottom: 2vh;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.question h2 {
    font-family: var(--title1);
    font-weight: 400;
    font-size: 24px;
    line-height: 1.3;
    color: var(--blanc);
    margin-bottom: 32px;
    flex-shrink: 0;
    animation: optionIn 0.35s ease-out backwards;
    -webkit-user-select: none;
    user-select: none;
}

/* Enveloppe de la zone de scroll : repère de position pour le rail, et porte le
   décalage qui amène celui-ci près du bord droit de la carte (le contenu des
   options, lui, reste aligné avec le reste — c'est le rôle du padding). */
.options-viewport {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin-right: -26px;
    padding-right: 26px;
}

/* Zone de scroll corrigée pour Safari */
.options-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    /* Sans cette réserve en haut, le `translateY(-1px)` et le halo de
       `.options:hover` / `:has(input:checked)` de la PREMIÈRE option
       débordaient du conteneur de scroll et se faisaient rogner.
       La marge négative annule le padding : la position visuelle ne bouge pas. */
    margin-top: -10px;
    padding-top: 10px;
    /* Barre native masquée : elle est remplacée par le rail ci-dessous, qui lui
       reste affiché en permanence (voir qcm.js). */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.options-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
}


/* ---------- RAIL DE SCROLL PERMANENT (liste des options) ---------- */
/* La barre native s'efface au repos (barres « overlay » sur mobile, et sur Mac),
   alors que c'est précisément au repos qu'elle est utile ici : elle indique qu'il
   reste des réponses sous le pli. Ce rail prend sa place et reste visible tant que
   la liste déborde ; sur une question courte, rien à scroller donc rien à montrer
   (la classe `is-visible` est posée par qcm.js). */

.scroll-rail {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 6px;
    border-radius: 100px;
    background-color: rgba(103, 178, 255, 0.16);
    opacity: 0;
    transition: opacity 0.2s ease;
    /* Seul le curseur est saisissable, pour ne pas gêner le scroll au doigt. */
    pointer-events: none;
}

.scroll-rail.is-visible {
    opacity: 1;
}

.scroll-thumb {
    position: absolute;
    left: 0;
    width: 100%;
    border-radius: 100px;
    background-color: var(--bleu);
    pointer-events: auto;
    cursor: grab;
    /* Pas de transition sur `top` : le curseur doit coller au scroll. */
    touch-action: none;
}

.scroll-rail.is-dragging .scroll-thumb {
    cursor: grabbing;
}

.options {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 14px 20px 14px 54px;
    margin-bottom: 12px;
    border: 0.5px solid rgba(103, 178, 255, 0.35);
    border-radius: 14px;
    cursor: pointer;
    color: var(--blanc);
    font-family: var(--text);
    font-size: 16px;
    font-weight: 300;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    animation: optionIn 0.35s ease-out backwards;
    -webkit-user-select: none;
    user-select: none;
}

/* Cascade d'apparition des options */
.options:nth-child(1) { animation-delay: 0.04s; }
.options:nth-child(2) { animation-delay: 0.08s; }
.options:nth-child(3) { animation-delay: 0.12s; }
.options:nth-child(4) { animation-delay: 0.16s; }
.options:nth-child(5) { animation-delay: 0.20s; }
.options:nth-child(6) { animation-delay: 0.24s; }
.options:nth-child(n+7) { animation-delay: 0.28s; }

.options:hover {
    border-color: var(--bleu);
    background-color: rgba(103, 178, 255, 0.06);
    transform: translateY(-1px);
}

.options:has(input:checked) {
    border-color: var(--bleu);
    background-color: rgba(103, 178, 255, 0.1);
    box-shadow: 0 0 0 1px var(--bleu) inset, 0 6px 22px rgba(103, 178, 255, 0.08);
}

.options input {
    opacity: 0;
    position: absolute;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    height: 22px;
    width: 22px;
    background-color: transparent;
    border: 1.5px solid var(--bleu);
    border-radius: 50%;
    transition: box-shadow 0.2s ease;
}

.options:has(input:checked) .checkmark {
    box-shadow: 0 0 8px rgba(103, 178, 255, 0.45);
}

.checkmark:after {
    content: "";
    width: 10px;
    height: 10px;
    display: block;
    background: var(--bleu);
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: 300ms ease-in-out;
}

.options input:checked ~ .checkmark:after {
    transform: translate(-50%, -50%) scale(1);
}

.d-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin-top: 14px;
    gap: 16px;
    flex-shrink: 0;
}

/* Même gabarit que les boutons de index.html (`.btn` / `.btn-cta` de
   style.css) : mêmes dimensions, même typo, et le même mouvement au survol
   (remontée de 2px + ombre portée). */
.btn-primary, .btn-success {
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: var(--text);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: background-color 0.25s ease, color 0.25s ease,
                border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

/* Suivant / Terminer — action principale : bouton plein, identique au CTA
   de index.html. C'est lui qui doit ressortir. */
.btn-success {
    background-color: var(--bleu);
    color: var(--noir);
}

.btn-success:hover {
    background-color: var(--bleu-doux);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(90, 149, 214, 0.15);
}

.btn-success:active {
    transform: translateY(0);
}

/* Précédent — action secondaire : même gabarit mais en retrait (contour
   discret), pour ne pas concurrencer Suivant. */
.btn-primary {
    background: transparent;
    color: var(--bleu);
    border: 0.5px solid rgba(103, 178, 255, 0.35);
}

.btn-primary:hover {
    background-color: rgba(103, 178, 255, 0.08);
    border-color: var(--bleu);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

#progress-wrapper {
    width: 100%;
    margin-bottom: 32px;
    flex-shrink: 0;
}

#progress-text {
    text-align: center;
    font-family: var(--title1);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    color: var(--bleu);
}

#progress-container {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: var(--bleu);
    border-radius: 100px;
    box-shadow: 0 0 12px rgba(103, 178, 255, 0.55);
    transition: width 0.35s ease;
}

#error-message {
    padding-left: 4px;
    color: #ff6b6b;
    font-weight: 400;
    font-size: 16px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 14px;
}

#error-message.show {
    opacity: 1;
    max-height: 100px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes optionIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   BOUTON DE CHARGEMENT (spinner Terminer)
========================================= */
#next.loading {
    pointer-events: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    padding: 0;
    position: relative;
    background-color: var(--bleu);
    display: flex;
    align-items: center;
    justify-content: center;
}

#next.loading::after {
    content: "";
    border: 3px solid var(--noir);
    border-top: 3px solid transparent;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========================================
   ECRAN DE TRANSITION (clic "Terminer" -> resultats)
========================================= */
.transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--noir);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.transition-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(48% 38% at 50% 46%, rgba(103, 178, 255, 0.14), transparent 70%);
    pointer-events: none;
}

.transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.transition-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
}

.transition-overlay.active .transition-inner {
    opacity: 1;
    transform: translateY(0);
}

.transition-logo-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transition-logo {
    width: 140px;
    height: 140px;
}

.transition-ring {
    position: absolute;
    inset: 0;
    width: 220px;
    height: 220px;
    animation: ringRotate 1.4s linear infinite;
}

.transition-ring-bg {
    fill: none;
    stroke: rgba(103, 178, 255, 0.12);
    stroke-width: 3;
}

.transition-ring-fg {
    fill: none;
    stroke: var(--bleu);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 220 327;
}

.transition-text {
    font-family: var(--title1);
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--blanc);
    opacity: 0.85;
}

.transition-text .dots span {
    opacity: 0;
    animation: dotBlink 1.4s infinite;
}

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

@keyframes ringRotate {
    from { transform: rotate(-90deg); }
    to { transform: rotate(270deg); }
}

@keyframes dotBlink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* ---------- Loader "v2" (ecran de transition) ----------
   Pas de halo ni d'anneau qui tourne : lion fixe, un trait qui se remplit UNE fois sur
   la duree minimum d'attente (2.2s cote JS), et trois etapes de texte qui s'enchainent.
   Toutes les animations sont accrochees a .active : elles repartent de zero a chaque ouverture. */
.loader-v2::before {
    display: none;
}

.loader-v2 .transition-inner {
    gap: 0;
}

.loader-logo-wrap {
    width: 190px;
    height: 190px;
    margin-bottom: 40px;
    opacity: 0;
    transform: scale(0.96);
}

.loader-logo-wrap .loader-logo {
    width: 100%;
    height: 100%;
}

.loader-track {
    position: relative;
    width: 240px;
    height: 3px;
    border-radius: 100px;
    background: rgba(103, 178, 255, 0.18);
    overflow: hidden;
    margin-bottom: 24px;
}

.loader-fill {
    position: absolute;
    inset: 0;
    background: var(--bleu);
    transform: scaleX(0);
    transform-origin: left center;
}

.loader-steps {
    display: grid;
    margin: 0;
    font-family: var(--title1);
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--blanc);
    text-align: center;
}

/* Les trois etapes occupent la meme cellule : le bloc prend la largeur de la plus longue. */
.loader-step {
    grid-area: 1 / 1;
    opacity: 0;
}

/* Memes trois points clignotants que l'ancienne version (keyframes dotBlink ci-dessus). */
.loader-step .dots span {
    opacity: 0;
    animation: dotBlink 1.4s infinite;
}
.loader-step .dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-step .dots span:nth-child(3) { animation-delay: 0.4s; }

.loader-v2.active .loader-logo-wrap {
    animation: loaderLogoIn 0.6s ease-out 0.15s forwards;
}

.loader-v2.active .loader-fill {
    animation: loaderFill 2.3s cubic-bezier(0.45, 0, 0.2, 1) 0.3s forwards;
}

.loader-v2.active .loader-step:nth-child(1) {
    animation: loaderStepPass 0.8s ease 0.35s forwards;
}
.loader-v2.active .loader-step:nth-child(2) {
    animation: loaderStepPass 0.8s ease 1.15s forwards;
}
.loader-v2.active .loader-step:nth-child(3) {
    animation: loaderStepStay 0.4s ease 1.95s forwards;
}

@keyframes loaderLogoIn {
    to { opacity: 1; transform: scale(1); }
}

@keyframes loaderFill {
    to { transform: scaleX(1); }
}

/* Etape intermediaire : arrive par le bas, reste, repart par le haut. */
@keyframes loaderStepPass {
    0%   { opacity: 0; transform: translateY(6px); }
    25%  { opacity: 0.85; transform: translateY(0); }
    80%  { opacity: 0.85; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-6px); }
}

/* Derniere etape : arrive et reste affichee (si le serveur met plus longtemps). */
@keyframes loaderStepStay {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 0.85; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .loader-v2.active .loader-step:nth-child(1),
    .loader-v2.active .loader-step:nth-child(2) {
        animation: none;
    }
    .loader-v2.active .loader-step:nth-child(3) {
        animation-delay: 0s;
    }
}

/* =========================================
   MODALE DE CONSENTEMENT (CGU/CGV, age, confidentialite)
   Affichee au clic sur "Terminer", avant l'envoi reel des reponses.
========================================= */
.consent-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

.consent-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.consent-box {
    width: 100%;
    max-width: 520px;
    background: linear-gradient(180deg, rgba(103, 178, 255, 0.035), transparent 40%), var(--gris1);
    border: 0.5px solid var(--bleu);
    border-radius: 16px;
    padding: 40px 34px;
    color: var(--blanc);
}

.consent-check {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 18px 18px;
    cursor: pointer;
    font-family: var(--text);
    font-weight: 300;
    font-size: 0.98rem;
    line-height: 1.35;
    background: transparent;
    border: 0.5px solid rgba(103, 178, 255, 0.25);
    border-radius: 10px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.consent-check:hover {
    border-color: var(--bleu);
}

.consent-check:has(input:checked) {
    background: rgba(103, 178, 255, 0.08);
    border-color: var(--bleu);
}

/* Case à cocher dans la DA du site (même rendu que les filtres des résultats) : carré arrondi
   à fine bordure bleue, rempli de bleu avec une coche noire une fois cochée. */
.consent-check input {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 0.5px solid var(--bleu);
    border-radius: 6px;
    background: transparent center / 13px 13px no-repeat;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.consent-check input:checked {
    background-color: var(--bleu);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.consent-check:hover input:not(:checked) {
    border-color: var(--bleu-clair);
}

.consent-check input:focus-visible {
    outline: 2px solid var(--bleu-clair);
    outline-offset: 2px;
}

.consent-check a,
.consent-privacy a {
    color: var(--bleu);
}

.consent-privacy {
    font-size: 0.82rem;
    opacity: 0.75;
    margin: 14px 2px 0;
}

#consent-error {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 16px;
}

.consent-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
}

/* =========================================
   RESPONSIVE — NAVBAR
   Mêmes règles que la page carte, qui les tient de style.css (non chargé ici,
   cette page est autonome) : sous 1024px la barre se resserre et les étapes en
   sortent, puis elles y reviennent en plus compact entre 769 et 1024px.
========================================= */

@media (max-width: 1024px) {

    .navbar {
        padding: 12px 16px;
        gap: 0;
        justify-content: space-between;
        border-radius: 14px;
    }

    .nav-links {
        display: none;
    }

    .logo img {
        height: 26px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {

    .nav-links {
        display: flex;
        gap: 14px;
    }

    .navbar {
        gap: 14px;
        padding: 16px 18px;
    }
}

/* Sous 768px il ne reste que le logo et le bouton : sans `gap`, celui du média
   1024px (`gap: 0`) les colle l'un à l'autre. Mêmes valeurs que sur carte, qui
   les tient du bloc burger de style.css. */
@media (max-width: 768px) {

    .navbar {
        gap: 10px;
        padding: 10px 12px;
    }
}

/* Popup */
#leave-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}


/* ---------- PAGES JURIDIQUES EN FENÊTRE (voir ../juridique-modale.js) ----------
   CGU-CGV et confidentialité, ouvertes depuis la fenêtre de consentement :
   affichées plein écran par-dessus le QCM, au-dessus de toutes ses fenêtres. */
.juridique-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--noir);
}

.juridique-overlay.active {
    display: block;
}

.juridique-cadre {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* La page du QCM ne défile pas derrière la fenêtre */
html.juridique-ouvert,
html.juridique-ouvert body {
    overflow: hidden;
}


/* Téléphone : le contour de 0,5 px de « Précédent » perdait son trait gauche
   sur iPhone (Safari arrondit ce demi-pixel selon la position du bouton). 1 px
   est toujours tracé, dans le même bleu discret. */
@media (max-width: 768px) {
    .btn-primary {
        border-width: 1px;
    }

    /* Réponses : même souci de contour à 0,5 px (trait gauche ou du haut perdu
       selon la position de la carte à l'écran). */
    .options {
        border-width: 1px;
    }

    /* Fenêtre de consentement : même souci sur les deux cases à cocher (trait du
       haut coupé près du coin) et sur le cadre de la fenêtre. */
    .consent-check,
    .consent-box {
        border-width: 1px;
    }

    /* Même chose pour la barre de navigation et le cadre de la carte des questions. */
    .navbar,
    .container {
        border-width: 1px;
    }

    /* Réponse cochée : sans le halo extérieur, qui débordait vers le bas et se
       faisait trancher net par la zone de défilement (bande claire à bord droit).
       Le fond bleuté et le double contour suffisent à la distinguer. */
    .options:has(input:checked) {
        box-shadow: 0 0 0 1px var(--bleu) inset;
    }
}


/* Écrans tactiles : il n'y a pas de vrai survol, mais Safari (et Chrome) gardent
   l'état :hover sur le dernier bouton touché. Après un appui sur « Suivant »,
   le bouton de la question suivante restait donc remonté de 2 px, plus foncé et
   avec son ombre, un peu plus haut que « Précédent ». On neutralise ce survol. */
@media (hover: none) {
    .btn:hover,
    .btn-success:hover,
    .btn-primary:hover {
        transform: none;
        box-shadow: none;
    }

    .btn-success:hover {
        background-color: var(--bleu);
    }

    .btn-primary:hover {
        background-color: transparent;
        border-color: rgba(103, 178, 255, 0.35);
    }
}
