/* =====================================================================
   Quiz « Faire le point »
   Une question par écran, une réponse = passage automatique, aucune
   distraction, tout visible sans défilement (skill ui-ux-quality, module 06).
   ===================================================================== */
@layer sections {
  .quiz-body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  .quiz-body::before { opacity: 0.025; }

  .quiz-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 3.5rem; padding: 0 var(--gutter); position: relative; z-index: 2; }
  .quiz-exit { display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--sp-2); font-size: var(--fs-small); font-weight: 500; color: var(--ink-2); }

  .quiz-main { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; width: 100%; max-width: calc(38rem + 2 * var(--gutter)); margin-inline: auto; padding: 0 var(--gutter) var(--sp-4); }
  .quiz-main::before { content: ''; position: absolute; z-index: -1; width: min(40rem, 100vw); height: min(40rem, 100%); left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--glow); opacity: 0.6; pointer-events: none; }

  /* Progression : rayons qui s'allument */
  .quiz-progress { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; }
  .quiz-back { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 44px; padding: 0 var(--sp-2) 0 0; background: none; border: 0; font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
  .quiz-back svg { width: 18px; height: 18px; }
  .quiz-rays { width: 34px; height: 34px; flex: none; margin-left: auto; }
  .quiz-rays line { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; opacity: 0.45; transition: stroke var(--dur-3) var(--ease), opacity var(--dur-3) var(--ease); }
  .quiz-rays line.is-on { stroke: var(--accent); opacity: 1; }
  .quiz-rays circle { fill: var(--accent); }
  .quiz-count { font-size: var(--fs-small); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

  [data-quiz]:not([hidden]) { flex: 1; display: flex; flex-direction: column; }

  .quiz-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: var(--sp-3); }
  .quiz-question { font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.25rem); line-height: 1.18; }
  .quiz-question:focus { outline: none; }
  .quiz-question:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; }
  .quiz-hint { margin-top: var(--sp-2); font-size: var(--fs-small); color: var(--ink-2); }

  .choices { list-style: none; margin: clamp(0.75rem, 2.5dvh, 1.75rem) 0 0; padding: 0; display: grid; gap: clamp(0.5rem, 1.2dvh, 0.75rem); }
  .choice {
    width: 100%;
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: clamp(2.875rem, 7dvh, 3.5rem);
    padding: clamp(0.5rem, 1.3dvh, 0.875rem) var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    color: var(--ink);
    font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
    line-height: 1.35;
    text-align: left;
    box-shadow: var(--shadow-1);
    transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
  }
  .choice:hover { border-color: var(--accent); box-shadow: var(--shadow-2); }
  .choice:active { transform: scale(0.995); }
  .choice__mark { flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; }
  .choice[aria-pressed='true'] { background: var(--accent-wash); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
  .choice[aria-pressed='true'] .choice__mark { border-color: var(--accent); background: var(--accent); }
  .choice[aria-pressed='true'] .choice__mark::after { content: ''; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--accent-ink); }

  /* Introduction */
  .quiz-intro { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--sp-4); padding-block: var(--sp-5); }
  .quiz-intro h1 { font-size: var(--fs-h2); line-height: 1.1; }
  .quiz-intro .raylist { font-size: var(--fs-small); color: var(--ink-2); gap: var(--sp-2); }
  .quiz-intro .btn { align-self: flex-start; margin-top: var(--sp-2); }
  .quiz-resume { font-size: var(--fs-small); }
  .quiz-resume button { background: none; border: 0; padding: 0; min-height: 44px; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }

  @media (prefers-reduced-motion: no-preference) {
    .quiz-screen.is-entering { animation: quiz-in 220ms var(--ease); }
    @keyframes quiz-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
  }

  @media (max-width: 24rem) {
    .choice { padding-inline: var(--sp-3); gap: var(--sp-2); }
    .choice__mark { width: 1.125rem; height: 1.125rem; }
    .quiz-question { font-size: 1.375rem; }
  }
  /* Écrans courts : on resserre sans masquer de réponse */
  @media (max-height: 44rem) {
    .quiz-top { min-height: 2.75rem; }
    .quiz-top .logo { min-height: 2.75rem; }
    .quiz-progress { min-height: 2.75rem; }
    .quiz-rays { width: 28px; height: 28px; }
    .quiz-screen { padding-block: var(--sp-2); }
    .quiz-question { font-size: 1.25rem; }
    .quiz-hint:not(.is-key) { display: none; }
    .quiz-hint.is-key { font-size: 0.8125rem; line-height: 1.35; margin-top: var(--sp-1); }
    .quiz-hint.is-key + .choices { margin-top: var(--sp-2); }
    .choices { margin-top: var(--sp-3); gap: 0.4375rem; }
    .choice { min-height: 2.75rem; padding-block: 0.375rem; font-size: 0.9375rem; line-height: 1.3; }
  }
  @media (max-height: 28rem) and (min-width: 36rem) {
    .quiz-hint.is-key { display: none; }
    .choices { grid-template-columns: 1fr 1fr; }
    .quiz-main { max-width: 52rem; }
  }

  /* ----- Page résultat ----- */
  .result-head { padding-block: var(--sp-8) var(--sp-7); position: relative; overflow: hidden; }
  .result-head::before { content: ''; position: absolute; z-index: -1; width: 50rem; height: 50rem; right: -18rem; top: -24rem; background: var(--glow); }
  .result-head h1 { font-size: var(--fs-h2); line-height: 1.1; margin-top: var(--sp-4); max-width: 22ch; }
  .result-synthesis { margin-top: var(--sp-5); max-width: 40rem; }
  .result-dims { display: grid; gap: var(--sp-3); margin-top: var(--sp-6); max-width: 42rem; }
  @media (min-width: 40rem) { .result-dims { grid-template-columns: 1fr 1fr; } }
  .result-dim { padding: var(--sp-5); }
  .result-dim__label { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent); }
  .result-dim__name { margin-top: var(--sp-1); font-family: var(--font-serif); font-size: var(--fs-h4); }
  .pistes { list-style: none; padding: 0; margin-top: var(--sp-6); max-width: 42rem; counter-reset: p; border-top: 1px solid var(--line); }
  .pistes li { counter-increment: p; position: relative; padding: var(--sp-5) 0 var(--sp-5) 3.25rem; border-bottom: 1px solid var(--line); }
  .pistes li::before { content: counter(p); position: absolute; left: 0; top: var(--sp-5); width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--font-serif); }
  .exercise { max-width: 42rem; padding: var(--sp-6); }
  .exercise__label { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent); }
  .exercise__title { margin-top: var(--sp-2); font-size: var(--fs-h3); }
  .exercise__steps { margin-top: var(--sp-4); padding-left: 1.2rem; display: grid; gap: var(--sp-2); }
  .exercise__time { margin-top: var(--sp-4); font-size: var(--fs-small); color: var(--ink-3); }
}
