/* carprices.uk — deliberately not GOV.UK-looking: no black bar, no crown, no Transport font. */

:root {
  --ink: #1d2327;
  --ink-soft: #4b5563;
  --muted: #6b7280;
  --bg: #f6f5f1;
  --card: #ffffff;
  --line: #e3e1d9;
  --brand: #1f6f5f;
  --brand-dark: #16544a;
  --brand-soft: #e4f1ed;
  --accent: #d97706;
  --accent-soft: #fdf1dc;
  --good: #1e7f4a;
  --good-soft: #e3f4ea;
  --bad: #b42318;
  --bad-soft: #fbe9e7;
  --warn: #92400e;
  --warn-soft: #fdf1dc;
  --info-soft: #eaf1f8;
  --cta: #b45309; /* white text on this is 5.0:1, passing WCAG AA */
  --cta-dark: #92400e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 14px rgba(0, 0, 0, 0.04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.75rem; }
code { background: var(--brand-soft); padding: 0.1em 0.4em; border-radius: 4px; }
.muted { color: var(--muted); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.5rem 1rem; }
.skip:focus { left: 0; z-index: 10; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.brand-mark { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: var(--brand); color: #fff; font-size: 0.85rem; letter-spacing: 0.02em; }
.site-nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; display: inline-block; padding: 0.35rem 0; }
.site-nav a:hover { color: var(--brand-dark); text-decoration: underline; }
.unofficial { font-size: 0.8rem; color: var(--muted); padding: 0 1rem 0.5rem; }

main { padding: 1.5rem 1rem 3rem; }

/* Hero and form */
.hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); margin-bottom: 2rem; }
.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 44rem; }
.plate-form label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.plate-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.plate-input { flex: 1 1 14rem; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.55rem 0.9rem; border: 2px solid var(--ink); border-radius: 8px; background: #fff; min-width: 0; }
.plate-input:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.help { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 0.7rem 1.2rem; border-radius: 8px; border: 2px solid var(--brand); background: var(--brand); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-primary { font-size: 1.1rem; }
.btn-secondary { background: transparent; color: var(--brand-dark); }
.btn-secondary:hover { background: var(--brand-soft); color: var(--brand-dark); }
.demo-box { margin-top: 1.25rem; padding: 0.9rem 1rem; background: var(--accent-soft); border-radius: 8px; font-size: 0.95rem; }
.demo-plates { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0.5rem 0 0; }
.trust-row { display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; list-style: none; padding: 0; margin: 0.9rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }
.trust-row li::before { content: "✓"; color: var(--good); font-weight: 700; margin-right: 0.35rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0.9rem 0 0; font-weight: 600; }
.hero-links a { display: inline-block; padding: 0.2rem 0; }

/* Alerts */
.alert { padding: 0.9rem 1rem; border-radius: 8px; border-left: 5px solid; margin: 0.75rem 0 1.25rem; }
.alert p:last-child { margin-bottom: 0; }
.alert-error { background: var(--bad-soft); border-color: var(--bad); }
.alert-good { background: var(--good-soft); border-color: var(--good); }
.alert-info { background: var(--info-soft); border-color: var(--brand); }

/* Features and FAQ */
.features, .faq { margin-bottom: 2rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.feature p { margin: 0; color: var(--ink-soft); }
details { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 1rem; margin-bottom: 0.6rem; }
summary { cursor: pointer; font-weight: 600; }
details p:last-child { margin-bottom: 0.25rem; }

/* Result page */
.back { margin: 0 0 1rem; }
.vehicle-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.vehicle-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.vehicle-head h1 { font-size: 1.7rem; margin: 0; }
.plate { font-weight: 800; font-size: 1.5rem; letter-spacing: 0.1em; padding: 0.3rem 0.8rem; border-radius: 6px; background: #f3d35b; color: #111; border: 2px solid #c9ad3a; font-family: "Arial Narrow", Arial, sans-serif; }
.basics { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.6rem 1rem; margin: 0; }
.basics div { display: flex; flex-direction: column; }
.basics dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.basics dd { margin: 0; font-weight: 600; }

/* "Worth a closer look" summary under the vehicle card */
.highlights { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.25rem; margin-bottom: 1.25rem; }
.highlights h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.highlights ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.highlights a { display: inline-block; padding: 0.35rem 0.75rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.95rem; background: var(--info-soft); color: var(--brand-dark); }
.highlights .hl-bad a { background: var(--bad-soft); color: var(--bad); }
.highlights .hl-warn a { background: var(--warn-soft); color: var(--warn); }
.highlights p { margin: 0; }
.sample-banner { padding: 0.9rem 1rem; border-radius: 8px; border-left: 5px solid var(--accent); background: var(--accent-soft); margin-bottom: 1.25rem; }
.sample-banner p:last-child { margin-bottom: 0; }

.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.status { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--muted); border-radius: var(--radius); padding: 1rem 1.1rem; }
.status h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.status-label { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4rem; }
.status p:last-child { margin-bottom: 0; }
.status-note { font-size: 0.92rem; color: var(--ink-soft); }
.status-valid, .status-first-mot-due, .status-recall-good { border-top-color: var(--good); }
.status-due-soon, .status-recall-neutral { border-top-color: var(--warn); }
.status-expired, .status-recall-bad { border-top-color: var(--bad); }
.status-tax { border-top-color: var(--brand); }

/* Partner buttons */
.partners { margin-bottom: 2rem; }
.partners-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.partners-title { margin: 0; }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.partner-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.1rem 1rem; display: flex; flex-direction: column; }
.partner-card h3 { margin-top: 0.4rem; }
.partner-card p { color: var(--ink-soft); flex: 1; }
.ad-label { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); border: 1px solid var(--ink-soft); border-radius: 4px; padding: 0.05rem 0.4rem; line-height: 1.4; }
.partner-card .ad-label { position: absolute; top: 0.75rem; right: 0.75rem; }
.btn-partner { background: var(--cta); border-color: var(--cta); text-align: center; }
.btn-partner:hover { background: var(--cta-dark); border-color: var(--cta-dark); }
.partner-name { display: block; font-weight: 400; font-size: 0.85rem; opacity: 0.95; }
.partner-alt { font-size: 0.9rem; margin: 0.6rem 0 0; flex: 0; }
.partners-disclosure { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 0.9rem; }

/* Sections */
.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.mileage-summary { font-size: 1.05rem; }
.anomalies { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.6rem; }
.anomaly { padding: 0.75rem 1rem; border-radius: 8px; border-left: 5px solid; background: var(--info-soft); border-color: var(--brand); }
.anomaly-warn { background: var(--warn-soft); border-color: var(--warn); }
.anomaly-high { background: var(--bad-soft); border-color: var(--bad); }
.anomaly-type { display: block; font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.15rem; }
.chart-wrap { margin: 1rem 0; }
.mileage-chart { width: 100%; height: auto; display: block; }
.mileage-chart-compact { display: none; }
.mileage-chart.mileage-chart-compact .axis { font-size: 15px; }
.mileage-chart .grid { stroke: var(--line); stroke-width: 1; }
.mileage-chart .axis { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.mileage-chart .line { stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; }
.mileage-chart .pt { fill: var(--brand); stroke: #fff; stroke-width: 1.5; }
.mileage-chart .pt-fail { fill: var(--ink-soft); }
.mileage-chart .pt-drop { fill: var(--bad); }
.mileage-chart .pt-jump { fill: var(--accent); }
figcaption { font-size: 0.85rem; color: var(--muted); }
.legend { display: inline-block; margin-left: 0.6rem; }
.legend::before { content: ""; display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; margin-right: 0.3em; vertical-align: -0.05em; background: var(--brand); }
.legend-fail::before { background: var(--ink-soft); }
.legend-drop::before { background: var(--bad); }
.legend-jump::before { background: var(--accent); }
.readings table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin-top: 0.5rem; }
.readings th, .readings td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); }
.row-drop td { background: var(--bad-soft); }
.row-jump td, .row-suspect td { background: var(--warn-soft); }

/* Defects */
.test-meta { font-size: 1.05rem; }
.result-passed { color: var(--good); }
.result-failed { color: var(--bad); }
.defects { list-style: none; padding: 0; margin: 0; }
.defects-explained { display: grid; gap: 0.75rem; }
.defects-explained .defect { padding: 0.8rem 1rem; border-radius: 8px; background: var(--bg); border-left: 5px solid var(--muted); }
.defect-head { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.3rem; }
.defect-type { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.1rem 0.45rem; border-radius: 4px; background: var(--line); color: var(--ink-soft); }
.defect-dangerous .defect-type { background: var(--bad); color: #fff; }
.defect-major .defect-type, .defect-fail .defect-type { background: var(--bad-soft); color: var(--bad); }
.defect-minor .defect-type { background: var(--warn-soft); color: var(--warn); }
.defects-explained .defect-dangerous { border-left-color: var(--bad); }
.defects-explained .defect-major, .defects-explained .defect-fail { border-left-color: var(--bad); }
.defects-explained .defect-minor { border-left-color: var(--warn); }
.defect-text { font-weight: 600; margin-bottom: 0.3rem; }
.defect-explain { margin: 0; color: var(--ink-soft); }
.urgency { font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.urgency-now { background: var(--bad); color: #fff; }
.urgency-soon { background: var(--warn-soft); color: var(--warn); }
.urgency-monitor { background: var(--info-soft); color: var(--brand-dark); }
.urgency-info { background: var(--line); color: var(--ink-soft); }
.glossary { margin-top: 1rem; }
.glossary dl, .glossary-list, .urgency-key { margin: 0.5rem 0; }
.glossary dl div, .glossary-list div, .urgency-key div { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
.glossary dt, .glossary-list dt { font-weight: 600; }
.glossary dd, .glossary-list dd, .urgency-key dd { margin: 0; }

/* History */
.tests { list-style: none; padding: 0; margin: 0; }
.test { border-top: 1px solid var(--line); padding: 0.9rem 0; }
.test-head { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: baseline; margin-bottom: 0.4rem; }
.test-date { font-weight: 700; }
.test-result { font-weight: 700; }
.test-odo, .test-expiry, .test-source { color: var(--muted); font-size: 0.95rem; }
.test .defect { padding: 0.2rem 0; font-size: 0.95rem; }
.defect-hint { font-size: 0.88rem; }
.recurring { display: block; font-size: 0.88rem; font-weight: 600; color: var(--warn); margin-top: 0.3rem; }

.notes ul { margin: 0; padding-left: 1.2rem; }
.disclaimer { font-size: 0.9rem; color: var(--ink-soft); }
.disclaimer p { margin: 0; }

/* Prose pages */
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.75rem; max-width: 50rem; }
.prose h2 { margin-top: 1.5rem; }
.prose ul { padding-left: 1.2rem; }
.rules { list-style: none; padding: 0; margin: 0; }
.rule { border-top: 1px solid var(--line); padding: 1rem 0; }
.rule h3 { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* Guides, data pages */
.crumbs { font-size: 0.92rem; margin: 0 0 0.9rem; color: var(--ink-soft); }
.crumbs a { display: inline-block; padding: 0.2rem 0; }
.prose-wide { max-width: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.9rem; margin: 0.9rem 0 1.25rem; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; background: var(--bg); }
.stat p { margin: 0; }
.stat-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); font-weight: 600; }
.stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin: 0.2rem 0 !important; }
.stat-note { font-size: 0.9rem; color: var(--ink-soft); }
.table-scroll { overflow-x: auto; margin: 0.5rem 0 0.75rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th, .data-table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th { font-size: 0.85rem; color: var(--ink-soft); }
.data-table td:first-child { white-space: normal; }
.data-table .row-total td { font-weight: 700; }
.reason-list { padding-left: 1.4rem; }
.reason-list li { margin-bottom: 0.45rem; }
.reason-name { font-weight: 600; }
.make-list { columns: 14rem auto; column-gap: 1.5rem; padding-left: 1.2rem; }
.make-list li { break-inside: avoid; margin-bottom: 0.3rem; }
.guide-list { list-style: none; padding: 0; }
.guide-list li { border-top: 1px solid var(--line); padding: 0.9rem 0 0.2rem; }
.guide-list h2 { margin: 0 0 0.3rem !important; font-size: 1.2rem; }
.cta-box { background: var(--brand-soft); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.cta-box h2 { margin-top: 0 !important; }
.cta-box p:last-child { margin-bottom: 0; }
.cta-box .btn-primary { display: inline-block; }
.model-link { background: var(--info-soft); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1.25rem; }
.feature h3 a { color: var(--ink); }
.pass-chart { width: 100%; height: auto; display: block; }
.pass-chart .grid { stroke: var(--line); stroke-width: 1; }
.pass-chart .axis { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.pass-chart .line { stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; }
.pass-chart .line-national { stroke: var(--ink-soft); stroke-width: 2; stroke-dasharray: 5 4; }
.pass-chart .pt { fill: var(--brand); stroke: #fff; stroke-width: 1.5; }
.pass-chart-compact { display: none; }
.pass-chart.pass-chart-compact .axis { font-size: 15px; }
.legend-national::before { background: var(--ink-soft); border-radius: 0; height: 0.2em; vertical-align: 0.25em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 1.5rem 0 2rem; font-size: 0.88rem; color: var(--ink-soft); }
.footer-nav { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: 0.75rem 0; }
.copyright { color: var(--muted); margin: 0; }

/* Cookie banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: #fff; padding: 0.9rem 0; z-index: 20; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2); }
.cookie-banner a { color: #fff; }
.cookie-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-row p { margin: 0; font-size: 0.92rem; }
.cookie-actions { display: flex; gap: 0.6rem; }
.cookie-banner .btn-secondary { color: #fff; border-color: #fff; }
.cookie-banner .btn-secondary:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

@media (max-width: 600px) {
  html { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  .hero, .section, .vehicle-card, .prose { padding: 1.1rem; }
  .glossary dl div, .glossary-list div, .urgency-key div { grid-template-columns: 1fr; gap: 0.1rem; }
  .site-nav { gap: 0.2rem 1rem; }
  .site-nav a { padding: 0.6rem 0; }
  .basics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* The wide chart's labels shrink to ~5px on a phone; swap in the compact one. */
  .mileage-chart-wide { display: none; }
  .mileage-chart-compact { display: block; }
  .pass-chart-wide { display: none; }
  .pass-chart-compact { display: block; }
}
