/* Pupil portal: The Route. Everything is scoped to .portal, so the review and terms pages don't change. */
.portal {
    --navy: #21285a;
    --red: #c8202d;
    --ground: #edf0f7;
    --muted: #4a527c;
    --rule: #aeb5cf;
    --road-ahead: #7c84a6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ground);
    color: var(--navy);
    font-family: Overpass, Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.5;
}

.portal *, .portal *::before, .portal *::after { box-sizing: border-box; }
.portal h1, .portal h2, .portal h3, .portal p, .portal ul, .portal ol { margin: 0; }
.portal h1 { font-size: clamp(1.75rem, 1.4rem + 1.8vw, 2.625rem); line-height: 1.1; font-weight: 800; }
.portal h1:focus { outline: none; }
.portal h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 800; }
.portal h3 { font-size: 1.125rem; line-height: 1.25; font-weight: 700; }
.portal a { color: var(--navy); text-decoration: underline; }
.portal a:hover { color: var(--red); }
.portal .muted { color: var(--muted); }
.portal :focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.portal-head { background: #fff; border-bottom: 2px solid var(--navy); }
.portal-head-inner, .portal-main { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: 20px; }
.portal-head-inner { display: flex; align-items: center; gap: 12px 28px; min-height: 68px; }
.portal .brand { display: flex; align-items: center; gap: 12px; margin-right: auto; font-size: 1.125rem; font-weight: 800; text-decoration: none; }
.brand img { width: 42px; height: 42px; }
.portal-main { flex: 1; display: flex; flex-direction: column; gap: 32px; padding-block: 24px 112px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 4px; }
.narrow { max-width: 720px; }

/* Navigation: along the bottom on phones, in the header on larger screens */
.portal-nav { position: fixed; z-index: 10; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; border-top: 2px solid var(--navy); padding-bottom: env(safe-area-inset-bottom); }
.portal .portal-nav a { min-height: 60px; display: flex; align-items: center; justify-content: center; font-size: .9375rem; font-weight: 700; text-align: center; text-decoration: none; }
.portal .portal-nav a.active { background: var(--navy); color: #fff; }

/* Buttons */
.portal .btn-p, .portal .btn-s, .portal .btn-link-p {
    display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
    border: 2px solid transparent; border-radius: 8px; font: inherit; font-size: 1rem; font-weight: 700;
    line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
}
.portal .btn-p { background: var(--red); color: #fff; }
.portal .btn-p:hover { background: #a81823; color: #fff; }
.portal .btn-s { background: #fff; border-color: var(--navy); color: var(--navy); }
.portal .btn-s:hover { background: var(--navy); color: #fff; }
.portal .btn-link-p { padding: 0; border: 0; background: none; color: var(--navy); text-decoration: underline; }
.portal button:disabled { opacity: .6; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.portal .sign .btn-s { flex: 1 1 auto; padding-inline: 12px; border-color: #fff; }
.portal .sign .btn-s:hover { background: var(--ground); color: var(--navy); }
.portal .sign .btn-s.clear { background: transparent; color: #fff; }
.portal .sign .btn-s.clear:hover { background: #fff; color: var(--navy); }

/* Road sign panel */
.sign { background: var(--navy); border-radius: 16px; padding: 6px; color: #fff; }
.sign-in { border: 2px solid #fff; border-radius: 11px; padding: 20px; display: flex; flex-direction: column; gap: 16px; height: 100%; }
.portal .sign h2 { font-size: 1rem; font-weight: 600; }
.sign .big { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.625rem); line-height: 1.1; font-weight: 800; overflow-wrap: anywhere; }
.sign .question { font-size: 1.5rem; line-height: 1.25; font-weight: 800; }
.portal .sign :focus-visible { outline-color: #fff; }

.columns { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; }

/* The road: down the page on phones, across it on larger screens */
.portal .road { list-style: none; padding: 0; display: flex; flex-direction: column; }
.stop { display: flex; gap: 16px; min-height: 88px; }
/* Overlap each piece by 1px so no gaps show between them. */
.stop-road { position: relative; flex: 0 0 44px; margin-bottom: -1px; background: var(--road-ahead); }
.stop:last-child .stop-road { margin-bottom: 0; }
.stop.begun .stop-road { background: var(--navy); }
.stop-road::before { content: ""; position: absolute; left: 20px; top: 0; bottom: 0; width: 4px; background: repeating-linear-gradient(to bottom, #fff 0 12px, transparent 12px 28px); }
.stop-mark { position: absolute; left: 5px; top: 8px; width: 34px; height: 34px; border: 4px solid var(--navy); border-radius: 50%; background: #fff; display: grid; place-items: center; }
.stop.focus-here .stop-mark { border-color: var(--red); }
.stop-text { padding: 2px 0 18px; display: flex; flex-direction: column; align-items: flex-start; }
.portal .stop-text a { min-height: 44px; display: inline-flex; align-items: center; font-size: 1.125rem; line-height: 1.2; font-weight: 800; }
.tag { background: var(--red); color: #fff; font-size: .8125rem; line-height: 1.2; font-weight: 700; padding: 5px 8px; border-radius: 4px; }
.stop-text .tag { margin-top: 6px; }

/* Lists and ratings */
.portal .rows { list-style: none; padding: 0; border-top: 2px solid var(--navy); }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 60px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.portal .rows a { font-weight: 700; }
.rate { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rate legend { float: none; width: 100%; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; font-size: 1.0625rem; line-height: 1.4; }
.choices { display: grid; gap: 6px; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); }
.portal .choice { min-height: 48px; padding: 6px; border: 2px solid var(--navy); border-radius: 8px; background: #fff; color: var(--navy); font: inherit; font-weight: 700; line-height: 1.15; cursor: pointer; }
.portal .choice[aria-pressed="true"] { background: var(--navy); color: #fff; }
.stage-links { display: flex; flex-wrap: wrap; gap: 8px; }
.portal .stage-links a { min-height: 44px; display: inline-flex; align-items: center; padding: 6px 14px; border: 2px solid var(--navy); border-radius: 8px; background: #fff; font-size: 1rem; line-height: 1.2; font-weight: 700; text-decoration: none; }
.portal .stage-links a[aria-current="page"] { background: var(--navy); color: #fff; }

.note { white-space: pre-wrap; overflow-wrap: anywhere; }
.status { min-height: 1.5em; font-weight: 600; }
.status.error { color: #a81823; }
.portal textarea, .portal input[type="email"] { width: 100%; padding: 12px; border: 2px solid var(--navy); border-radius: 8px; background: #fff; color: var(--navy); font: inherit; }
.portal label { font-weight: 700; }

.portal-main.login { max-width: 480px; }
.portal-main.login img { width: 100%; max-height: 22vh; object-fit: contain; }

/* Test day */
.countdown { background: var(--red); color: #fff; border-radius: 16px; padding: 24px; }
.portal .countdown h1 { font-size: 1.125rem; font-weight: 700; }
.countdown .days { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 1.5rem; font-weight: 700; }
.countdown .days strong { font-size: clamp(4.5rem, 3.5rem + 5vw, 7rem); line-height: 1; font-weight: 800; }

/* Mock reports */
.score { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.score strong { display: block; font-size: 3.25rem; line-height: 1.05; font-weight: 800; }
.bar { height: 12px; background: #d3d8e8; }
.bar span { display: block; height: 100%; background: var(--navy); }

@media (min-width: 900px) {
    .portal-main { padding-block: 40px 64px; gap: 44px; }
    .portal-nav { position: static; display: flex; gap: 4px; border: 0; padding: 0; }
    .portal .portal-nav a { min-height: 44px; padding: 0 14px; border-radius: 8px; font-size: 1rem; }
}

@media (min-width: 1100px) {
    .portal .road { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .stop { flex-direction: column; gap: 12px; }
    .stop-road { flex: 0 0 56px; margin: 0 -1px 0 0; }
    .stop-road::before { left: 0; right: 0; top: 26px; bottom: auto; width: auto; height: 4px; background: repeating-linear-gradient(to right, #fff 0 16px, transparent 16px 34px); }
    .stop-mark { left: 0; top: 8px; width: 40px; height: 40px; }
    .stop:last-child .stop-road { margin-right: 0; }
    .stop-text { padding: 0 14px 0 0; }
    .portal .stop-text a { font-size: 1.0625rem; }
    .stop-text p { font-size: .9375rem; }
}
.dev-site-banner {
    position: sticky;
    z-index: 1200;
    top: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    padding: 12px 20px;
    background: #b42318;
    color: #fff;
    font-size: 1rem;
    line-height: 1.35;
    text-align: center;
}

.dev-site-banner strong { letter-spacing: .03em; }
