/* Quiz Kiffe Ta Diète. Charte : 1 Direction/Charte graphique.md */
:root {
  --red: #d8311c;
  --red-dark: #9e1414;
  --ink: #111111;
  --muted: #5a5452;
  --paper: #ffffff;
  --sand: #f6f3f1;
  --hair: #e3dcd8;
  --red-soft: #fcefed;
  --font-title: Anton, Impact, sans-serif;
  --font-text: Inter, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* 12/11/2026 : l'écran qui glisse depuis la droite élargissait la page (415 px pour 375) : page dézoomée sur iPhone. */
  overflow-x: hidden;
}
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-dark); }

/* En-tête */
.top { position: sticky; top: 0; z-index: 10; background: var(--paper); }
.top-inner {
  max-width: 640px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
.band {
  margin: 0; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.02em; line-height: 1.35; color: var(--red-dark); text-transform: uppercase;
}
.progress { height: 3px; background: var(--hair); }
.progress-fill { height: 100%; width: 0; background: var(--red); transition: width .35s ease; }
.top.is-hidden-progress .progress { visibility: hidden; }

/* Écrans */
.app { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; overflow-x: clip; }
.screen { animation: enter .3s ease both; }
/* Le premier écran s'affiche tout de suite, sans animation : c'est lui que la pub fait attendre. */
.app > .screen.is-first { animation: none; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } .progress-fill { transition: none; } }

.back {
  appearance: none; border: 0; background: none; padding: 6px 0; margin: 0 0 10px;
  font: 600 14px var(--font-text); color: var(--muted); cursor: pointer;
}
.back:hover { color: var(--ink); }
.step-label {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--red); margin: 0 0 8px;
}
h1, h2 { margin: 0 0 14px; }
.title {
  /* Version B (09/11/2026) : Inter très gras plutôt qu'Anton, plus lisible sur une phrase longue (retour de l'office hour Kohlmann). */
  font-family: var(--font-text); font-weight: 800; text-transform: none;
  font-size: clamp(25px, 6.6vw, 34px); line-height: 1.2; letter-spacing: -0.015em;
}
.title em { font-style: normal; color: var(--red); }
.question { font-size: clamp(21px, 5.4vw, 26px); font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.quote {
  display: block; margin-top: 10px; font-weight: 600; font-style: italic; color: var(--red-dark);
}
.hint { margin: -6px 0 16px; font-size: 14px; color: var(--muted); }
.lead { font-size: 18px; margin: 0 0 18px; }
.text p { margin: 0 0 12px; }
.text p:last-child { margin-bottom: 0; }
.text strong { color: var(--red-dark); }

/* Page résultat de B (19/11/2026) : le contenu de A (félicitations, accroche, 2 paragraphes, bouton sur 2 lignes) à la charte. */
.result .title { margin-bottom: 10px; }
.result-head { font-size: 19px; line-height: 1.4; margin: 0 0 14px; }
.result-text p { margin: 0 0 12px; }
.result-text em { font-style: normal; font-weight: 700; color: var(--red); }
.btn-2l { padding-top: 13px; padding-bottom: 13px; }
.btn-2l .btn-lines { display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.btn-2l .btn-l2 { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .85); }
@media (min-width: 768px) {
  .result .video { max-width: 640px; margin-left: auto; margin-right: auto; }
  .result .btn-2l { display: flex; max-width: 420px; margin-left: auto; margin-right: auto; }
}

/* Réponses */
.options { display: grid; gap: 10px; margin: 18px 0 0; }
.options.cols-2 { grid-template-columns: 1fr 1fr; }
.options.cols-3 { grid-template-columns: repeat(3, 1fr); }
.opt {
  appearance: none; width: 100%; text-align: left; cursor: pointer;
  border: 1.5px solid var(--hair); border-radius: var(--radius); background: var(--paper);
  padding: 15px 16px; font: 600 16px/1.35 var(--font-text); color: var(--ink);
  display: flex; align-items: center; gap: 12px;
  transition: border-color .15s, background .15s, transform .15s;
}
@media (hover: hover) { .opt:hover { border-color: var(--red); } }
.opt:active { transform: scale(.99); }
.opt:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.opt .emoji { flex: none; width: 28px; font-size: 22px; line-height: 1; text-align: center; }
.opt.is-on { border-color: var(--red); background: var(--red-soft); }
.opt .box {
  flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--hair);
  display: grid; place-items: center; background: var(--paper);
}
.opt.is-on .box { background: var(--red); border-color: var(--red); }
/* Coche centrée (12/11/2026) : avant, elle était décalée vers le bas à droite. */
.opt.is-on .box::after { content: ""; width: 10px; height: 5px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.opt.pic { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; text-align: center; gap: 0; }
.opt.pic img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--sand); }
.opt.pic span { padding: 10px 8px; font-size: 15px; }
/* Sur les photos, la case ne reprend pas la marge du texte de la carte (c'est ce qui décalait la coche, 12/11/2026). */
.opt.pic .box { position: absolute; top: 8px; left: 8px; margin: 0; padding: 0; }
.opt.pic { position: relative; }

/* Oui / Non (12/11/2026) : 2 grandes cartes, emoji en grand au-dessus du mot, comme HeyFlow.
   La version A a ses propres mesures dans quiz-a.css. */
body:not(.version-a) .options.emos .opt {
  flex-direction: column; justify-content: center; gap: 10px; min-height: 124px; padding: 18px 12px; text-align: center;
}
body:not(.version-a) .options.emos .emoji { width: auto; font-size: 46px; }

/* Échelle 1 à 5 */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 22px; }
.scale .opt { justify-content: center; font: 700 20px var(--font-mono); padding: 16px 0; }
.scale-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--muted); }

/* Boutons */
.btn {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  margin-top: 22px; padding: 17px 22px; border-radius: 999px;
  background: var(--red); color: #fff; font: 800 17px var(--font-text); letter-spacing: .01em;
  display: inline-flex; justify-content: center; align-items: center; gap: 10px; text-decoration: none;
  box-shadow: 0 6px 18px rgba(216, 49, 28, .22);
  transition: background .15s, transform .15s;
}
@media (hover: hover) { .btn:hover { background: var(--red-dark); } }
.btn:active { transform: scale(.99); }
.btn:disabled { background: #c9bfbb; box-shadow: none; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.btn .arrow { font-size: 20px; line-height: 1; }
.under { margin: 10px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.under b { color: var(--ink); }

/* Médias */
.video { position: relative; aspect-ratio: 16 / 9; margin: 18px 0 0; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.figure { margin: 18px 0 0; border-radius: var(--radius); overflow: hidden; background: var(--sand); }
.figure img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* Accueil */
.section { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--hair); }
.section-title { font-family: var(--font-title); font-weight: 400; text-transform: uppercase; font-size: 26px; line-height: 1.1; margin: 0 0 12px; }
.benefits { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.benefits li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: baseline; }
.benefits .n { font-family: var(--font-mono); font-weight: 700; color: var(--red); font-size: 15px; }
.proofs { display: grid; gap: 12px; margin-top: 16px; }
.proofs img { border: 1px solid var(--hair); border-radius: var(--radius); }

/* Formulaire */
.form { display: grid; gap: 14px; margin-top: 18px; }
.field label { display: block; font-weight: 700; font-size: 15px; margin: 0 0 6px; }
.field input, .field select {
  width: 100%; font: 500 17px var(--font-text); color: var(--ink);
  padding: 14px 14px; border: 1.5px solid var(--hair); border-radius: 12px; background: var(--paper);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.field .note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.phone-row { display: grid; grid-template-columns: 116px 1fr; gap: 8px; }
.error { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--red-dark); }
.field.has-error input { border-color: var(--red-dark); }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--muted); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--red); }

/* Analyse */
.bars { display: grid; gap: 18px; margin-top: 26px; }
.bar-label { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.bar-label span:last-child { font-family: var(--font-mono); color: var(--red); }
.bar { height: 10px; border-radius: 99px; background: var(--sand); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--red); border-radius: 99px; }
.spinner { width: 42px; height: 42px; margin: 40px auto 0; border-radius: 50%; border: 4px solid var(--hair); border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; padding: 18px 16px 28px; font-size: 13px; color: var(--muted); }
.foot a { color: inherit; }
.noscript { padding: 20px; background: var(--sand); border-radius: var(--radius); }

@media (min-width: 640px) {
  .app { padding-top: 36px; }
  /* Accueil et résultat plus larges sur ordinateur (12/11/2026), les questions restent à 640 px. */
  body[data-ecran="home"] .app, body[data-ecran="result"] .app,
  body[data-ecran="home"] .top-inner, body[data-ecran="result"] .top-inner { max-width: 820px; }
  .band { font-size: 12px; }
}
/* Ordinateur (12/11/2026) : réassurance avec le texte à gauche et la photo à droite, le bouton reste visible sans descendre ;
   titres des questions à 32 px, comme HeyFlow. */
@media (min-width: 768px) {
  body:not(.version-a)[data-ecran="info"] .app, body:not(.version-a)[data-ecran="info"] .top-inner { max-width: 820px; }
  body:not(.version-a) .info-row.has-img { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
  body:not(.version-a) .info-row .figure { margin-top: 0; }
  body:not(.version-a) .info-row + .btn { max-width: 380px; margin-left: auto; margin-right: auto; display: flex; }
  body:not(.version-a) .question { font-size: 32px; }
  /* Réponses en photos alignées sur une ligne (12/11/2026) : 4 de front (essais, silhouettes, bouger), comme la version A. */
  body:not(.version-a) .app:has(.options.pics) { max-width: 900px; }
  body:not(.version-a) .options.pics.cols-2 { grid-template-columns: repeat(4, 1fr); }
}
/* Réassurance de la version B sur téléphone (12/11/2026) : le bouton « Je continue » doit se voir sans descendre.
   L'écran prend la hauteur visible ; la photo (carrée au plus) rétrécit pour laisser la place au texte et au bouton. */
@media (max-width: 767px) {
  body:not(.version-a)[data-ecran="info"] .app { padding-top: 12px; padding-bottom: 12px; }
  body:not(.version-a)[data-ecran="info"] .screen {
    display: flex; flex-direction: column;
    height: calc(100vh - 67px - 24px); height: calc(100svh - 67px - 24px);
  }
  body:not(.version-a)[data-ecran="info"] .back { margin-bottom: 4px; align-self: flex-start; }
  body:not(.version-a)[data-ecran="info"] .text.lead { font-size: 16px; margin-bottom: 0; }
  body:not(.version-a)[data-ecran="info"] .text p { margin-bottom: 8px; }
  body:not(.version-a) .info-row.has-img { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body:not(.version-a) .info-row.has-img .text { flex: none; }
  body:not(.version-a) .info-row.has-img .figure { flex: 0 1 auto; min-height: 110px; height: calc(100vw - 32px); margin-top: 12px; }
  body:not(.version-a) .info-row.has-img .figure img { height: 100%; aspect-ratio: auto; }
  body:not(.version-a)[data-ecran="info"] .btn { flex: none; margin-top: 16px; }
}

/* Accueil de la version B sur ordinateur (12/11/2026) : il restait une colonne de téléphone (page de 5 400 px).
   Page plus large, bénéfices sur 3 colonnes, avant/après sur 2. Le haut de page garde l'ordre texte, vidéo, bouton
   (le dirigeant ne veut pas la vidéo à côté du texte), centré sur 820 px pour que le bouton reste visible sans descendre sur un écran de 900 px de haut. */
.hero { display: grid; grid-template-areas: "text" "video" "cta"; }
.hero-text { grid-area: text; }
.hero-video { grid-area: video; min-width: 0; }
.hero-cta { grid-area: cta; }
@media (min-width: 960px) {
  body[data-ecran="home"] .app, body[data-ecran="home"] .top-inner { max-width: 1140px; }
  .hero { max-width: 820px; margin: 0 auto; }
  .hero-cta .btn, body[data-ecran="home"] .section .btn { max-width: 420px; margin-left: auto; margin-right: auto; display: flex; }
  body[data-ecran="home"] .section .btn { margin-left: auto; margin-right: auto; display: flex; }
  body[data-ecran="home"] .section { margin-top: 56px; padding-top: 44px; }
  .benefits { grid-template-columns: repeat(3, 1fr); gap: 20px 32px; margin-top: 24px; }
  /* 2 colonnes et pas 3 : les avant/après contiennent du texte, qui doit rester lisible. */
  body:not(.version-a) .proofs { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
.nowrap { white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
