/* Match the public MET Mastery landing page palette and type. */
:root {
  color-scheme: light;
  font-family: Aptos, system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-size: 100%;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #172e33;
  --muted: #4a6268;
  --line: #cfe0df;
  --line-strong: #a9c4c3;
  --teal: #123f46;
  --night: #0b2e34;
  --tint: #eff6f6;
  --focus: #16836b;
  --emerald-ink: #0f6b57;
  --amber: #da8847;
  --amber-hover: #e6a372;
  --amber-text: #f2bc8f;
  --on-dark-muted: #ccdadc;
  --paper: #fff;
  --ground: #f8fcfd;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(18 63 70 / .04), 0 12px 32px -18px rgb(18 63 70 / .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { display: flow-root; min-height: 100vh; margin: 0; color: var(--ink); background: var(--ground); }
html.large { font-size: 120%; }
::selection { color: var(--paper); background: var(--teal); }

a { color: var(--emerald-ink); text-underline-offset: .24em; }
a:hover { color: var(--night); }
.site-header {
  position: sticky;
  top: 8px;
  z-index: 2;
  width: min(100% - 1.5rem, 76rem);
  margin: 8px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.header-inner { min-height: 4.25rem; padding: .65rem 1rem; display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: .65rem; min-height: 2.75rem; color: var(--teal); font-size: 1.25rem; font-weight: 500; line-height: 1.2; letter-spacing: -.02em; text-decoration: none; }
.brand img { width: 1.75rem; height: 1.75rem; }
button { min-height: 48px; padding: 12px 20px; border: 1px solid var(--teal); border-radius: var(--radius); background: var(--teal); color: var(--paper); font: inherit; font-weight: 700; cursor: pointer; }
button:hover { background: var(--night); border-color: var(--night); }
.consent-label { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; line-height: 1.45; }
.consent-label input { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.visually-hidden-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#send-results-status:empty { display: none; }
button.secondary, button.text-size { color: var(--teal); background: var(--paper); border-color: var(--line-strong); }
button.secondary:hover, button.text-size:hover { background: var(--tint); border-color: var(--teal); }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button.text-size { min-height: 42px; padding: 9px 14px; font-size: .9rem; }

.skip { position: absolute; top: -80px; left: 12px; z-index: 5; padding: 12px; background: var(--paper); color: var(--teal); }
.skip:focus { top: 8px; }
main { max-width: 1160px; min-height: calc(100vh - 150px); margin: auto; padding: 32px 28px 60px; }
main:focus { outline: none; }
footer { max-width: 1160px; margin: auto; padding: 22px 28px 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 16ch; margin-bottom: 20px; font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.06; letter-spacing: -.035em; }
h2 { font-size: 1.35rem; line-height: 1.25; letter-spacing: -.02em; }
h1, h2, h3 { color: var(--teal); font-weight: 500; text-wrap: balance; }
p { color: var(--ink); line-height: 1.6; }
p { text-wrap: pretty; }

.welcome { display: grid; grid-template-columns: minmax(0, 760px); gap: clamp(42px, 8vw, 104px); align-items: center; min-height: 510px; padding: 30px 0 46px; }
.estimated-time { display: inline-block; margin: 6px 0 18px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .9375rem; }
.welcome-main { max-width: 620px; }
.lead { max-width: 58ch; margin-bottom: 0; color: var(--muted); font-size: 1.125rem; }
.adaptive-explanation { max-width: 58ch; margin-top: 28px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--tint); }
.adaptive-explanation h2 { margin-bottom: 8px; font-size: 1.05rem; }
.adaptive-explanation p { margin: 0; color: var(--ink); line-height: 1.55; }
.name-label { display: block; margin: 30px 0 8px; font-size: .9375rem; font-weight: 700; }
.name-input + .name-label { margin-top: 16px; }
.name-label .optional { font-weight: 400; opacity: .85; }
.name-input { width: 100%; max-width: 440px; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; }
.name-input[readonly] { background: var(--tint); color: var(--ink); }
.name-help { max-width: 56ch; margin: 9px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.expectations { padding: 22px 26px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.expectations h2 { margin-bottom: 10px; }
.expectation { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: start; padding: 18px 0; border-top: 1px solid var(--line); }
.expectation > strong { color: var(--teal); font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.expectation p { margin: 0; color: var(--muted); font-size: .9375rem; }
.expectation b { color: var(--ink); }
.notice { max-width: 760px; margin: 0 0 36px; padding-top: 18px; border-top: 1px solid var(--line); color: #594515; font-size: .9375rem; }
.notice strong { color: #3c2c06; }

.assessment, .card { max-width: 820px; margin: 10px auto 0; padding: clamp(24px, 5vw, 54px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.progress-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.section-progress, .question-count { margin: 0; color: var(--muted); font-size: .875rem; font-weight: 650; }
.question-count { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress-track { display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); gap: 5px; margin: 15px 0 38px; }
.progress-segment { height: 7px; border-radius: 4px; background: var(--line); }
.progress-segment.is-done { background: var(--teal); }
.progress-segment.is-current { border: 1px solid var(--night); background: var(--amber); }
.question-heading { max-width: 24ch; margin: 0 0 28px; font-size: clamp(1.75rem, 3.6vw, 2.5rem); line-height: 1.18; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.question-heading:focus, .placement-result-title:focus, .welcome h1:focus { outline: 3px solid var(--focus); outline-offset: 6px; border-radius: 4px; }
.passage { margin: 0 0 26px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--tint); white-space: pre-line; line-height: 1.75; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { max-width: 62ch; margin-bottom: 19px; color: var(--ink); font-size: clamp(1.25rem, 2.4vw, 1.55rem); font-weight: 700; line-height: 1.35; }
.options { display: grid; gap: 10px; }
.option { display: flex; min-height: 58px; align-items: center; gap: 15px; padding: 14px 17px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); line-height: 1.45; cursor: pointer; }
.option:hover { border-color: var(--teal); background: var(--tint); }
.option:has(input:checked) { padding: 13px 16px; border: 2px solid var(--teal); background: var(--tint); }
.option input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--teal); }
.option:has(input:focus-visible) { outline: 3px solid var(--teal); outline-offset: 3px; }
.question-actions { justify-content: space-between; align-items: center; margin-top: 28px; }
.answer-hint { margin: 16px 0 0; color: var(--muted); font-size: .875rem; }

.audio-box { margin: 0 0 26px; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--tint); }
.audio-heading { display: flex; gap: 13px; align-items: center; margin-bottom: 18px; }
.audio-icon { display: grid; width: 42px; height: 42px; flex: none; place-items: center; border-radius: 12px; background: var(--tint); color: var(--teal); }
.audio-icon svg { width: 23px; height: 23px; }
.audio-heading p { margin: 0; color: var(--ink); font-size: 1rem; font-weight: 700; line-height: 1.3; }
.audio-hint { display: block; margin-top: 3px; color: var(--muted); font-size: .875rem; }
audio { width: 100%; max-width: 100%; }
.player { display: flex; align-items: center; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.player[hidden] { display: none; }
.player button.play-button { display: grid; width: 46px; height: 46px; flex: none; place-items: center; padding: 0; border-radius: 50%; }
.play-button svg { width: 23px; height: 23px; }
.player-main { min-width: 0; flex: 1; }
.player-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .8125rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.audio-seek { display: block; width: 100%; height: 7px; margin: 12px 0 2px; appearance: none; border-radius: 8px; background: linear-gradient(to right, var(--teal) 0%, var(--teal) var(--played, 0%), var(--line) var(--played, 0%), var(--line) 100%); cursor: pointer; }
.audio-seek::-webkit-slider-thumb { width: 16px; height: 16px; appearance: none; border: 2px solid #fff; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.audio-seek::-moz-range-thumb { width: 13px; height: 13px; border: 2px solid #fff; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.audio-seek:disabled { cursor: wait; opacity: .65; }
.player button.volume-button { display: grid; width: 42px; height: 42px; flex: none; place-items: center; padding: 8px; border-color: transparent; background: transparent; color: var(--ink); }
.player button.volume-button:hover { background: var(--tint); border-color: transparent; }
.volume-button svg { width: 22px; height: 22px; }
.volume-button[aria-pressed=true] { opacity: .55; }
.audio-error { margin: 12px 0 0; color: #8d2c28; font-size: .9rem; }
.audio-error[hidden] { display: none; }
#retry-audio { margin-top: 12px; }
fieldset:disabled .option { cursor: not-allowed; }

.placement-result-title { max-width: 20ch; font-size: clamp(2.2rem, 5vw, 3rem); }
.results-progress { margin-bottom: 28px; }
.results-progress .progress-track { margin-bottom: 0; }
.student-result { margin-bottom: 18px; color: var(--muted); }
.result { display: flex; gap: 24px; align-items: center; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result strong.placement-level { display: block; margin: 0 0 7px; color: var(--teal); font-size: clamp(2.6rem, 7vw, 4.2rem); line-height: 1.05; font-variant-numeric: tabular-nums; }
.result .result-label { margin: 0 0 8px; }
.result p { margin-bottom: 0; color: var(--muted); }
.placement-note { margin: 24px 0 12px; font-weight: 700; }
.estimate-caveat { margin: 18px 0; padding: 16px 18px; border: 1px solid #d8bd7c; border-radius: 12px; background: #fff7e6; color: #594515; line-height: 1.6; }
.estimate-caveat strong { color: #3c2c06; }
.study-plan { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.study-plan h2 { font-size: 1.25rem; }
.study-plan ul { padding-left: 1.35em; line-height: 1.6; }
.study-plan li + li { margin-top: 10px; }
.study-plan p:last-child { margin-bottom: 0; }
.review-list { margin-top: 34px; }
.review-list > p { max-width: 68ch; color: var(--muted); }
.review { margin: 0; border-top: 1px solid var(--line); }
.review:last-child { border-bottom: 1px solid var(--line); }
.review summary { padding: 17px 4px; color: var(--ink); font-weight: 700; cursor: pointer; }
.review-content { padding: 0 4px 20px; }
.review-content .passage { margin-top: 12px; }
.review-content h3 { font-size: 1.1rem; line-height: 1.4; }
.review-content p { color: var(--muted); line-height: 1.6; }
.good { color: #176b46; }
.bad { color: #9a342e; }

.storage-warning { max-width: 1104px; margin: 18px auto 0; padding: 14px 18px; border: 1px solid #d8bd7c; border-radius: 12px; background: #fff7e6; color: #594515; line-height: 1.5; }
.storage-warning[hidden] { display: none; }
.section-progress, .question-count, .player-meta, .placement-level { font-variant-numeric: tabular-nums; }

/* Small, consistent interaction details keep the assessment calm and legible. */
button, .option { transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out; }
button:disabled:hover { background: var(--teal); border-color: var(--teal); }
button.text-size[aria-pressed="true"] { color: var(--teal); background: var(--tint); border-color: var(--teal); }
.name-input:hover { border-color: var(--teal); }
.name-input:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.name-input::placeholder { color: var(--muted); opacity: 1; }
.option { min-width: 0; }
.option span { overflow-wrap: anywhere; }
.question-actions { gap: 10px; }
.question-actions button[type="submit"] { margin-left: auto; }
.review summary { line-height: 1.5; }
.review summary:hover { color: var(--night); }
.review[open] summary { padding-bottom: 12px; }

@media (max-width: 760px) {
  .header-inner { min-height: 66px; padding: 12px 20px; }
  main { min-height: calc(100vh - 140px); padding: 24px 20px 44px; }
  footer { padding: 20px 20px 30px; }
  .welcome { grid-template-columns: 1fr; gap: 36px; min-height: 0; padding: 36px 0 30px; }
  .expectations { padding: 0 0 0 20px; }
  .assessment, .card { margin-top: 0; padding: 24px 20px; }
  .question-actions { align-items: stretch; flex-direction: column-reverse; }
  .question-actions button { width: 100%; }
  .question-actions button[type="submit"] { margin-left: 0; }
  .storage-warning { margin: 14px 20px 0; }
}
@media (max-width: 440px) {
  .header-inner { gap: 10px; }
  .brand { max-width: 15ch; font-size: .98rem; }
  button.text-size { min-height: 40px; padding: 8px 10px; font-size: .8125rem; }
  .progress-track { gap: 3px; margin: 13px 0 30px; }
  .progress-segment { height: 5px; }
  .progress-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .player { gap: 9px; padding: 10px; }
  .player button.play-button { width: 42px; height: 42px; }
  .player button.volume-button { width: 36px; height: 40px; padding: 6px; }
  .player-meta { font-size: .75rem; }
  .audio-box { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
@media print {
  body { background: #fff; }
  header, footer, button, .actions { display: none !important; }
  main { max-width: none; min-height: 0; padding: 0; }
  .card { max-width: none; padding: 0; border: 0; }
  .review { break-inside: avoid; }
  .review-content { display: block; }
}

/* Modern assessment treatment */
main { max-width: 1240px; }
.header-inner, footer { max-width: 1240px; }
.brand { letter-spacing: -.03em; }
h1 { letter-spacing: -.02em; line-height: 1.1; }
.welcome { gap: clamp(36px, 7vw, 88px); }
.welcome-main { max-width: 660px; }
.lead { color: var(--muted); line-height: 1.65; }
.adaptive-explanation { max-width: 58ch; margin-top: 28px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--tint); }
.adaptive-explanation h2 { margin-bottom: 8px; font-size: 1.05rem; }
.adaptive-explanation p { margin: 0; color: var(--ink); line-height: 1.55; }
.expectations { padding: 24px 28px; }
.expectation { grid-template-columns: 48px 1fr; padding: 20px 0; }
.expectation > strong { font-size: 1.8rem; }
.assessment, .card { box-shadow: var(--shadow); }
.question-heading, .production-question { line-height: 1.16; letter-spacing: -.025em; }
.option { min-height: 62px; border-color: var(--line-strong); background: #fff; transition: background-color 140ms ease-out, border-color 140ms ease-out; }
.option:hover { border-color: var(--teal); background: var(--tint); }
.option:has(input:checked) { background: var(--tint); border-color: var(--teal); }
button { box-shadow: none; }
button.secondary, button.text-size { border-color: var(--line-strong); }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline-color: var(--focus); }
@media (max-width: 760px) {
  .expectations { padding: 18px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

.production .lead { margin-bottom: 0; }
.production-note { margin: 22px 0 0; }
.production-question { max-width: 27ch; margin: 30px 0 14px; font-size: clamp(1.75rem, 3.6vw, 2.5rem); line-height: 1.18; }
.production-timing { color: var(--muted); }
.production textarea { display: block; width: 100%; margin-top: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); font: inherit; line-height: 1.55; resize: vertical; }
.production textarea:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.reflection { margin-top: 28px; }
.reflection legend { margin-bottom: 6px; font-size: 1.2rem; }
.reflection p { color: var(--muted); }
.reflection .option + .option { margin-top: 10px; }
.production-summary { padding-left: 1.5rem; }
.production-summary li { margin-bottom: 24px; }
.production-summary li p { margin: 8px 0; }
.written-answer { white-space: pre-wrap; overflow-wrap: anywhere; }
.production-link { align-self: center; padding: 10px 0; font-weight: 700; }

.skill-profile { list-style: none; padding: 0 !important; }
.skill-profile li { border-top: 1px solid var(--line); padding: .9rem 0 .25rem; }
.skill-profile li > span { display: block; color: var(--muted); }
.skill-profile p { margin: .35rem 0; }
.teacher-rating .option { margin-bottom: .65rem; }
.teacher-rating button { margin: .75rem 0; }

.consultation-intro { margin: 14px 0 0; max-width: 58ch; }
.placement-consultation { --focus: var(--amber); margin-top: 24px; padding: clamp(20px, 4vw, 32px); border-radius: var(--radius); background: var(--night); }
.placement-consultation h2 { margin-bottom: 10px; color: var(--paper); }
.placement-consultation p { color: var(--on-dark-muted); }
.placement-consultation a { color: var(--amber-text); }
.placement-consultation summary { width: fit-content; padding: 12px 16px; border-radius: var(--radius); background: var(--amber); color: var(--night); font-weight: 700; cursor: pointer; }
.placement-consultation summary:hover { background: var(--amber-hover); }
.consultation-calendar { display: block; width: 100%; height: 720px; margin-top: 14px; border: 0; background: var(--paper); }
@media (max-width: 440px) {
  .placement-consultation { padding: 16px; }
  .consultation-calendar { width: calc(100% + 32px); margin-inline: -16px; }
}
@media print {
  .placement-consultation { display: none; }
}

/* The start screen uses the same dark welcome band as the landing page. */
@media screen {
  body:has(.welcome) {
    background:
      radial-gradient(60rem 30rem at 85% 10%, rgb(218 136 71 / .16), transparent 60%),
      radial-gradient(50rem 40rem at 0% 100%, rgb(22 131 107 / .28), transparent 60%),
      linear-gradient(180deg, var(--night), var(--teal));
  }
  .welcome { --focus: var(--amber); color: var(--paper); }
  .welcome h1, .welcome h2, .welcome .expectation b { color: var(--paper); }
  .welcome h1 em { color: var(--amber-text); font-style: normal; }
  .welcome p, .welcome + .notice, body:has(.welcome) footer { color: var(--on-dark-muted); }
  .welcome .adaptive-explanation, .welcome .expectations {
    border-color: rgb(255 255 255 / .2);
    background: rgb(255 255 255 / .06);
  }
  .welcome .expectation, .welcome + .notice, body:has(.welcome) footer { border-color: rgb(255 255 255 / .2); }
  .welcome .expectation > strong { color: var(--amber-text); }
  .welcome + .notice strong { color: var(--paper); }
  .welcome button[type="submit"] { border-color: var(--amber); background: var(--amber); color: var(--night); }
  .welcome button[type="submit"]:hover { border-color: var(--amber-hover); background: var(--amber-hover); }
  .welcome .name-input:focus-visible { outline-color: var(--amber); }
}
