:root {
  /* Palette alignée sur le thème MH Magazine lite + verts fournis */
  --bg: #f7f7f7;          /* fond de page (body du site) */
  --card: #ffffff;
  --border: #ebebeb;      /* bordures du site */
  --ink: #1c1c1c;         /* texte courant */
  --ink-strong: #000000;  /* titres */
  --ink-soft: #555555;
  --ink-faint: #979797;   /* méta du site */
  --green: #367B45;       /* vert signature (accent) */
  --green-deep: #2A7840;  /* vert profond (structure / survol) */
  --green-light: #A8C499; /* vert clair (touche) */
  --green-tint: #eef5ea;  /* fond vert très clair (survol / bonne réponse) */
  --right: #2A7840;
  --right-bg: #eef5ea;
  --wrong: #b23b34;       /* brique, uniquement fonctionnel (mauvaise réponse) */
  --wrong-bg: #fbecea;
  --charcoal: #2a2a2a;    /* charbon du site (nav / pied) */
  --radius: 6px;
  --sans: 'Open Sans', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.quiz {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 20px 36px;
}

/* ---- barre supérieure ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.theme-tag {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border-radius: 0;
  padding: 5px 12px;
  white-space: nowrap;
}
.meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-faint);
}
.meta strong { color: var(--ink-strong); font-weight: 700; }

/* ---- jauge de progression ---- */
.rail {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}
.rail-fill {
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width 0.45s ease;
}

/* ---- carte ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: 0 0 10px rgba(50, 50, 50, 0.08);
}
.question {
  font-size: 23px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0 0 22px;
}

/* ---- choix ---- */
.choices { display: flex; flex-direction: column; gap: 11px; }
.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.choice:hover:not(:disabled) { border-color: var(--green); background: var(--green-tint); }
.choice:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.choice:disabled { cursor: default; }

.badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
}
.choice-mark { margin-left: auto; font-size: 17px; font-weight: 700; opacity: 0; }

.choice.is-right { border-color: var(--right); background: var(--right-bg); }
.choice.is-right .badge { background: var(--right); }
.choice.is-right .choice-mark { opacity: 1; color: var(--right); }
.choice.is-wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.choice.is-wrong .badge { background: var(--wrong); }
.choice.is-wrong .choice-mark { opacity: 1; color: var(--wrong); }

/* ---- retour + explication ---- */
.feedback { margin-top: 22px; }
.verdict {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}
.verdict.right { color: var(--right); }
.verdict.wrong { color: var(--wrong); }
.explain-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-faint);
  margin: 0 0 5px;
}
.explain {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  border-left: 4px solid var(--green);
  padding-left: 14px;
}

/* ---- actions ---- */
.actions { margin-top: 26px; display: flex; justify-content: flex-end; }
.next-btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: var(--radius);
  padding: 12px 22px;
  cursor: pointer;
  transition: background 0.15s linear;
}
.next-btn:hover { background: var(--charcoal); }
.next-btn:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; }

/* ---- résultats ---- */
.results { text-align: center; padding: 14px 0 4px; }
.score-big {
  font-size: 54px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
  margin: 0;
}
.score-total { font-size: 22px; color: var(--ink-faint); }
.results-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 18px 0 6px;
}
.results-msg { color: var(--ink-soft); font-size: 16px; margin: 0 0 26px; }

/* ---- états ---- */
.state { text-align: center; color: var(--ink-soft); padding: 40px 10px; font-size: 15px; line-height: 1.6; }
.state code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--green-deep);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (max-width: 480px) {
  .question { font-size: 21px; }
  .card { padding: 24px 18px; }
}

/* ---- mention "powered by" ---- */
.powered-by {
  text-align: center;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint);
  margin: 22px 0 0;
}
.powered-by a { color: var(--ink-faint); text-decoration: none; }
.powered-by a:hover { color: var(--green); text-decoration: underline; }
