/* ============================================================
   Diagnose page: quiz + result exit sign
   ============================================================ */
.quiz-hero { padding-bottom: clamp(32px, 4vw, 56px); }
.quiz-hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.quiz-hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }

.quiz-hero__steps { display: grid; gap: 14px; margin-top: 32px; }
.quiz-hero__steps li { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.quiz-hero__steps .plaque { min-width: 36px; height: 36px; border-radius: 6px; font-size: 1rem; }
.quiz-hero__steps .plaque svg { width: 18px; height: 18px; }

.quiz-example { padding: 26px 28px; max-width: 420px; justify-self: end; width: 100%; }
.quiz-example > * { position: relative; z-index: 1; }
.quiz-example__title { font-size: 1.0625rem; font-weight: 800; color: var(--green-deep); margin-bottom: 18px; }
.quiz-example__rows { display: grid; gap: 14px; }
.quiz-example__rows li { display: grid; gap: 6px; font-size: 0.9375rem; font-weight: 600; }
.track { display: block; height: 10px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: 999px; background: var(--green-deep); }
.quiz-example__rows li:first-child .track > span { background: var(--gold); box-shadow: inset 0 0 0 2px var(--on-gold); }

@media (max-width: 860px) {
  .quiz-hero__grid { grid-template-columns: 1fr; }
  .quiz-example { display: none; }
}

/* ---------- Quiz frame ---------- */
.quiz { padding-top: clamp(24px, 3vw, 40px); }
.quiz__wrapper { max-width: 720px; margin-inline: auto; }

.quiz-progress { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; }
.quiz-progress__bars { display: flex; gap: 6px; flex: 1; }
.quiz-progress__bars li { flex: 1; height: 8px; border-radius: 999px; background: var(--tint); border: 1px solid var(--green-line); transition: background-color 0.4s var(--ease-out); }
.quiz-progress__bars li.done { background: var(--green-deep); border-color: var(--green-deep); }
.quiz-progress__bars li.active { background: var(--gold); border-color: var(--on-gold); }
.quiz-progress__label { flex-shrink: 0; font-family: var(--font-mono); font-size: 0.9375rem; font-weight: 500; color: var(--ink-mute); white-space: nowrap; }

/* ---------- Question card ---------- */
.quiz-card { padding: clamp(24px, 4vw, 44px); margin: 0; }
.quiz-card > * { position: relative; z-index: 1; }
.quiz-card fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.quiz-card__q {
  display: block;
  width: 100%;
  margin-bottom: 26px;
  padding: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--green-deep);
}
.quiz-card__q:focus, .quiz-card__q:focus-visible { outline: none; }

.quiz-opts { display: grid; gap: 12px; }
.quiz-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border: 2px solid var(--green-line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.quiz-opt:hover { border-color: var(--green-deep); background: var(--gold-tint); }
.quiz-opt.is-selected { border-color: var(--green-deep); background: var(--gold-tint); }
.quiz-opt:focus-within { outline: 3px solid var(--green-deep); outline-offset: 3px; }
.quiz-opt input { position: absolute; opacity: 0; pointer-events: none; }
.quiz-opt__check {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0; margin-top: 1px;
  border: 2px solid var(--green-deep);
  border-radius: 50%;
  background: var(--panel);
}
.quiz-opt__check::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--green-deep); transform: scale(0); transition: transform 0.2s var(--ease-out); }
.quiz-opt.is-selected .quiz-opt__check::after { transform: scale(1); }
.quiz-opt__label { display: block; font-size: 1.0625rem; font-weight: 700; line-height: 1.3; color: var(--ink); }
.quiz-opt__sub { display: block; margin-top: 4px; font-size: 0.9375rem; line-height: 1.45; color: var(--ink-mute); }

.quiz-lean { min-height: 1.6em; margin-top: 20px; font-size: 0.9688rem; font-weight: 600; color: var(--gold-deep); }

.quiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.quiz-nav .btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.quiz-nav__spacer { min-width: 1px; }

/* ---------- Result: an exit sign ---------- */
.result { padding: 0; overflow: hidden; }
.result > * { position: relative; z-index: 1; }
.result__band { display: flex; align-items: center; gap: 18px; padding: 18px clamp(22px, 4vw, 44px); background: var(--green-deep); color: var(--gold); }
.result__exit { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: 0.08em; line-height: 1; }
.result__shield { width: clamp(46px, 7vw, 64px); height: auto; flex-shrink: 0; }
.result__shield path { fill: var(--gold); stroke: var(--on-gold); stroke-width: 4; stroke-linejoin: round; }
.result__shield text { fill: var(--on-gold); font-family: var(--font-mono); font-size: 40px; font-weight: 700; }
.result__arrow { width: clamp(34px, 5vw, 48px); height: auto; margin-left: auto; color: #fff; }
.result__arrow path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.result__inner { padding: clamp(24px, 4vw, 44px); }
.result__heading { font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.08; }
.result__heading:focus, .result__heading:focus-visible { outline: none; }
.result__desc { margin-top: 20px; max-width: 40rem; font-size: 1.0625rem; color: var(--ink); }

.result__scores-title { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--green-line); font-size: 1rem; font-weight: 800; color: var(--green-deep); }
.result__scores { display: grid; gap: 12px; margin-top: 16px; }
.result__scores li { display: grid; grid-template-columns: minmax(96px, 168px) 1fr 3.4rem; align-items: center; gap: 14px; font-size: 0.9375rem; font-weight: 600; }
.result__scores .pct { font-family: var(--font-mono); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.result__scores .track > span { width: 100%; transform: scaleX(0); transform-origin: left center; transition: transform 0.8s var(--ease-out); }
.result__scores li.is-top .track > span { background: var(--gold); box-shadow: inset 0 0 0 2px var(--on-gold); }

.result__actions { display: grid; gap: 12px; margin-top: 32px; }
.result__actions .btn { width: 100%; }
.result__link { justify-self: center; margin-top: 4px; }

@media (max-width: 600px) {
  .quiz-progress { gap: 12px; }
  .quiz-progress__label { font-size: 0.875rem; }
  .result__scores li { grid-template-columns: 1fr 3.4rem; }
  .result__scores li .track { grid-column: 1 / -1; grid-row: 2; }
  .quiz-nav .btn { flex: 1; }
}

/* ---------- Trust row ---------- */
.quiz-trust { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 32px; padding-inline: 4px; }
.quiz-trust li { display: flex; align-items: center; gap: 10px; font-size: 0.9375rem; font-weight: 600; color: var(--ink-mute); }
.quiz-trust svg { width: 18px; height: 18px; color: var(--green-deep); flex-shrink: 0; }


/* ---------- Motion: continuity between questions, a result that lowers like a sign ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes quizIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
  @keyframes quizInBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
  @keyframes optIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes bandDrop { from { transform: translateY(-100%); } to { transform: none; } }
  @keyframes stamp { from { opacity: 0; transform: scale(1.5); } to { opacity: 1; transform: none; } }
  @keyframes nudge { 50% { transform: translateY(8px); } }

  .quiz-card { animation: quizIn 0.4s var(--ease-out) both; }
  .quiz-card[data-dir="back"] { animation-name: quizInBack; }
  .quiz-opt { animation: optIn 0.5s var(--ease-out) both; animation-delay: calc(0.08s + var(--i, 0) * 55ms); }

  .result__band { animation: bandDrop 0.6s var(--ease-out) both; }
  .result__shield { animation: stamp 0.45s var(--ease-out) 0.4s both; }
  .result__arrow { animation: nudge 0.9s ease-in-out 1.1s 2; }
  .result__inner > * { animation: rise 0.6s var(--ease-out) both; }
  .result__inner > :nth-child(1) { animation-delay: 0.45s; }
  .result__inner > :nth-child(2) { animation-delay: 0.53s; }
  .result__inner > :nth-child(3) { animation-delay: 0.61s; }
  .result__inner > :nth-child(4) { animation-delay: 0.69s; }
  .result__inner > :nth-child(5) { animation-delay: 0.77s; }
}
