/* VLE Tutors GCSE Maths diagnostic: student page.
   Colours are taken from the VLE Tutors logo (navy, green, gold); the typeface is
   Plus Jakarta Sans, as on vletutors.co.uk. Everything is served from this origin. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url(/vendor/fonts/plus-jakarta-sans.woff2) format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #15233a;
  --ink-2: #4b576a;
  --line: #e4dfd5;
  --line-strong: #c4bcad;
  --navy: #132c45;
  --primary: #132c45;
  --primary-hover: #0b1e31;
  --primary-ink: #ffffff;
  --green: #2d6a4f;
  --green-ink: #ffffff;
  --green-soft: #e7f1ec;
  --gold: #b48c54;
  --gold-soft: #f8f0e3;
  --gold-ink: #74511f;
  --focus: #a2620d;
  --danger: #a3261d;
  --danger-soft: #fbeceb;
  --shadow: 0 1px 2px rgb(19 44 69 / 6%), 0 12px 32px -18px rgb(19 44 69 / 28%);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1520;
    --surface: #142031;
    --surface-2: #19273b;
    --ink: #e9eef4;
    --ink-2: #a8b4c3;
    --line: #26354a;
    --line-strong: #3b4d66;
    --navy: #e9eef4;
    --primary: #dcb983;
    --primary-hover: #e8c995;
    --primary-ink: #13202f;
    --green: #69b892;
    --green-ink: #0d1520;
    --green-soft: #183327;
    --gold: #d2aa6e;
    --gold-soft: #2e2618;
    --gold-ink: #e8c993;
    --focus: #f0c27a;
    --danger: #f2a49c;
    --danger-soft: #3a1d1c;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px -18px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
  .logo { filter: brightness(0) invert(1); opacity: .92; }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 700; color: var(--navy); }
h2 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1rem; }
strong { font-weight: 700; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.muted { color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.small { font-size: .875rem; }
.eyebrow {
  margin: 0 0 .4rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.lede { font-size: 1.075rem; color: var(--ink-2); max-width: 40em; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--surface); color: var(--ink); padding: .6rem 1rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 1rem; }

/* ---------- header ---------- */

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner {
  max-width: 1160px; margin: 0 auto; padding: .7rem 1rem;
  display: flex; align-items: center; gap: .9rem; min-height: 64px;
}
.logo { display: block; height: 40px; width: auto; }
.site-header__product {
  padding-left: .9rem; border-left: 1px solid var(--line-strong);
  font-size: .9rem; font-weight: 600; color: var(--ink-2); line-height: 1.2;
}
.site-header__part {
  margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .75rem;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .logo { height: 34px; }
  .site-header__product { font-size: .8rem; max-width: 7.5em; }
}

/* ---------- layout ---------- */

.page { max-width: 1160px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.page:focus { outline: none; }
.screen--narrow { max-width: 520px; margin: 0 auto; }
.screen--medium { max-width: 820px; margin: 0 auto; }
@media (min-width: 900px) { .page { padding-top: 3rem; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
@media (min-width: 640px) { .panel { padding: 2rem; } }
.panel__title { font-size: 1.1rem; margin-bottom: 1rem; color: var(--navy); }
.panel--centre { text-align: center; }
.panel--centre .btn { margin-top: .5rem; }
.stack > * + * { margin-top: 1rem; }

.banner {
  max-width: 820px; margin: 0 auto 1.25rem;
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: var(--radius-sm); padding: .85rem 1rem; font-weight: 500;
}

/* ---------- forms ---------- */

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.field-grid { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-grid { grid-template-columns: 1fr 1fr; } }
.field__hint { margin: .4rem 0 0; font-size: .875rem; color: var(--ink-2); }
.field__error { margin: .4rem 0 0; font-size: .9rem; font-weight: 600; color: var(--danger); }
.field__error:empty { display: none; }
.input {
  display: block; width: 100%;
  font: inherit; font-size: 1rem; /* 16px stops iOS zooming */
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .7rem .85rem; min-height: 48px;
  transition: border-color .12s, box-shadow .12s;
}
select.input {
  appearance: none; padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(-45deg, transparent 50%, var(--ink-2) 50%);
  background-position: right 1.15rem center, right .8rem center;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.input:hover { border-color: var(--ink-2); }
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 55%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input--code { font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; }
.input--code::placeholder { letter-spacing: normal; text-transform: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  min-height: 48px; padding: .7rem 1.25rem;
  border-radius: var(--radius-sm); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--ink-2); background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; opacity: .75; }
.btn__icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- welcome / intake ---------- */

.intake { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 960px) {
  .intake { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 4rem; }
  .intake__intro { padding-top: 1rem; }
}
.facts { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; max-width: 36em; }
.facts li { display: grid; grid-template-columns: 40px 1fr; gap: .9rem; align-items: start; }
.facts__icon {
  width: 40px; height: 40px; padding: 8px; border-radius: 12px;
  background: var(--green-soft); stroke: var(--green); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.facts span { padding-top: .45rem; }

/* ---------- question view ---------- */

.test { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1024px) {
  .test { grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; }
  .test__side { position: sticky; top: 1.5rem; }
}
.test__main { min-width: 0; max-width: 780px; width: 100%; justify-self: center; }
@media (max-width: 1023px) { .test__side { display: none; } }

.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 1rem; }
.progress__fill { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; transition: width .25s ease; }

.qcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem 1.25rem 1.5rem;
}
@media (min-width: 640px) { .qcard { padding: 2.25rem 2.5rem 2rem; } }
.qcard__heading {
  font-size: .9rem; font-weight: 700; letter-spacing: .02em; color: var(--gold-ink);
  margin: 0 0 1rem;
}

.part-tip {
  display: flex; gap: .6rem; align-items: flex-start;
  margin: -.25rem 0 1.25rem; padding: .7rem .9rem;
  background: var(--green-soft); color: var(--ink); border-radius: var(--radius-sm);
  font-size: .95rem; line-height: 1.45;
}
.part-tip__icon { width: 20px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; }

.prompt { font-size: 1.15rem; line-height: 1.65; color: var(--ink); }
@media (min-width: 640px) { .prompt { font-size: 1.3rem; } }
.prompt p { margin: 0 0 .75rem; }
.prompt p:last-child { margin-bottom: 0; }
.prompt .katex { font-size: 1.12em; }
.m { white-space: nowrap; }
.m-block { margin: .9rem 0 1rem; padding: .25rem 0 .25rem 1.25rem; overflow-x: auto; overflow-y: hidden; }
.m-block .katex-display { margin: 0; text-align: left; }
.m-block .katex-display > .katex { text-align: left; }
.m-fallback { font-family: "Cambria Math", Cambria, Georgia, serif; white-space: pre-line; }

.datatable { border-collapse: collapse; margin: .9rem 0 1rem; font-size: 1rem; }
.datatable th, .datatable td { border: 1px solid var(--line-strong); padding: .45rem .9rem; text-align: center; min-width: 3rem; }
.datatable th { background: var(--surface-2); font-weight: 600; text-align: left; }
.table-scroll { overflow-x: auto; }

.diagram { margin: 1.25rem 0 .5rem; }
.diagram svg { display: block; width: 100%; height: auto; color: var(--ink); }
.diagram__shape { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.diagram__mark { fill: none; stroke: currentColor; stroke-width: 1.5; }
.diagram__dash { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-dasharray: 6 5; }
.diagram__label { fill: currentColor; font: 500 15px var(--font); }
.diagram__note { margin: .35rem 0 0; font-size: .85rem; color: var(--ink-2); font-style: italic; }

.answer-box { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.answer__fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.answer__legend { font-weight: 700; font-size: 1rem; margin-bottom: .6rem; padding: 0; }
.answer__row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }
.answer__item { display: flex; align-items: center; gap: .6rem; }
.answer__item > label { font-size: 1.15rem; white-space: nowrap; min-width: 2.4em; }
.answer__item > label .katex { font-size: 1.1em; }
.affix {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.affix:hover { border-color: var(--ink-2); }
.affix:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 55%, transparent); }
.affix__unit {
  display: flex; align-items: center; padding: 0 .8rem;
  color: var(--ink-2); background: var(--surface-2); font-weight: 600; font-size: 1.1rem;
  min-width: 2.75rem; justify-content: center;
}
.affix__unit--degrees { font-size: 1.6rem; font-weight: 500; padding-bottom: .35rem; }
.affix__unit:first-child { border-right: 1px solid var(--line); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.affix__unit:last-child { border-left: 1px solid var(--line); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.affix input {
  font: inherit; font-size: 1.2rem; font-weight: 500; color: var(--ink);
  border: 0; background: transparent; outline: none;
  width: 11rem; max-width: 52vw; min-height: 52px; padding: .6rem .85rem;
  border-radius: var(--radius-sm);
}
.affix input:disabled { color: var(--ink-2); }
.answer-box--set .affix input, .answer-box--pair .affix input { width: 7.5rem; }
.answer-box.is-chosen .affix { background: var(--surface-2); border-style: dashed; opacity: .7; }
.answer-box.is-chosen .field__hint { visibility: hidden; }

.alt { margin-top: 1.5rem; }
.alt__label { margin: 0 0 .6rem; font-size: .95rem; color: var(--ink-2); }
.alt__buttons { display: flex; flex-wrap: wrap; gap: .75rem; }
.choice {
  display: inline-flex; align-items: center; gap: .65rem;
  min-height: 48px; padding: .6rem 1.1rem .6rem .85rem;
  font: inherit; font-weight: 600; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 999px;
  cursor: pointer; transition: background-color .12s, border-color .12s;
}
@media (hover: hover) {
  .choice[aria-pressed="false"]:hover { border-color: var(--ink); }
  .choice[aria-pressed="false"]:hover .choice__box { border-color: var(--ink-2); }
}
.choice__box {
  width: 20px; height: 20px; flex: none; border-radius: 6px;
  border: 2px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center;
}
.choice[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.choice[aria-pressed="true"] .choice__box { background: var(--gold-ink); border-color: var(--gold-ink); }
.choice[aria-pressed="true"] .choice__box::after {
  content: ""; width: 10px; height: 6px; margin-top: -2px;
  border-left: 2.5px solid var(--surface); border-bottom: 2.5px solid var(--surface); transform: rotate(-45deg);
}
@media (max-width: 480px) {
  .alt__buttons { flex-wrap: nowrap; gap: .5rem; }
  .choice { flex: 1 1 0; justify-content: center; padding: .55rem .7rem; font-size: .95rem; gap: .5rem; white-space: nowrap; }
}
.alt__note { margin: .75rem 0 0; font-size: .95rem; color: var(--gold-ink); min-height: 1.5em; }
.alt__note:empty { min-height: 0; margin: 0; }

.qnav-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-top: 1.25rem;
}
.qnav-bar .btn--primary { min-width: 9.5rem; }
@media (min-width: 1024px) { .qnav-bar__all { display: none; } }
/* Not sticky on phones: a bottom-pinned bar can sit over the on-screen keyboard. */
@media (max-width: 640px) {
  .qnav-bar .btn { padding-left: .9rem; padding-right: .9rem; }
  .qnav-bar .btn--primary { min-width: 0; }
  .qnav-bar__all { padding-left: .25rem; padding-right: .25rem; font-size: .95rem; }
}

/* question navigator (wide screens) */
.tiles { list-style: none; margin: 1rem 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.tiles--5 { grid-template-columns: repeat(5, 1fr); }
.tile {
  width: 100%; aspect-ratio: 1; min-height: 44px;
  display: grid; place-items: center;
  font: inherit; font-weight: 700; font-size: .95rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer; position: relative;
}
.tile:hover { border-color: var(--ink-2); }
.tile--answered { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.tile--chosen { background: var(--gold-soft); border: 1.5px dashed var(--gold); color: var(--gold-ink); }
.tile[aria-current="step"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--navy); }
.legend { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .45rem; font-size: .85rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: .6rem; }
.tile-swatch { width: 16px; height: 16px; flex: none; border-radius: 5px; border: 1.5px solid var(--line-strong); background: var(--surface); }
.tile-swatch--answered { background: var(--green); border-color: var(--green); }
.tile-swatch--chosen { background: var(--gold-soft); border: 1.5px dashed var(--gold); }

/* ---------- review ---------- */

.summary { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0; padding: 0; }
.summary li {
  font-size: .9rem; font-weight: 600; padding: .35rem .8rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.summary .summary--open { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.callout {
  background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  border-left: 4px solid var(--gold); border-radius: var(--radius-sm);
  padding: 1rem 1.15rem; margin: 0 0 1.5rem; color: var(--ink);
}
.callout p { margin: 0 0 .4rem; }
.callout p:last-child { margin: 0; }
.review-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.review-item {
  display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; gap: .35rem 1rem; align-items: start;
  padding: 1rem 1.25rem; border-top: 1px solid var(--line);
}
.review-item:first-child { border-top: 0; }
.review-item--open { background: color-mix(in srgb, var(--gold-soft) 70%, var(--surface)); box-shadow: inset 4px 0 0 var(--gold); }
.review-item__num { font-weight: 700; color: var(--ink-2); padding-top: .1rem; }
.review-item__q { font-size: .95rem; line-height: 1.6; color: var(--ink-2); }
.review-item__q .katex { font-size: 1.05em; }
.review-item__q .m-block { margin: .3rem 0; padding-left: .75rem; }
.review-item__q .datatable { font-size: .85rem; margin: .4rem 0; }
.review-item__a { margin-top: .35rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.review-item__a .tag { margin-left: 0; }
.review-item .btn { min-height: 44px; padding: .5rem .9rem; font-size: .95rem; }
.tag {
  display: inline-block; font-size: .8rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-ink); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
}
.tag--open { background: var(--surface); color: var(--ink-2); border: 1px dashed var(--line-strong); }
@media (max-width: 560px) {
  .review-item { grid-template-columns: 1.75rem minmax(0, 1fr); padding: 1rem; }
  .review-item .btn { grid-column: 2; justify-self: start; margin-top: .35rem; }
}
.review-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; }
@media (max-width: 560px) { .review-actions { flex-direction: column-reverse; } .review-actions .btn { width: 100%; } }

/* ---------- break / done ---------- */

.seal { width: 56px; height: 56px; margin: 0 auto 1rem; display: block; fill: var(--green-soft); stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.break-next {
  margin: .25rem auto 1rem; padding: .7rem 1rem; max-width: 26rem;
  background: var(--green-soft); border-radius: var(--radius-sm);
  font-size: 1.1rem; color: var(--navy);
}
.done-message { font-size: 1.3rem; line-height: 1.5; font-weight: 600; letter-spacing: 0; color: var(--navy); margin: 0; }
.done-message:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
