/* Moteur de quiz : charte du design system v2 de Tuto Mix (fond #0b0b0c, jaune #fdfb48, Archivo + Instrument Sans). */
:root {
  --fond: #0b0b0c;
  --carte: #141417;
  --survol: #1a1a1f;
  --bordure: #2a2a30;
  --bordure-forte: #3a3a42;
  --texte: #f4f4f5;
  --texte-2: #c6c6cd;
  --texte-3: #a0a0a8;
  --texte-4: #8a8a96;
  --accent: #fdfb48;
  --accent-survol: #fffb7a;
  --jaune-titre: #fcc931;
  --sur-accent: #0b0b0c;
  --erreur: #ff3b2e;
  --titres: 'Archivo', system-ui, sans-serif;
  --corps: 'Instrument Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
body { font-family: var(--corps); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; }

.quiz { max-width: 680px; margin: 0 auto; padding: 0 16px 64px; }
.chargement { color: var(--texte-3); text-align: center; padding-top: 30vh; }
.carte { position: relative; }

/* En-tête */
.banniere { display: block; width: calc(100% + 32px); margin: 0 -16px; height: 180px; object-fit: cover; }
.logo { display: block; width: 96px; height: 96px; margin: -48px 0 8px; border-radius: 12px; border: 3px solid var(--fond); object-fit: cover; }
.titre-formulaire, .titre-resultat, .question, .sous-titre {
  font-family: var(--titres); font-stretch: 112%; color: var(--texte); margin: 24px 0 12px;
}
.titre-formulaire { font-size: 36px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin-top: 16px; }
.titre-resultat { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 48px; }
.question { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-top: 32px; }
.question i { font-family: var(--corps); font-stretch: normal; font-weight: 400; font-size: 16px; letter-spacing: 0; color: var(--texte-3); }
.sous-titre { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-top: 32px; }
.jaune { color: var(--jaune-titre); }
.texte { color: var(--texte-2); margin: 12px 0; }
.texte.petit { font-size: 15px; }
.texte a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }

/* Barre de progression */
.progression { height: 4px; background: var(--bordure); border-radius: 4px; margin-top: 24px; overflow: hidden; }
.progression-plein { height: 100%; background: var(--accent); transition: width .3s ease; }

/* Options */
.ecran:focus { outline: none; }
.options { display: grid; gap: 10px; margin: 16px 0; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--carte); color: var(--texte); border: 0; border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--bordure) 0 0 0 1px; font: inherit; font-size: 16px; line-height: 1.4;
  transition: background .15s, box-shadow .15s;
}
.option:hover { background: var(--survol); box-shadow: var(--bordure-forte) 0 0 0 1px; }
.option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.option.choisie { box-shadow: var(--accent) 0 0 0 2px; }
.lettre {
  flex: none; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; background: var(--fond); color: var(--texte-3); box-shadow: var(--bordure) 0 0 0 1px;
}
.option.choisie .lettre { background: var(--accent); color: var(--sur-accent); box-shadow: none; }

/* Champs */
.champ {
  display: block; width: 100%; margin: 12px 0; padding: 12px 14px; font: inherit; font-size: 16px;
  color: var(--texte); background: var(--carte); border: 1px solid var(--bordure); border-radius: 8px;
}
.champ::placeholder { color: var(--texte-4); }
.champ:focus { outline: none; box-shadow: var(--accent) 0 0 0 2px; border-color: transparent; }
textarea.champ { resize: vertical; min-height: 120px; }
.case { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: 15px; color: var(--texte-2); cursor: pointer; }
.case input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.turnstile { margin: 12px 0; min-height: 65px; }
.piege { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.erreur { color: var(--erreur); font-size: 15px; min-height: 1.4em; margin: 8px 0 0; }

/* Boutons */
.pied { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.bouton {
  display: inline-block; background: var(--accent); color: var(--sur-accent); border: 0; border-radius: 8px;
  padding: 14px 28px; font: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; cursor: pointer; text-decoration: none;
}
.bouton:hover { background: var(--accent-survol); }
.bouton:disabled { opacity: .6; cursor: wait; }
.bouton:focus-visible, .retour:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lien-bouton { font-weight: 800; padding: 16px 28px; margin: 12px 0; }
.retour { background: none; border: 1px solid var(--bordure); color: var(--texte-3); border-radius: 8px; width: 46px; height: 46px; font-size: 18px; cursor: pointer; }
.retour:hover { color: var(--texte); border-color: var(--bordure-forte); }

/* Résultat */
.image-resultat { display: block; max-width: 100%; height: auto; margin: 24px 0 0; border-radius: 8px; }

@media (max-width: 576px) {
  body { font-size: 16px; }
  .banniere { height: 120px; }
  .logo { width: 72px; height: 72px; margin-top: -36px; }
  .titre-formulaire { font-size: 28px; }
  .titre-formulaire br { display: none; } /* sur téléphone, le titre coule naturellement */
  .titre-resultat { font-size: 24px; margin-top: 32px; }
  .question, .sous-titre { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
