/* The application quiz.
   Ink ground rather than Paper: the quiz is a room of its own, and the darker field makes
   one question at a time feel deliberate instead of like a form with its other fields
   hidden. Lapis stays an accent here as everywhere — the progress bar, the dot, the key
   caps, the chosen state — and is never the ground. */

body[data-page=quiz] { background: var(--ink); color: var(--paper); }
/* No masthead here. The quiz carries its own title in the head rail, and a wordmark above
   it only competed with the question — which is the one thing on the screen. */
body[data-page=quiz] .main { padding-top: 0; }
/* This page takes the landing chrome but not vsl.css, which is where .landing-footer is
   actually laid out — so the whole footer is styled here rather than inherited. Without it
   the row does not flex and the wordmark falls back to its intrinsic width, which is how it
   ended up spanning the page. Kept deliberately quiet: at the foot of a form the legal
   links are the only part anyone needs to find. */
body[data-page=quiz] .landing-footer {
  background: var(--ink); color: var(--paper);
  border-top: 1px solid rgba(238,230,216,.14);
  padding: 22px var(--gutter);
}
body[data-page=quiz] .landing-footer .inner {
  /* .quiz is left-aligned at 1100px wide including its gutter, so the footer row is capped
     to the same content width rather than centred — otherwise the wordmark sits inboard of
     the head rail directly above it. */
  max-width: 980px; margin-inline: 0;
  display: flex; align-items: center; gap: 14px 26px; flex-wrap: wrap;
  font-size: 10px; letter-spacing: .02em; opacity: .45;
}
body[data-page=quiz] .landing-footer img {
  width: 62px; height: auto; flex-shrink: 0;
  filter: brightness(0) invert(.94);
}
body[data-page=quiz] .landing-footer .legal { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
body[data-page=quiz] .landing-footer a:hover { text-decoration: underline; }
@media (max-width: 600px) {
  body[data-page=quiz] .landing-footer .legal { margin-left: 0; }
}

.quiz {
  min-height: calc(100svh - 90px);
  padding: clamp(26px,4.5vh,52px) var(--gutter) clamp(40px,7vh,86px);
  display: flex;
  flex-direction: column;
  max-width: 1100px;
}

/* ---- the standing head: title, count, progress ---- */
.quiz-head { border-bottom: 1px solid rgba(238,230,216,.16); padding-bottom: 16px; position: relative; }
/* The page needs one H1 and the applicant does not need it shouted. */
.quiz-head h1 {
  font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  line-height: 1.6; opacity: .62; max-width: 40ch;
}
.quiz-close {
  position: absolute; right: 0; top: -4px;
  font-size: 11px; letter-spacing: .04em; opacity: .5;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 0 8px 14px; transition: opacity .2s;
}
.quiz-close:hover { opacity: 1; }
.quiz-progress-label { position: absolute; right: 86px; top: 4px; font-size: 11px; opacity: .5; font-variant-numeric: tabular-nums; }
.quiz-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: rgba(238,230,216,.16); }
.quiz-progress span {
  display: block; height: 100%; background: var(--lapis);
  transform: scaleX(0); transform-origin: left;
  transition: transform .55s var(--ease);
}

/* ---- one question at a time ---- */
.quiz-form { flex: 1; display: flex; flex-direction: column; }
.quiz-steps { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.quiz-steps li + li { margin-top: 0; }
.quiz-step { padding-block: clamp(30px,6vh,64px); }

.quiz-eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; opacity: .55; margin-bottom: 22px; }
.quiz-eyebrow .dot { display: inline-block; width: 6px; height: 6px; background: var(--lapis); border-radius: 50%; margin-right: 10px; vertical-align: 2px; }

.quiz-question {
  font-size: clamp(30px,4.1vw,56px); line-height: 1.06; letter-spacing: -.04em;
  max-width: 20ch; outline: none;
}
.quiz-note { margin-top: 20px; font-size: 15px; line-height: 1.6; opacity: .6; max-width: 54ch; }

/* ---- the options ---- */
.quiz-options { margin-top: clamp(28px,4vh,44px); display: grid; gap: 10px; max-width: 700px; }
.quiz-option {
  display: flex; align-items: center; gap: 18px;
  width: 100%; text-align: left;
  padding: 17px 20px; min-height: 62px;
  background: transparent; color: inherit;
  border: 1px solid rgba(238,230,216,.28);
  font-size: 16px; line-height: 1.35;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.quiz-option:hover { background: rgba(238,230,216,.07); border-color: rgba(238,230,216,.55); transform: translateX(3px); }
.quiz-key {
  flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid rgba(238,230,216,.34); font-size: 11px; letter-spacing: .04em;
  transition: background .2s, color .2s, border-color .2s;
}
.quiz-option-label { flex: 1; }
.quiz-tick { opacity: 0; font-size: 15px; color: var(--paper); transition: opacity .2s; }

.quiz-option.is-chosen { background: var(--lapis); border-color: var(--lapis); }
.quiz-option.is-chosen .quiz-key { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.quiz-option.is-chosen .quiz-tick { opacity: 1; }

/* ---- the last step ---- */
.quiz-details .quiz-question { max-width: 16ch; }
.quiz-field-grid { margin-top: clamp(28px,4vh,40px); display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; max-width: 760px; }
.quiz-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.quiz-field > label { font-size: 12px; font-weight: 500; line-height: 1.4; }
.quiz-field-hint { font-size: 11px; opacity: .55; }
.quiz-field input {
  width: 100%; border: 0; border-bottom: 1px solid rgba(238,230,216,.34);
  background: transparent; color: var(--paper);
  min-height: 48px; padding: 12px 2px; font-size: 16px;
  transition: border-color .2s;
}
.quiz-field input:focus { border-bottom-color: var(--paper); outline: none; }
.quiz-field input:focus-visible { outline: none; }
.quiz-field input[aria-invalid=true] { border-bottom: 2px solid #d98a78; }
.quiz-details .field-error { color: #d98a78; }
.quiz-details .check-field { max-width: 760px; font-size: 13px; }
.quiz-details .check-field input { accent-color: var(--lapis); }
.quiz-submit { margin-top: 26px; }
.quiz-details .button { background: var(--paper); color: var(--ink); }
.quiz-details .button:hover { background: var(--white); }
.quiz .optional { font-weight: 400; opacity: .55; margin-left: 5px; font-size: 10px; }
.quiz .form-error { color: #d98a78; margin-bottom: 0; padding-top: 20px; }
.quiz .form-error a { text-decoration: underline; }
.quiz .no-js-note { background: rgba(238,230,216,.08); color: var(--paper); margin-top: 30px; }
.quiz .no-js-note a { text-decoration: underline; }

/* ---- the footer rail ---- */
.quiz-nav {
  border-top: 1px solid rgba(238,230,216,.16); padding-top: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.quiz-back { background: none; border: 0; color: inherit; font-size: 12px; padding: 10px 0; opacity: .65; transition: opacity .2s; }
.quiz-back:hover { opacity: 1; }
.quiz-hint { font-size: 11px; opacity: .45; margin-left: auto; }

/* ---- movement between questions ----
   A question rises in and falls away in the direction of travel, so going back reads as
   going back rather than as another new question. */
.quiz-step.is-entering { opacity: 0; transform: translateY(16px); }
.quiz-step.is-entering-back { opacity: 0; transform: translateY(-16px); }
.quiz-step { opacity: 1; transform: none; transition: opacity .34s var(--ease), transform .34s var(--ease); }
.quiz-step.is-leaving { opacity: 0; transform: translateY(-14px); }
.quiz-step.is-leaving-back { opacity: 0; transform: translateY(14px); }

@media (max-width: 900px) {
  .quiz { min-height: calc(100svh - 90px); }
  .quiz-field-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .quiz-question { font-size: clamp(26px,7.4vw,34px); max-width: 100%; }
  .quiz-note { font-size: 14px; margin-top: 16px; }
  .quiz-option { padding: 14px 15px; min-height: 58px; gap: 14px; font-size: 15px; }
  /* The key caps are a pointer-and-keyboard affordance and mean nothing on a phone. */
  .quiz-key { display: none; }
  .quiz-hint { display: none; }
  .quiz-head h1 { font-size: 9px; max-width: 24ch; }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-step, .quiz-progress span { transition: none; }
  .quiz-step.is-entering, .quiz-step.is-entering-back,
  .quiz-step.is-leaving, .quiz-step.is-leaving-back { opacity: 1; transform: none; }
}

/* ---- arriving ----
   The Ink panel that grew out of the apply button is still on screen when this page paints,
   and this page is Ink to the edges, so there is no seam to hide. The head and the first
   question simply rise into the panel it left behind, which reads as one movement that
   began at the button. */
@keyframes quiz-arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
body[data-page=quiz] .quiz-head { animation: quiz-arrive .5s var(--ease) both; }
body[data-page=quiz] .quiz-steps { animation: quiz-arrive .5s var(--ease) .08s both; }

@media (max-width: 600px) {
  .quiz-close { font-size: 10px; }
  .quiz-progress-label { right: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page=quiz] .quiz-head, body[data-page=quiz] .quiz-steps { animation: none; }
}
