@font-face { font-family: "Archivo"; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(/fonts/archivo-latin-standard-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Archivo"; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(/fonts/archivo-latin-ext-standard-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --magenta: #E20074;
  --magenta-deep: #A60057;
  --magenta-tint: #FCE7F2;
  --ink: #1A1A1A;
  --grey: #6B6B6B;
  --mist: #F5F5F5;
  --line: #DADADA;
  --ok: #0B7A3B;
  --face: "Archivo", "Segoe UI", Arial, sans-serif;
  --rail: 300px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--face); color: var(--ink); background: #fff; font-size: 16px; line-height: 1.5;
       -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.rail :focus-visible { outline-color: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.app { min-height: calc(100vh - 44px); display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }

/* Rail: same magenta panel as the certificate */
.rail { background: var(--magenta); color: #fff; padding: 40px 28px 28px; display: flex; flex-direction: column; gap: 32px; }
.wordmark { font-stretch: 125%; font-weight: 800; font-size: 34px; line-height: 0.95; letter-spacing: -0.01em; }
.rail-sub { margin-top: 10px; font-size: 15px; font-weight: 500; opacity: 0.92; }
.rail-modules { display: flex; flex-direction: column; }
.rail-modules h2 { font-size: 13px; font-weight: 650; margin: 0 0 8px; opacity: 0.85; }
.mod { all: unset; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: baseline;
       padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.3); font-size: 14px; line-height: 1.3; }
.mod:hover .mod-name { text-decoration: underline; text-underline-offset: 3px; }
.mod[aria-current="true"] .mod-name { font-weight: 700; }
.mod-count { font-stretch: 110%; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13px; opacity: 0.9; white-space: nowrap; }
.mod.done .mod-count::after { content: " ✓"; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.rail-foot .who { opacity: 0.9; overflow-wrap: anywhere; }
.linkish { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-light { all: unset; cursor: pointer; text-align: center; background: #fff; color: var(--magenta-deep); font-weight: 700;
             padding: 12px 16px; }
.btn-light:hover { background: var(--magenta-tint); }

/* Stage */
.stage { padding: 56px 64px 48px; outline: none; display: flex; flex-direction: column; min-width: 0; }
.narrow { max-width: 560px; }
.loading { color: var(--grey); }
h1 { font-stretch: 112%; font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 16px; }
.lede { font-size: 18px; margin: 0 0 32px; max-width: 34em; }
.muted { color: var(--grey); }
.facts { list-style: none; padding: 0; margin: 0 0 36px; max-width: 36em; }
.facts li { padding: 14px 0 14px 28px; border-top: 1px solid var(--line); position: relative; }
.facts li::before { content: ""; position: absolute; left: 0; top: 23px; width: 12px; height: 4px; background: var(--magenta); }
.facts li:last-child { border-bottom: 1px solid var(--line); }

label.field { display: block; font-weight: 650; margin-bottom: 8px; }
.input { width: 100%; max-width: 420px; padding: 14px 16px; border: 2px solid var(--ink); background: #fff; font-size: 18px; border-radius: 0; }
.input.code { max-width: 240px; font-stretch: 115%; font-weight: 700; letter-spacing: 0.3em; font-size: 26px; }
.input:focus { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px var(--magenta-tint); }
.hint { font-size: 14px; color: var(--grey); margin: 10px 0 0; }
.error { color: #B00045; font-weight: 600; margin: 12px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 28px; }

.btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
       background: var(--magenta); color: #fff; font-weight: 700; padding: 15px 26px; font-size: 17px; }
.btn:hover { background: var(--magenta-deep); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn[disabled] { background: #E8B8D0; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.secondary:hover { background: var(--mist); }
.btn.quiet { background: none; color: var(--ink); padding: 15px 4px; text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }

/* Question view */
.qbar { position: sticky; top: 0; background: #fff; padding: 0 0 18px; z-index: 2; }
.progress { height: 6px; background: var(--mist); margin-bottom: 18px; }
.progress > span { display: block; height: 100%; background: var(--magenta); transition: width .3s ease; }
.qmeta { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; font-size: 14px; color: var(--grey); }
.qmeta b { color: var(--ink); font-stretch: 110%; }
.save { font-size: 13px; white-space: nowrap; }
.save.ok { color: var(--ok); }
.save.bad { color: #B00045; font-weight: 600; }
.qmodule { font-size: 14px; color: var(--magenta-deep); font-weight: 650; margin: 22px 0 10px; }
.qtext { font-size: 26px; line-height: 1.3; font-weight: 600; margin: 0 0 28px; max-width: 32em; letter-spacing: -0.005em; }
.options { display: grid; gap: 12px; max-width: 760px; margin: 0; padding: 0; border: 0; }
.opt { all: unset; cursor: pointer; display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 16px;
       padding: 14px 18px 14px 14px; background: var(--mist); font-size: 17px; line-height: 1.4; border-left: 6px solid transparent; }
.opt:hover { background: #ECECEC; }
.opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.opt .key { width: 44px; height: 44px; display: grid; place-items: center; background: #fff; font-weight: 750; font-stretch: 115%; }
.opt[aria-checked="true"] { background: var(--magenta-tint); border-left-color: var(--magenta); }
.opt[aria-checked="true"] .key { background: var(--magenta); color: #fff; }
.qnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 36px; max-width: 760px; }
.kbd { font-size: 13px; color: var(--grey); margin-top: 18px; }

/* Panels */
.panel-box { background: var(--mist); padding: 28px 30px; max-width: 640px; margin: 8px 0 0; }
.panel-box h2 { margin: 0 0 8px; font-size: 22px; font-stretch: 110%; }
.score { font-stretch: 125%; font-weight: 800; font-size: 96px; line-height: 1; letter-spacing: -0.03em; color: var(--magenta); margin: 8px 0 12px; }
.score.fail { color: var(--ink); }
.result-pass .tab { height: 8px; width: 120px; background: var(--magenta); margin: 0 0 28px -64px; }

.legal { padding: 14px 28px; font-size: 12px; color: var(--grey); border-top: 1px solid var(--line); background: #fff;
         display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap; }
.legal .partners { display: flex; align-items: center; gap: 18px; }
.legal .partners-label { font-size: 12px; }
.legal .ow { height: 18px; width: auto; }
.legal .nj { height: 26px; width: auto; }

/* Result breakdown */
.breakdown { border-collapse: collapse; margin: 32px 0 8px; min-width: min(520px, 100%); font-size: 15px; }
.breakdown caption { text-align: left; font-weight: 700; font-stretch: 110%; font-size: 17px; margin-bottom: 10px; }
.breakdown th { text-align: left; font-size: 13px; color: var(--grey); font-weight: 600; padding: 0 16px 6px 0; border-bottom: 2px solid var(--ink); }
.breakdown td { padding: 9px 16px 9px 0; border-bottom: 1px solid var(--line); }
.breakdown td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 650; }
.breakdown tr.none td:last-child { color: #B00045; }
.breakdown tr.all td:last-child { color: var(--ok); }
.result-pass .breakdown, .panel-box { margin-top: 32px; }

/* Answers and explanations */
.review-tools { margin-top: 0; justify-content: space-between; max-width: 820px; }
.toggle { display: inline-flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--magenta); }
.answers { list-style: none; padding: 0; margin: 24px 0 0; max-width: 820px; }
.answers.only-wrong .is-right { display: none; }
.ans { padding: 22px 0 24px; border-top: 1px solid var(--line); }
.ans-head { display: flex; gap: 12px; align-items: baseline; font-size: 13px; color: var(--grey); }
.ans-n { font-weight: 750; font-stretch: 115%; color: var(--ink); font-size: 15px; min-width: 22px; }
.ans-mod { flex: 1; }
.ans-flag { font-weight: 700; }
.is-right .ans-flag { color: var(--ok); }
.is-wrong .ans-flag { color: #B00045; }
.ans-q { font-size: 19px; font-weight: 600; line-height: 1.35; margin: 8px 0 14px 34px; }
.ans-opts { list-style: none; padding: 0; margin: 0 0 0 34px; display: grid; gap: 6px; }
.ans-opts li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px 8px 8px; background: var(--mist); font-size: 15px; border-left: 5px solid transparent; }
.ans-opts .key { width: 30px; height: 30px; display: grid; place-items: center; background: #fff; font-weight: 750; font-size: 13px; }
.ans-opts li.c { background: #E6F4EC; border-left-color: var(--ok); }
.ans-opts li.c .key { background: var(--ok); color: #fff; }
.ans-opts li.y { background: #FBE4EE; border-left-color: #B00045; }
.ans-opts .tag { font-size: 12px; font-weight: 700; white-space: nowrap; }
.ans-opts li.c .tag { color: var(--ok); }
.ans-opts li.y .tag { color: #B00045; }
.ans-why { margin: 14px 0 0 34px; padding: 12px 16px; background: #fff; border-left: 4px solid var(--magenta); font-size: 15px; line-height: 1.55; max-width: 44em; }
@media (max-width: 860px) {
  .ans-q, .ans-opts, .ans-why { margin-left: 0; }
  .ans-opts li { grid-template-columns: 30px 1fr; }
  .ans-opts .tag { grid-column: 2; }
  .legal { padding: 14px 20px; }
}
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(200%); background: var(--ink); color: #fff;
         padding: 12px 18px; font-size: 15px; transition: transform .25s ease, visibility .25s; z-index: 10; max-width: 90vw; visibility: hidden; }
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }

/* Before sign-in, the rail carries no module list */
.signed-out .rail-modules, .signed-out .rail-foot { display: none; }

/* Before sign-in the page stays neutral: no client colours or names. Once signed in, the magenta design takes over. */
body.signed-out { --magenta: #1E2E3B; --magenta-deep: #121D27; --magenta-tint: #E7EDF2; }
body.signed-out .error { color: #B3261E; }
body.signed-out .legal-in, body:not(.signed-out) .legal-out { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { padding: 18px 20px; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .wordmark { font-size: 22px; }
  .rail-sub { margin-top: 4px; font-size: 13px; }
  .rail-modules { display: none; }
  .rail-foot { margin: 0; flex-direction: row; align-items: center; gap: 14px; }
  .rail-foot .who, .rail-foot .btn-light { display: none; }
  .stage { padding: 28px 20px 36px; }
  h1 { font-size: 30px; }
  .qtext { font-size: 21px; }
  .opt { font-size: 16px; grid-template-columns: 36px 1fr; gap: 12px; }
  .opt .key { width: 36px; height: 36px; }
  .score { font-size: 72px; }
  .result-pass .tab { margin-left: -20px; }
  .kbd { display: none; }
}

/* Certificate check page */
body.verify { background: var(--mist); min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.verify-card { background: #fff; max-width: 560px; width: 100%; border-top: 10px solid var(--magenta); padding: 36px 36px 30px; }
.verify-card .brand { font-stretch: 125%; font-weight: 800; color: var(--magenta); font-size: 20px; margin-bottom: 24px; }
.verify-card .state { font-weight: 700; color: #B00045; margin: 0 0 6px; }
.verify-card .state.ok { color: var(--ok); }
.verify-card h1 { font-size: 32px; }
.verify-card .id { color: var(--grey); font-size: 14px; }
