/* Moteur de quiz : mise en page commune. Aucune couleur de marque ici :
   les couleurs et polices viennent de charte.css (une par client), par les variables --q-*. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--q-fond, #111);
  color: var(--q-texte, #eee);
  font-family: var(--q-police-texte, system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--q-accent); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--q-accent); outline-offset: 2px; }

/* Barre de progression collée en haut */
.q-progression { position: fixed; inset: 0 0 auto 0; height: 4px; background: var(--q-carte); z-index: 10; }
.q-progression__barre { height: 100%; width: 0; background: var(--q-accent); transition: width 240ms ease; }

.q-cadre { max-width: 680px; margin: 0 auto; padding: 0 28px 64px; }
.q-couverture { margin: 0 -28px; aspect-ratio: 4 / 1; background: var(--q-carte) center / cover no-repeat; border-bottom: 1px solid var(--q-trait); }
.q-couverture--absente { display: flex; align-items: center; justify-content: center; color: var(--q-texte-4); font-size: 13px; border: 1px dashed var(--q-trait-fort); }
.q-entete { padding: 28px 0 8px; }
.q-quiz { outline: none; }
.q-chargement, .q-noscript { color: var(--q-texte-3); text-align: center; padding: 48px 0; }

/* Textes */
.q-titre-formulaire, .q-titre {
  font-family: var(--q-police-titre); font-stretch: var(--q-etirement-titre);
  font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; margin: 24px 0 12px;
}
.q-titre-formulaire { font-size: 36px; letter-spacing: -0.035em; }
h2.q-titre { font-size: 28px; }
h3.q-titre { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.q-texte { color: var(--q-texte-2); margin: 0 0 14px; }
.q-surligne { color: var(--q-accent); }
.q-souligne { text-decoration: underline; text-underline-offset: 3px; }
.q-image { margin: 20px 0; border-radius: var(--q-rayon-carte); overflow: hidden; }
.q-image--absente { padding: 28px; text-align: center; color: var(--q-texte-4); font-size: 13px; border: 1px dashed var(--q-trait-fort); border-radius: var(--q-rayon-carte); }

/* Questions */
.q-question { border: 0; padding: 0; margin: 28px 0 8px; min-width: 0; }
.q-question__titre {
  display: block; padding: 0; margin: 0 0 14px;
  font-family: var(--q-police-titre); font-stretch: var(--q-etirement-titre);
  font-weight: 700; font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; color: var(--q-texte);
}
.q-question__titre em { font-family: var(--q-police-texte); font-stretch: normal; font-weight: 400; font-size: 15px; color: var(--q-texte-3); letter-spacing: 0; }
.q-options { display: grid; gap: 10px; }
.q-option { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer;
  background: var(--q-carte); border-radius: var(--q-rayon-carte); box-shadow: 0 0 0 1px var(--q-trait);
  transition: background 120ms, box-shadow 120ms; }
.q-option:hover { background: var(--q-survol); box-shadow: 0 0 0 1px var(--q-trait-fort); }
.q-option input { position: absolute; opacity: 0; pointer-events: none; }
.q-option:has(input:focus-visible) { outline: 2px solid var(--q-accent); outline-offset: 2px; }
.q-option--choisie, .q-option--choisie:hover { box-shadow: 0 0 0 2px var(--q-accent); }
.q-lettre { flex: none; width: 26px; height: 26px; display: grid; place-items: center; font-size: 13px; font-weight: 600;
  border-radius: 6px; box-shadow: 0 0 0 1px var(--q-trait-fort); color: var(--q-texte-2); }
.q-option--choisie .q-lettre { background: var(--q-accent); color: var(--q-sur-accent); box-shadow: none; }
.q-option__texte { color: var(--q-texte); }

/* Champs */
.q-champ { display: block; width: 100%; margin: 10px 0 4px; padding: 13px 14px; font: inherit; color: var(--q-texte);
  background: var(--q-carte); border: 1px solid var(--q-trait); border-radius: var(--q-rayon); }
.q-champ::placeholder { color: var(--q-texte-4); }
.q-champ:focus { outline: none; box-shadow: 0 0 0 2px var(--q-accent); border-color: transparent; }
textarea.q-champ { min-height: 130px; resize: vertical; }
.q-case { display: flex; align-items: flex-start; gap: 12px; margin: 14px 0 4px; cursor: pointer; color: var(--q-texte-2); }
.q-case input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--q-accent); cursor: pointer; }
.q-erreur { color: var(--q-erreur); font-size: 14px; margin: 4px 0 0; min-height: 0; }
.q-erreur:empty { display: none; }
.q-piege { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.q-verif:not(:empty) { margin: 16px 0 0; }
.q-suggestion { background: none; border: 0; padding: 0; font: inherit; color: var(--q-accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Boutons */
.q-actions { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.q-bouton, .q-bouton-lien {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 28px;
  font: 600 14px/1 var(--q-police-texte); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  color: var(--q-sur-accent); background: var(--q-accent); border: 1px solid transparent; border-radius: var(--q-rayon);
  cursor: pointer; transition: background 120ms, box-shadow 120ms;
}
.q-bouton:hover, .q-bouton-lien:hover { background: var(--q-accent-survol); box-shadow: var(--q-halo); }
.q-bouton[disabled] { opacity: .6; cursor: wait; }
.q-bouton-lien { margin: 8px 0 16px; font-weight: 800; }
.q-retour { background: none; border: 0; padding: 8px 0; font: inherit; font-size: 14px; color: var(--q-texte-3); cursor: pointer; }
.q-retour:hover { color: var(--q-texte); }

@media (max-width: 576px) {
  .q-cadre { padding: 0 20px 48px; }
  .q-couverture { margin: 0 -20px; }
  .q-titre-formulaire { font-size: 30px; }
  h2.q-titre { font-size: 24px; }
  h3.q-titre, .q-question__titre { font-size: 19px; }
  .q-actions { flex-direction: column-reverse; align-items: stretch; }
  .q-bouton { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
