/* Le quiz v5 (lot 3). Charge APRES ../rapport/rapport.css, dont il reprend tout le socle : jetons
   sable / taupe / nuit, Inter Tight 300 + 400, barre haute, boutons, .wrap, .eyebrow. Aucun second
   jeu de couleurs. Registres de la v4 validee (public/assets/quiz.css) : sable pour repondre, taupe
   pour l'ecran de message (expliquer), nuit pour l'apercu du rapport. Classes du quiz : prefixe q-. */

html[data-register="taupe"], html[data-register="taupe"] body { background: var(--taupe); }
html[data-register="taupe"] { --fg-2: var(--ink); --line: rgba(23, 21, 15, 0.34); }
html[data-register="taupe"] .bar { border-bottom-color: rgba(23, 21, 15, 0.22); }
html[data-register="taupe"] .bar-r { color: var(--ink); }

/* Le commutateur FR / EN (barre du quiz et du rapport) : le texte de la barre (graphite sur sable,
   ink sur taupe), la langue active en ink plein. Meme corps que la barre (16 px) : aucune mesure du
   rendu ne baisse. Sur mobile, le nom du test s'efface pour lui laisser la place (comme la v3). */
.bar-r.has-sw { align-items: center; }
.lang-sw { display: inline-flex; align-items: center; gap: 2px; margin-right: -9px; }
.lang-sw button {
  font: inherit; font-size: 16px; line-height: 1; letter-spacing: 0.04em;
  padding: 7px 9px; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.lang-sw button.is-on { background: var(--ink); color: var(--sable); cursor: default; }
.lang-sw button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 719px) { .bar-r.has-sw .bar-name { display: none; } }
/* Sur mobile, la cible tactile de chaque langue fait 44 px de haut ; la pastille ne change pas. */
@media (max-width: 719px) {
  .lang-sw button { position: relative; }
  .lang-sw button::after { content: ""; position: absolute; inset: -7px 0; }
}
/* En anglais, la langue pressee est le dernier bouton : sa pastille pleine s'arrete a la marge (la
   marge negative, faite pour le texte de EN non presse, la ferait deborder). */
html[lang="en"] .lang-sw { margin-right: 0; }

.q-screen {
  min-height: calc(100dvh - 65px);
  padding: clamp(24px, 6vh, 72px) 0 clamp(32px, 6vh, 72px);
  animation: q-in 320ms var(--ease) both;
}
@keyframes q-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .q-screen { animation: none; }
  .q-track > span, .q-card { transition: none !important; }
}
.q-noscript { padding: 32px 16px; font-size: 18px; }

/* ---------- Accueil ---------- */
.q-land-grid { display: grid; gap: clamp(40px, 5vw, 72px); align-items: center; }
@media (min-width: 1024px) { .q-land-grid { grid-template-columns: 1.08fr 0.92fr; min-height: calc(100dvh - 65px - clamp(24px, 6vh, 72px) * 2); } }
.q-land-title {
  font-size: clamp(42px, 6.2vw, 92px); font-weight: 300; line-height: 0.98; letter-spacing: -0.03em;
  max-width: 10em; text-wrap: balance;
}
.q-land-title:focus { outline: none; }
.q-land-by { margin-top: clamp(22px, 3vw, 36px); font-size: 17px; color: var(--graphite); }
.q-land-body { margin-top: 10px; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.45; max-width: 30em; }
/* Aucun mot seul en derniere ligne. */
.q-land-body, .q-land-hint { text-wrap: pretty; }
.q-land-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: clamp(28px, 3.4vw, 44px); }
.q-land-hint { font-size: 16px; color: var(--graphite); max-width: 26em; }
/* En anglais, « Start » est court : au grand ecran l'aide tiendrait a cote du bouton, la colonne
   serait plus courte et le titre descendrait. L'aide passe sous le bouton, comme en francais. */
@media (min-width: 1024px) { html[lang="en"] .q-land-cta { flex-direction: column; align-items: flex-start; } }

/* L'apercu du rapport, dessine (nuit, comme le bloc qui affirme dans le rapport). */
.q-preview {
  display: grid; gap: 14px; align-content: start;
  background: var(--nuit); color: var(--sable); border-radius: 12px;
  padding: clamp(24px, 2.6vw, 36px);
  box-shadow: 0 30px 60px -30px rgba(23, 21, 15, 0.45);
}
.q-preview .eyebrow { color: var(--graphite-nuit); text-wrap: balance; }
.q-preview i { display: block; height: 10px; border-radius: 3px; background: var(--filet-nuit); }
.q-pv-title { display: grid; gap: 9px; margin: 2px 0 6px; }
.q-pv-title i { height: 18px; background: var(--filet-nuit); }
.q-pv-title i:first-child { width: 88%; }
.q-pv-title i:nth-child(2) { width: 64%; }
.q-pv-title i:last-child { width: 72%; height: 10px; margin-top: 8px; background: var(--filet-nuit); }
.q-pv-k { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--filet-nuit); }
.q-pv-org { display: grid; gap: 14px; }
.q-pv-you { justify-self: center; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sable); color: var(--ink); font-size: 14px; font-weight: 500; }
.q-pv-org ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.q-pv-org li { display: grid; gap: 7px; align-content: start; padding: 12px 10px 14px; border-radius: 8px; background: var(--nuit-2); border: 1px solid var(--filet-nuit); }
.q-pv-org em { font-style: normal; font-size: 14px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite-nuit); min-height: 18px; line-height: 1.25; }
/* Anglais : « NEXT BOTTLENECK » deborderait d'une carte etroite (quatre colonnes, grand ecran) : les
   cartes de l'apercu passent sur deux colonnes, comme sur mobile. Le francais ne change pas. */
html[lang="en"] .q-pv-org ol { grid-template-columns: 1fr 1fr; }
.q-pv-org li i:last-child { width: 62%; }
.q-pv-org li.is-lit { background: var(--sable); border-color: var(--sable); }
.q-pv-org li.is-lit em { color: var(--graphite); }
.q-pv-org li.is-lit i { background: var(--filet); }
.q-pv-org li.is-mur { border-top: 2px solid var(--etat-nuit); }
.q-pv-org li.is-mur em { color: var(--sable); }
.q-pv-acts { display: grid; gap: 10px; }
.q-pv-acts li { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; }
.q-pv-acts b { font-size: 16px; font-weight: 300; color: var(--taupe); }
/* Sous 1024 px, l'apercu passe sous le bouton (comme la v4) : l'accueil tient dans le premier ecran. */
@media (max-width: 1023px) { .q-preview { margin-top: 48px; max-width: 560px; } }

/* ---------- Une question : colonne de gauche (retour, rang, progression), la question ---------- */
.q-grid { display: grid; gap: 28px; }
@media (min-width: 1024px) {
  .q-grid { grid-template-columns: 220px minmax(0, 1fr); gap: clamp(48px, 6vw, 104px); align-items: start; }
}
.q-side { display: grid; gap: 18px; align-content: start; }
.q-back {
  position: relative; justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 2px; background: none; border: 0; border-radius: 6px;
  font-size: 16px; color: var(--fg-2);
}
/* La cible tactile fait 44 px de haut (40 dessines) : une zone invisible, la mise en page ne bouge pas. */
.q-back::after { content: ""; position: absolute; inset: -2px 0; }
.q-back:hover { color: var(--ink); }
.q-back:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.q-back svg { width: 16px; height: 16px; }
.q-n { font-size: clamp(64px, 7vw, 104px); font-weight: 300; line-height: 0.9; letter-spacing: -0.04em; font-variant-numeric: proportional-nums; }
.q-track { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.q-track > span { display: block; height: 100%; background: var(--ink); transition: width 520ms var(--ease); }

.q-main { min-width: 0; margin: 0; padding: 0; border: 0; }
.q-kicker { margin-bottom: 14px; }
.q-title {
  font-size: clamp(32px, 3.3vw, 50px); font-weight: 300; line-height: 1.06; letter-spacing: -0.025em;
  max-width: 19em; text-wrap: balance;
}
/* Une question courte (« Vous faites quoi, concrètement ? ») prend l'echelle de la v4. */
.q-title.is-short { font-size: clamp(40px, 4.6vw, 66px); line-height: 1.02; letter-spacing: -0.028em; max-width: 14em; }
.q-title:focus, .q-msg:focus, .q-status-t:focus { outline: none; }
.q-hint { margin-top: 14px; font-size: 17px; color: var(--graphite); max-width: 36em; }

/* Les options : de vrais boutons radio (ou cases), la carte en est le dessin. */
.q-opts { display: grid; gap: 10px; margin-top: clamp(24px, 3.4vh, 36px); max-width: 880px; }
@media (min-width: 1024px) { .q-opts.is-many { grid-template-columns: 1fr 1fr; } }
/* La carte remplit sa cellule : dans une rangee, toutes les cartes ont la meme hauteur. */
.q-opt { position: relative; display: grid; cursor: pointer; }
.q-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.q-card {
  display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 16px;
  min-height: 72px; padding: 14px 22px 14px 18px;
  background: var(--sable-2); border: 1px solid var(--filet); border-radius: 8px;
  font-size: 20px; line-height: 1.28; color: var(--ink);
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}
.q-opts.is-many .q-card { min-height: 64px; font-size: 19px; }
.q-key {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--filet); border-radius: 6px;
  font-size: 14px; font-weight: 500; letter-spacing: 0.06em; color: var(--graphite);
}
.q-opt:hover .q-card { border-color: var(--taupe); transform: translateY(-1px); }
.q-opt input:focus-visible + .q-card { outline: 2px solid var(--ink); outline-offset: 2px; }
.q-opt input:checked + .q-card { background: var(--ink); border-color: var(--ink); color: var(--sable); }
.q-opt input:checked + .q-card .q-key { border-color: var(--graphite-nuit); color: var(--sable); }
/* Choix multiple : la case se coche dans la pastille. */
.q-opts.is-multi .q-opt input:checked + .q-card .q-key { background: var(--sable); color: var(--ink); border-color: var(--sable); }

.q-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 24px; }
.q-actions.is-quiet .btn { display: none; }
/* Desactive : fond de la page, filet et texte graphite (jamais un gris d'opacite), distinct des
   boutons secondaires pleins (sable profond) de l'ecran du site. Sur taupe, texte ink. */
.btn:disabled { background: transparent; border-color: var(--filet); color: var(--graphite); cursor: not-allowed; transform: none; }
html[data-register="taupe"] .btn:disabled { border-color: rgba(23, 21, 15, 0.34); color: var(--ink); }
.q-keys { font-size: 16px; color: var(--graphite); }
@media (max-width: 1023px) { .q-keys { display: none; } .q-actions.is-quiet { display: none; } }

/* L'ecran objectif : deux choix cote a cote, chacun sous son intitule. */
.q-pair { display: grid; gap: 28px; margin-top: clamp(24px, 3.4vh, 36px); max-width: 880px; }
@media (min-width: 720px) { .q-pair { grid-template-columns: 1fr 1fr; } }
.q-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.q-group-l { display: block; padding: 0; margin-bottom: 12px; color: var(--graphite); }
.q-group .q-opts { margin-top: 0; }
.q-pair .q-card { min-height: 60px; font-size: 19px; }

/* ---------- Ecran de message (taupe : il explique) ---------- */
.q-msg {
  font-size: clamp(30px, 3.6vw, 54px); font-weight: 300; line-height: 1.14; letter-spacing: -0.02em;
  max-width: 19em; text-wrap: balance; min-height: 2.3em;
}
.q-message .q-actions { margin-top: clamp(28px, 4vh, 48px); }
.q-message .q-n { color: var(--ink); }

/* ---------- Champs (site, dernier ecran) ---------- */
.q-fields { display: grid; gap: 16px; margin-top: clamp(24px, 3.4vh, 36px); max-width: 880px; }
@media (min-width: 720px) { .q-fields { grid-template-columns: 1fr 1.4fr; } }
.q-field { display: grid; gap: 8px; margin-top: clamp(20px, 3vh, 32px); max-width: 720px; }
.q-fields .q-field { margin-top: 0; }
.q-field label { font-size: 14px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--graphite); }
.q-input {
  display: block; width: 100%; min-height: 56px; padding: 14px 18px;
  border: 1px solid var(--filet); border-radius: 8px; background: var(--sable-2); color: var(--ink);
  font: inherit; font-size: 19px; line-height: 1.3;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}
.q-input::placeholder { color: var(--graphite); opacity: 0.75; }
.q-input:focus { outline: none; border-color: var(--ink); background: var(--sable); }
.q-input.is-invalid { border-color: var(--etat); }
.q-url { font-size: clamp(20px, 2vw, 26px); font-weight: 300; }
.q-err { font-size: 16px; color: var(--etat); }
.q-err[hidden] { display: none; }
.q-or { margin-top: clamp(28px, 4vh, 44px); }
.q-alt { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.q-alt .btn.ghost { border-color: var(--filet); background: var(--sable-2); }
.q-alt .btn.ghost:hover { border-color: var(--ink); }
.q-alt .btn.is-on { border-color: var(--ink); }
.q-role { margin-top: clamp(24px, 3.4vh, 32px); max-width: 880px; }
.q-role .q-opts { gap: 8px; }
@media (min-width: 720px) { .q-role .q-opts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.q-role .q-card { min-height: 56px; font-size: 18px; }
/* Role manquant : meme signal que les champs (filet d'etat), sur chacune des trois cartes. */
.q-role.is-invalid .q-card { border-color: var(--etat); }

/* ---------- Attente, erreur ---------- */
.q-status .wrap { display: grid; align-content: start; gap: 16px; padding-top: clamp(24px, 12vh, 140px); }
.q-status-t { font-size: clamp(30px, 3.6vw, 54px); font-weight: 300; line-height: 1.1; letter-spacing: -0.02em; }
.q-status-p { font-size: 18px; color: var(--graphite); max-width: 32em; }
.q-dots { display: inline-flex; gap: 6px; margin-left: 14px; vertical-align: middle; }
.q-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); animation: q-pulse 1.2s ease-in-out infinite; }
.q-dots i:nth-child(2) { animation-delay: 0.2s; }
.q-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes q-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .q-dots i { animation: none; } }

/* « Refaire le test », dans le pied du rapport. */
.q-restart { position: relative; background: none; border: 0; padding: 4px 0; font-size: 16px; color: var(--graphite); text-decoration: underline; text-underline-offset: 3px; }
/* La cible tactile fait 44 px de haut (32 dessines) : une zone invisible au-dessus et au-dessous. */
.q-restart::after { content: ""; position: absolute; inset: -6px 0; }
.q-restart:hover { color: var(--ink); }
.q-restart:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Mobile : une question tient dans l'ecran, sans defiler ---------- */
@media (max-width: 1023px) {
  .q-screen { padding: 14px 0 28px; }
  .q-grid { gap: 18px; }
  .q-side { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
  .q-n { order: 3; font-size: 16px; font-weight: 500; letter-spacing: 0.08em; line-height: 1; color: var(--graphite); }
  .q-track { order: 2; }
}
@media (max-width: 719px) {
  .q-landing { padding-top: 32px; }
  /* Apercu a 390 : quatre postes en deux rangees, pour que les etiquettes tiennent dans leur carte. */
  .q-pv-org ol { grid-template-columns: 1fr 1fr; }
  .q-land-grid { gap: 0; }
  .q-land-title { font-size: 40px; }
  .q-land-by { margin-top: 18px; font-size: 16px; }
  .q-land-body { font-size: 18px; line-height: 1.42; }
  .q-land-cta { margin-top: 24px; }
  .q-land-cta .btn { width: 100%; }
  .q-kicker { margin-bottom: 8px; }
  .q-title, .q-title.is-short { font-size: 24px; line-height: 1.16; letter-spacing: -0.015em; }
  .q-title.is-short { font-size: 30px; line-height: 1.1; }
  .q-hint { margin-top: 8px; font-size: 16px; line-height: 1.4; }
  .q-opts { gap: 7px; margin-top: 18px; }
  .q-card, .q-opts.is-many .q-card { grid-template-columns: 26px 1fr; gap: 12px; min-height: 48px; padding: 10px 14px 10px 12px; font-size: 16px; line-height: 1.3; }
  .q-key { width: 26px; height: 26px; font-size: 14px; border-radius: 5px; }
  .q-actions { margin-top: 16px; }
  .q-actions .btn { width: 100%; min-height: 52px; }
  .q-pair { gap: 18px; margin-top: 18px; }
  .q-pair .q-opts { grid-template-columns: 1fr 1fr; }
  .q-pair .q-card { min-height: 46px; font-size: 16px; }
  .q-group-l { margin-bottom: 8px; }
  .q-msg { font-size: 27px; line-height: 1.2; }
  .q-message .q-actions { margin-top: 24px; }
  .q-field { margin-top: 18px; }
  .q-fields { margin-top: 18px; gap: 12px; }
  .q-input { min-height: 50px; font-size: 17px; padding: 12px 14px; }
  .q-url { font-size: 19px; }
  .q-or { margin-top: 22px; }
  .q-alt { display: grid; gap: 8px; margin-top: 8px; }
  .q-alt .btn { width: 100%; min-height: 50px; font-size: 16px; }
  .q-role { margin-top: 18px; }
  .q-role .q-card { min-height: 46px; font-size: 16px; }
  .q-status-t { font-size: 28px; }
}

/* ---------- Lot 4 : dernier ecran (champ piege, confidentialite), rapport (WhatsApp) ---------- */
/* Le champ piege : hors ecran, ni vu ni atteint au clavier (tabindex -1, aria-hidden). */
.q-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* La ligne de confidentialite sous le bouton : petite, graphite, le lien souligne. */
.q-consent { margin-top: 18px; max-width: 40em; font-size: 14px; line-height: 1.5; color: var(--graphite); text-wrap: pretty; }
.q-consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.q-consent a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
/* Le bloc WhatsApp, apres le niveau d'autonomie : la carte du partage, un champ et son bouton. */
.r-wa { padding-top: clamp(8px, 1vw, 16px); }
.wa-side { display: grid; gap: 10px; width: 100%; }
/* Les deux colonnes alignees en haut : le titre ne bouge pas quand l'erreur ou la confirmation s'affiche. */
@media (min-width: 900px) { .wa-card { grid-template-columns: 1fr minmax(320px, 420px); align-items: start; } }
.wa-side .q-input { background: var(--sable); }
/* L'erreur sur la carte (sable profond) : en encre, marquee d'un point d'etat (le rouge d'etat ne
   tient pas 4,5:1 sur ce fond ; la DA le reserve aux points et aux filets). */
.wa-err { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.wa-err::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--etat); transform: translateY(-1px); }
.wa-err[hidden] { display: none; }
.wa-side .btn[disabled] { opacity: 0.55; cursor: progress; }
.wa-done { font-size: 18px; line-height: 1.45; }
.wa-fix { font-size: 16px; line-height: 1.45; color: var(--graphite); }
.wa-fix a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.wa-n { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Sur mobile (quiz.js, whatsappHtml fold), le bloc replie : une ligne entre deux filets (le sien et
   celui du pied), le titre en encre a la taille du texte, sur une ligne ; ouvert, la carte dessous. */
/* La barre d'appel, retiree tant que le bloc WhatsApp est a l'ecran (quiz.js). */
.cta-bar.is-off { display: none; }
.r-wa.is-fold { padding: 0; }
.wa-fold { border-top: 1px solid var(--filet); }
.wa-sum { display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; }
.wa-sum:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
.wa-sum-h { font-size: 17px; font-weight: 400; line-height: 1.35; letter-spacing: 0; color: var(--ink); }
.wa-sum .o-more { margin-left: auto; color: var(--graphite); }
.wa-fold[open] { padding-bottom: 28px; }
.wa-fold .share-p { margin-top: 0; }
@media (max-width: 719px) {
  /* Le dernier ecran en erreur (trois messages) tient encore a 390×844 avec sa ligne. */
  .q-consent { margin-top: 12px; font-size: 14px; line-height: 1.4; }
  [data-screen="gate"] .q-field { gap: 6px; }
  [data-screen="gate"] .q-err { line-height: 1.35; }
  main[data-screen="gate"] { padding-bottom: 18px; }
  .wa-side .btn { width: 100%; min-height: 50px; }
  .r-wa { padding-bottom: 28px; }
  .wa-card { gap: 16px; }
}
