/* VehicleFile
   Palette: MOT-certificate paper, primary-route green, number-plate yellow.
   Type: Barlow Semi Condensed (plate, headings) + Atkinson Hyperlegible (reading; its slashed zero helps tell 0 from O). */

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("fonts/barlow-sc-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --paper: #F2F4F1;
  --surface: #FFFFFF;
  --ink: #1C2629;
  --ink-soft: #4A5559;
  --rule: #D3DAD6;
  --route: #00653A;
  --route-dark: #004A2A;
  --route-tint: #E2EFE7;
  --plate: #FFD200;
  --band: #00309A;
  --fail: #B3122B;
  --fail-tint: #FBE8EB;
  --danger: #7A0A1B;
  --warn: #8A5300;
  --warn-tint: #FDF0D8;
  --info: #2F4A5E;
  --info-tint: #E8EEF2;
  --neutral-tint: #E7EBE9;

  --f-display: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --f-text: "Atkinson Hyperlegible", Verdana, Arial, sans-serif;

  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--f-text); }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--route-dark); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--band); outline-offset: 3px; }
p { margin: 0 0 1em; }
button { font: inherit; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: var(--r); }
.skip:focus { top: 1rem; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.wrap--text > * { max-width: 44rem; }

/* ---------------------------------------------------------------- header */

.site-head { background: var(--surface); border-bottom: 1px solid var(--rule); }
.site-head__in { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; min-height: 4rem; flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; }
.brand__mark { width: 2.75rem; height: auto; flex: 0 0 auto; }
.brand__name { font: 700 1.5rem/1 var(--f-display); letter-spacing: 0.01em; }
.brand__accent { color: var(--route); }

.site-nav { display: flex; align-items: center; gap: 0.35rem 1.25rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 0.95rem; padding: 0.45rem 0; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav .site-nav__cta { color: #fff; background: var(--route); padding: 0.5rem 0.9rem; border-radius: var(--r); }
.site-nav .site-nav__cta:hover { background: var(--route-dark); color: #fff; text-decoration: none; }

/* -------------------------------------------------------------- the plate */

.plate { position: relative; display: flex; align-items: stretch; background: var(--plate); border: 3px solid var(--ink); border-radius: 9px; height: 4.75rem; width: min(100%, 27rem); overflow: hidden; }
.plate__band { flex: 0 0 2.6rem; background: var(--band); color: #fff; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 0.5rem; font: 700 0.85rem/1 var(--f-display); letter-spacing: 0.06em; }
.plate__input, .plate__text { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 700 2.75rem/1 var(--f-display); letter-spacing: 0.07em; text-transform: uppercase; text-align: center; padding: 0 0.75rem; border-radius: 0; }
.plate__text { display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.plate__input::placeholder { color: rgba(28, 38, 41, 0.3); }
.plate__input:focus { outline: none; }
.plate:focus-within { outline: 3px solid var(--band); outline-offset: 3px; }
.has-error .plate { border-color: var(--fail); }
.has-error .plate:focus-within { outline-color: var(--fail); }

.plate--static { height: 3.75rem; width: auto; min-width: 15rem; flex: 0 0 auto; }
.plate--static .plate__text { font-size: 2.1rem; padding: 0 1.25rem; }
.plate--static .plate__band { flex-basis: 2.1rem; }

.plate-form__label { display: block; font-weight: 700; margin-bottom: 0.6rem; }
.plate-form__row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: stretch; }
.plate-form__msg { margin: 0.6rem 0 0; min-height: 0; color: var(--fail); font-weight: 700; }
.plate-form__msg:empty { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; border: 0; border-radius: var(--r); cursor: pointer; font: 700 1.3rem/1 var(--f-display); letter-spacing: 0.01em; padding: 0 1.6rem; min-height: 3.25rem; }
.btn--go { background: var(--route); color: #fff; min-height: 4.75rem; }
.btn--go:hover { background: var(--route-dark); }
.btn.is-busy { cursor: progress; }
.btn.is-busy::before { content: ""; width: 1.1rem; height: 1.1rem; border: 3px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* recent checks */
.recent { margin-top: 1.5rem; }
.recent__head { font-size: 0.9rem; color: var(--ink-soft); font-weight: 700; margin: 0 0 0.5rem; }
.recent__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.recent__item { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.75rem 0.3rem 0.3rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.recent__item:hover { border-color: var(--ink-soft); }
.recent__plate { background: var(--plate); border: 2px solid var(--ink); border-radius: 4px; padding: 0.15rem 0.45rem; font: 700 1.05rem/1 var(--f-display); letter-spacing: 0.06em; }
.recent__name { font-size: 0.92rem; }
.recent__clear { margin-top: 0.6rem; background: none; border: 0; padding: 0.25rem 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 0.9rem; }

/* ------------------------------------------------------------------ hero */

.hero { padding: 3.5rem 0 3rem; background: var(--surface); border-bottom: 1px solid var(--rule); }
.hero__title { font: 700 clamp(2.6rem, 7vw, 4.4rem)/0.98 var(--f-display); letter-spacing: -0.01em; margin: 0 0 0.9rem; max-width: 14ch; }
.hero__lede { font-size: 1.2rem; line-height: 1.55; max-width: 38rem; color: var(--ink-soft); margin-bottom: 2rem; }
.hero__small { margin: 1rem 0 0; color: var(--ink-soft); font-size: 0.95rem; max-width: 40rem; }

/* --------------------------------------------------------------- sections */

.section { padding: 3.5rem 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section--cta { padding-bottom: 4.5rem; }
.section__title { font: 700 2rem/1.1 var(--f-display); margin: 0 0 1.25rem; }

.shows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; margin: 0; max-width: 56rem; }
.shows dt { font: 700 1.35rem/1.2 var(--f-display); margin-bottom: 0.4rem; padding-top: 0.75rem; border-top: 4px solid var(--route); }
.shows dd { margin: 0; color: var(--ink-soft); }

.levels { margin: 0 0 1.5rem; }
.levels > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.85rem 0; border-top: 1px solid var(--rule); }
.levels > div:last-child { border-bottom: 1px solid var(--rule); }
.levels dt, .levels dd { margin: 0; }

.checklist { padding-left: 1.2rem; margin: 0 0 1.25rem; }
.checklist li { margin-bottom: 0.7rem; padding-left: 0.25rem; }

.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; font: 700 1.25rem/1.3 var(--f-display); padding: 1rem 2rem 1rem 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.9rem; font-size: 1.5rem; color: var(--route); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 1.1rem; color: var(--ink-soft); }

/* ---------------------------------------------------------- severity chips */

.sev { display: inline-block; font: 700 0.8rem/1 var(--f-text); padding: 0.32em 0.55em; border-radius: 4px; white-space: nowrap; }
.sev-danger   { background: var(--danger); color: #fff; }
.sev-fail     { background: var(--fail); color: #fff; }
.sev-minor    { background: var(--neutral-tint); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.sev-advisory { background: var(--warn-tint); color: var(--warn); box-shadow: inset 0 0 0 1px #EBD3A6; }
.sev-note     { background: var(--neutral-tint); color: var(--ink-soft); }

/* ----------------------------------------------------------------- report */

.report { padding: 2rem 0 1rem; }
.notice { padding: 0.9rem 1.1rem; border-radius: var(--r); margin-bottom: 1.75rem; }
.notice--example { background: var(--warn-tint); color: var(--ink); border-left: 5px solid var(--warn); }

.report__head { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: center; margin-bottom: 1.5rem; }
.report__name { font: 700 clamp(2rem, 5vw, 2.8rem)/1 var(--f-display); margin: 0 0 0.6rem; }
.specs { display: flex; flex-wrap: wrap; gap: 0.3rem 1.75rem; margin: 0; }
.specs div { display: flex; gap: 0.4rem; }
.specs dt { color: var(--ink-soft); }
.specs dt::after { content: ":"; }
.specs dd { margin: 0; font-weight: 700; }

/* toolbar: when it was checked, and what you can do with it */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; margin: 0 0 1.5rem; }
.toolbar__stamp { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.toolbar__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tool { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.6rem; padding: 0 0.9rem; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 0.92rem; text-decoration: none; cursor: pointer; }
.tool:hover { border-color: var(--ink-soft); }
.tool svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.tool.is-done { border-color: var(--route); color: var(--route-dark); background: var(--route-tint); }

/* the headline answer */
.status { border-radius: var(--r); padding: 1.4rem 1.5rem 0.4rem; margin-bottom: 0.75rem; color: #fff; background: var(--route); }
.status__head { font: 700 clamp(1.8rem, 4.5vw, 2.6rem)/1.05 var(--f-display); margin: 0 0 0.5rem; }
.status__sub { font-size: 1.05rem; max-width: 46rem; opacity: 0.95; }
.status--warn { background: var(--warn); }
.status--bad { background: var(--fail); }
.status--neutral { background: var(--ink-soft); }

/* three supporting checks */
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.check { background: var(--surface); border-top: 5px solid var(--rule); border-radius: 0 0 var(--r) var(--r); padding: 0.95rem 1.1rem 0.4rem; }
.check h2 { font: 700 1.3rem/1.15 var(--f-display); margin: 0 0 0.4rem; }
.check p { font-size: 0.95rem; color: var(--ink-soft); }
.check--ok { border-top-color: var(--route); }
.check--ok h2 { color: var(--route-dark); }
.check--warn { border-top-color: var(--warn); }
.check--warn h2 { color: var(--warn); }
.check--bad { border-top-color: var(--fail); }
.check--bad h2 { color: var(--fail); }
.check--neutral { border-top-color: var(--ink-soft); }

/* blocks */
.block { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 1.5rem 1.5rem 1rem; margin-bottom: 1.5rem; }
.block--quiet { background: transparent; }
.block__title { font: 700 1.6rem/1.15 var(--f-display); margin: 0 0 0.9rem; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.block__count { font: 400 1rem/1 var(--f-text); color: var(--ink-soft); }
.block__intro { color: var(--ink-soft); margin-top: -0.25rem; }
.block__note { font-size: 0.95rem; color: var(--ink-soft); display: flex; align-items: center; gap: 0.5rem; }

/* worth a closer look */
.flaglist { list-style: none; margin: 0; padding: 0; }
.flag { position: relative; padding: 0.9rem 0 0.4rem 1.1rem; border-top: 1px solid var(--rule); }
.flag::before { content: ""; position: absolute; left: 0; top: 1.05rem; bottom: 0.9rem; width: 4px; border-radius: 2px; background: var(--info); }
.flag--bad::before { background: var(--fail); }
.flag--warn::before { background: var(--warn); }
.flag__title { font: 700 1.2rem/1.25 var(--f-display); margin: 0 0 0.35rem; }
.flag p { color: var(--ink-soft); font-size: 0.97rem; max-width: 46rem; }
.flags--clear { border-left: 5px solid var(--route); }
.flags--clear .block__title { color: var(--route-dark); }
.flags--clear p { color: var(--ink-soft); max-width: 46rem; }

/* mileage */
.figures { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 0 0 1.25rem; }
.figures div { display: flex; flex-direction: column; }
.figures dt { font-size: 0.9rem; color: var(--ink-soft); order: 0; }
.figures dd { margin: 0; font: 700 1.9rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; order: 1; }
.figures dd.figures__note { font: 400 0.88rem/1.4 var(--f-text); color: var(--ink-soft); order: 2; }

.mchart { width: 100%; max-width: 44rem; margin: 0 0 0.5rem; }
.mchart__grid { stroke: var(--rule); stroke-width: 1; }
.mchart__axis { fill: var(--ink-soft); font: 400 12px var(--f-text); }
.mchart__line { fill: none; stroke: var(--route); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.mchart__dot { fill: var(--surface); stroke: var(--route-dark); stroke-width: 2.5; }
.mchart__dot--drop { fill: var(--fail); stroke: var(--fail); }
.dot { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.dot--drop { background: var(--fail); }

.more { margin: 0.5rem 0 0.75rem; }
.more > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; font-weight: 700; color: var(--route-dark); list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: ""; width: 0.55rem; height: 0.55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.more[open] > summary::before { transform: rotate(45deg); }
.more > summary:hover { text-decoration: underline; }

.mtable { border-collapse: collapse; margin-top: 0.5rem; font-variant-numeric: tabular-nums; min-width: 16rem; }
.mtable th, .mtable td { text-align: left; padding: 0.45rem 1.5rem 0.45rem 0; border-bottom: 1px solid var(--rule); }
.mtable th { font-size: 0.9rem; color: var(--ink-soft); }
.mtable td:last-child, .mtable th:last-child { text-align: right; padding-right: 0; }
.mtable tr.is-drop td { color: var(--fail); font-weight: 700; }
.tag--drop { font-size: 0.75rem; background: var(--fail-tint); color: var(--fail); padding: 0.15em 0.45em; border-radius: 3px; margin-left: 0.35rem; }

/* test history */
.tests { list-style: none; margin: 0; padding: 0; }
.test { border-left: 5px solid var(--route); padding: 0.9rem 0 0.9rem 1.1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.tests > .test:last-child { border-bottom: 0; }
.test--fail { border-left-color: var(--fail); }
.test__top { display: flex; align-items: baseline; gap: 1rem; }
.test__date { font: 700 1.3rem/1.1 var(--f-display); margin: 0; }
.test__result { margin: 0; font-weight: 700; color: var(--route-dark); }
.test--fail .test__result { color: var(--fail); }
.test__facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0.45rem 0 0.6rem; font-size: 0.95rem; }
.test__facts div { display: flex; gap: 0.35rem; }
.test__facts dt { color: var(--ink-soft); }
.test__facts dt::after { content: ":"; }
.test__facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.test__num { color: var(--ink-soft); }
.test__clean { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

.defects { list-style: none; margin: 0; padding: 0; }
.defects li { padding: 0.35rem 0; font-size: 0.97rem; display: flex; gap: 0.65rem; align-items: baseline; }
.defects .sev { flex: 0 0 auto; min-width: 5.4rem; text-align: center; }
.defect__ref { color: var(--ink-soft); font-size: 0.82rem; white-space: nowrap; }

.again { padding: 1rem 0 3.5rem; }

/* states: not live, not found, errors */
.state { padding: 3rem 0 4rem; max-width: 44rem; }
.state__title { font: 700 clamp(2rem, 5vw, 2.8rem)/1.05 var(--f-display); margin: 0 0 1rem; }
.state .plate-form { margin-top: 2rem; }
.suggest { font-size: 1.1rem; }
.suggest__link { display: inline-block; background: var(--plate); border: 2px solid var(--ink); border-radius: 4px; padding: 0.1rem 0.5rem; color: var(--ink); text-decoration: none; font: 700 1.3rem/1.2 var(--f-display); letter-spacing: 0.06em; }
.suggest__link:hover { outline: 3px solid var(--band); outline-offset: 2px; }

/* plain content pages */
.page { padding: 3rem 0 4rem; }
.page h1 { font: 700 clamp(2.2rem, 5vw, 3rem)/1.05 var(--f-display); margin: 0 0 1.25rem; }
.page h2 { font: 700 1.6rem/1.2 var(--f-display); margin: 2.25rem 0 0.75rem; }
.page ul { padding-left: 1.2rem; }
.page li { margin-bottom: 0.5rem; }
.page .updated { color: var(--ink-soft); font-size: 0.95rem; }

/* ----------------------------------------------------------------- footer */

.site-foot { background: var(--route-dark); color: #E6F0EA; }
.site-foot a { color: #fff; }
.site-foot__in { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2.5rem; padding-top: 3rem; padding-bottom: 2rem; }
.site-foot__brand { font: 700 1.5rem/1 var(--f-display); color: #fff; }
.site-foot__about p { max-width: 40rem; font-size: 0.95rem; }
.site-foot__nav { display: flex; flex-direction: column; gap: 0.35rem; }
.site-foot__nav a { text-decoration: none; font-weight: 700; padding: 0.2rem 0; }
.site-foot__nav a:hover { text-decoration: underline; }
.site-foot__base { border-top: 1px solid rgba(255, 255, 255, 0.18); padding-top: 1.1rem; padding-bottom: 1.5rem; font-size: 0.9rem; }
.site-foot__base p { margin: 0; }

/* ----------------------------------------------------------------- mobile */

@media (max-width: 56rem) {
  .checks { grid-template-columns: 1fr; gap: 0.75rem; }
}

@media (max-width: 40rem) {
  .site-head__in { flex-wrap: nowrap; min-height: 3.5rem; }
  .site-nav:has(.site-nav__cta) a:not(.site-nav__cta) { display: none; }
  .report { padding-top: 1.25rem; }
  .report__head { gap: 0.9rem; margin-bottom: 1rem; }
  .report__name { font-size: 1.9rem; margin-bottom: 0.35rem; }
  .specs { gap: 0.1rem 1rem; font-size: 0.95rem; }
  .plate--static { height: 3.25rem; }
  .plate--static .plate__text { font-size: 1.85rem; }
  .toolbar__stamp { order: 2; width: 100%; font-size: 0.85rem; }
  .wrap { padding: 0 1rem; }
  .hero { padding: 2rem 0 2rem; }
  .plate { width: 100%; height: 4.25rem; }
  .plate__input { font-size: 2.35rem; }
  .btn--go { width: 100%; min-height: 3.6rem; }
  .shows { grid-template-columns: 1fr; }
  .levels > div { grid-template-columns: 1fr; gap: 0.4rem; }
  .site-foot__in { grid-template-columns: 1fr; }
  .block { padding: 1.2rem 1rem 0.75rem; }
  .status { padding: 1.15rem 1.1rem 0.25rem; }
  .defects li { flex-direction: column; gap: 0.3rem; }
  .defects .sev { min-width: 0; }
  .plate--static { min-width: 0; width: 100%; }
  .toolbar__actions { width: 100%; }
  .tool { flex: 1 1 auto; justify-content: center; }
  .figures { gap: 1rem 1.75rem; }
  .figures dd { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ------------------------------------------------------------------ print */

@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 10.5pt; }
  .site-head nav, .toolbar__actions, .again, .site-foot__nav, .skip, .plate-form, .more > summary { display: none !important; }
  .site-head, .site-foot { background: #fff; color: #000; border: 0; }
  .site-foot a { color: #000; }
  .site-foot__in { display: block; padding: 0; }
  .status, .status--warn, .status--bad, .status--neutral { background: #fff; color: #000; border: 3px solid #000; }
  .block, .check { break-inside: avoid; border-color: #999; }
  .test { break-inside: avoid; }
  .checks { grid-template-columns: repeat(3, 1fr); }
  .report { padding-top: 0; }
  .toolbar { border-color: #999; }
  a { color: #000; text-decoration: none; }
}
