:root {
  --motorway: #1c5aa6;
  --motorway-deep: #154a8c;
  --plate: #ffd307;
  --plate-band: #1b3f94;
  --ink: #1f2328;
  --muted: #5b636d;
  --line: #dde2e8;
  --tarmac: #eef1f4;
  --paper: #ffffff;
  --link: #1c5aa6;

  --pass: #0b7a3e;
  --pass-bg: #e3f4ea;
  --on-pass: #ffffff;
  --fail: #c8102e;
  --fail-bg: #fde7ea;
  --on-fail: #ffffff;
  --warn: #b27600;
  --warn-bg: #fff3d1;

  --advice: #6f4700;
  --advice-bg: #fff0c2;
  --minor: #8a3b00;
  --minor-bg: #ffe4cf;
  --major: #9b1020;
  --major-bg: #fddde1;
  --dangerous: #ffffff;
  --dangerous-bg: #9b1020;
  --prs: #1c4d8c;
  --prs-bg: #e1eaf8;

  --star: #d99a00;

  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --motorway: #174a8a;
    --motorway-deep: #123c70;
    --ink: #e8ebef;
    --muted: #a3acb7;
    --line: #2c333b;
    --tarmac: #0f1318;
    --paper: #171c22;
    --link: #8fb7ff;

    --pass: #4cc38a;
    --pass-bg: #10291d;
    --on-pass: #04170c;
    --fail: #ff6b7d;
    --fail-bg: #35141a;
    --on-fail: #2a050b;
    --warn: #f2c14e;
    --warn-bg: #332709;

    --advice: #ffd47a;
    --advice-bg: #3a2c0a;
    --minor: #ffb27a;
    --minor-bg: #3b220f;
    --major: #ff8a97;
    --major-bg: #3d1419;
    --dangerous: #2a050b;
    --dangerous-bg: #ff8a97;
    --prs: #9cc0ff;
    --prs-bg: #14264a;

    --star: #f2c14e;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 400 1rem/1.55 var(--font);
  color: var(--ink);
  background: var(--tarmac);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--plate);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Hero: the number plate ---------- */

.band {
  position: relative;
  background: var(--motorway);
  color: #fff;
}

.band-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 16px 36px;
}

.band-title {
  margin: 0 0 22px;
  font: 600 clamp(1.7rem, 3.4vw, 2.2rem)/1.1 var(--font-display);
  letter-spacing: 0.01em;
}

.lookup {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
}

.plate {
  flex: 1 1 380px;
  min-width: 0;
  max-width: 580px;
  padding: 5px;
  border-radius: 12px;
  background: var(--plate);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 14px 30px rgba(0, 0, 0, 0.3);
}

.plate:focus-within {
  box-shadow: 0 0 0 4px #fff, 0 14px 30px rgba(0, 0, 0, 0.3);
}

.plate-face {
  display: flex;
  height: 100%;
  border: 2px solid #000;
  border-radius: 8px;
  overflow: hidden;
}

.plate-band {
  flex: none;
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--plate-band);
  color: #fff;
  font: 700 1.2rem/1 var(--font-display);
}

.plate-input {
  flex: 1;
  /* An input's default width (~20 characters at this size) would otherwise set the plate's
     minimum width and push it off narrow screens. */
  width: 0;
  min-width: 0;
  padding: 12px 10px 8px;
  border: 0;
  background: transparent;
  color: #000;
  font: 700 clamp(2.7rem, 8vw, 4.4rem)/1 var(--font-display);
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
}

.plate-input::placeholder {
  color: rgba(0, 0, 0, 0.22);
}

.plate-input:focus {
  outline: none;
}

.check-btn {
  min-height: 64px;
  padding: 0 28px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--motorway-deep);
  font: 600 1.3rem/1 var(--font-display);
  letter-spacing: 0.01em;
  cursor: pointer;
}

.check-btn:hover {
  background: #eaf1fb;
}

.check-btn:disabled {
  cursor: progress;
  opacity: 0.8;
}

.band-hint {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.85);
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  overflow: hidden;
}

.progress::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 35%;
  background: var(--plate);
  animation: slide 1.1s ease-in-out infinite;
}

@keyframes slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(290%); }
}

@media (max-width: 560px) {
  .band-inner { padding-top: 28px; }
  .plate { flex-basis: 100%; }
  .check-btn { flex: 1; min-height: 56px; }
  .plate-band { width: 46px; font-size: 1rem; }
}

/* ---------- Page body ---------- */

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 16px 72px;
}

.intro {
  max-width: 62ch;
}

.intro p {
  margin: 0 0 14px;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.mini-plate {
  padding: 5px 12px 3px;
  border: 2px solid #000;
  border-radius: 6px;
  background: var(--plate);
  color: #000;
  font: 700 1.2rem/1 var(--font-display);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.mini-plate:hover {
  filter: brightness(1.04);
}

.notice {
  max-width: 62ch;
  padding: 16px 18px;
  border-left: 5px solid var(--motorway);
  border-radius: 8px;
  background: var(--paper);
}

.notice strong {
  display: block;
  font: 600 1.3rem/1.2 var(--font-display);
}

.notice p {
  margin: 6px 0 0;
}

.notice-error {
  border-left-color: var(--fail);
}

.notice-action {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

/* ---------- Report ---------- */

.report {
  padding: clamp(18px, 4vw, 40px);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  animation: arrive 0.35s ease-out both;
}

/* Focus is moved here for screen readers after a lookup; it is not interactive. */
.report:focus {
  outline: none;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .report { animation: none; }
  .progress::after { animation-duration: 3s; }
}

.report > * + * {
  margin-top: 40px;
}

.block-title {
  margin: 0 0 12px;
  font: 600 1.5rem/1.2 var(--font-display);
  letter-spacing: 0.005em;
}

.muted {
  color: var(--muted);
}

.note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 40px 48px;
}

.pair > :only-child {
  max-width: 440px;
}

/* Vehicle identity */

.vehicle {
  display: flex;
  gap: 20px;
  align-items: center;
}

.brand {
  flex: none;
  width: 76px;
  height: 76px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
  object-fit: contain;
}

.plate-chip {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 12px 2px;
  border: 2px solid #000;
  border-radius: 6px;
  background: var(--plate);
  color: #000;
  font: 700 1.35rem/1 var(--font-display);
  letter-spacing: 0.07em;
}

.vehicle-name {
  margin: 0;
  font: 700 clamp(1.7rem, 4vw, 2.4rem)/1.05 var(--font-display);
  letter-spacing: 0.01em;
}

.vehicle-summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Tax and MOT status */

.status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.status-item {
  padding: 14px 16px;
  border-left: 5px solid var(--pass);
  border-radius: 8px;
  background: var(--pass-bg);
}

.status-item.is-bad {
  border-left-color: var(--fail);
  background: var(--fail-bg);
}

.status-item.is-warn {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.status-item strong {
  display: block;
  font: 600 1.35rem/1.15 var(--font-display);
}

.status-item span {
  color: var(--muted);
}

/* Label/value tables */

.kv {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.kv th {
  width: 52%;
  padding: 9px 14px 9px 0;
  color: var(--muted);
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}

.kv td {
  padding: 9px 0;
  font-weight: 500;
}

.kv tr + tr > * {
  border-top: 1px solid var(--line);
}

/* MOT history: a timeline, newest first */

.mot-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mot-test {
  position: relative;
  padding: 0 0 26px 30px;
}

.mot-test::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: -4px;
  width: 2px;
  background: var(--line);
}

.mot-test:last-child {
  padding-bottom: 0;
}

.mot-test:last-child::before {
  display: none;
}

.mot-test::after {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pass);
  box-shadow: 0 0 0 3px var(--paper);
}

.mot-test.is-fail::after {
  background: var(--fail);
}

.mot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.result-badge {
  padding: 4px 8px 3px;
  border-radius: 5px;
  background: var(--pass);
  color: var(--on-pass);
  font: 700 0.95rem/1 var(--font-display);
  letter-spacing: 0.03em;
}

.is-fail .result-badge {
  background: var(--fail);
  color: var(--on-fail);
}

.mot-date {
  font: 600 1.2rem/1.2 var(--font-display);
}

.mot-meta {
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.mot-items {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.mot-items li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.sev {
  flex: none;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  background: var(--advice-bg);
  color: var(--advice);
}

.sev-minor { background: var(--minor-bg); color: var(--minor); }
.sev-major,
.sev-fail,
.sev-other { background: var(--major-bg); color: var(--major); }
.sev-dangerous { background: var(--dangerous-bg); color: var(--dangerous); }
.sev-pass_with_rectification,
.sev-prs { background: var(--prs-bg); color: var(--prs); }

.mot-clean {
  margin: 6px 0 0;
  color: var(--muted);
}

/* Data tables (mileage) */

.data {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.data th,
.data td {
  padding: 9px 12px 9px 0;
  text-align: left;
}

.data thead th {
  color: var(--muted);
  font-weight: 500;
  border-bottom: 2px solid var(--line);
}

.data tbody tr + tr td {
  border-top: 1px solid var(--line);
}

.data .num {
  text-align: right;
}

.drop {
  color: var(--fail);
  font-weight: 600;
}

/* Adverts */

.adverts {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.advert p {
  margin: 0 0 10px;
}

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: var(--line);
  object-fit: cover;
}

/* Safety */

.stars {
  margin: 0 0 6px;
  color: var(--star);
  font-size: 1.7rem;
  letter-spacing: 3px;
  line-height: 1;
}

.stars .off {
  color: var(--line);
}

/* Premium-only list and source line */

.locked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.locked-list li {
  padding: 5px 10px;
  border: 1px dashed var(--muted);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.source {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
