:root {
  color-scheme: light;
  --ink: #121b27;
  --ink-soft: #566171;
  --paper: #f8f5f2;
  --surface: #ffffff;
  --surface-2: #f0ebe5;
  --line: #ddd5cc;
  --orange: #e46c1a;
  --orange-dark: #b94f0c;
  --orange-soft: #fde4d2;
  --navy: #101723;
  --green: #267a4b;
  --green-soft: #def2e6;
  --red: #b9362f;
  --red-soft: #f9dfdd;
  --amber: #9a6400;
  --amber-soft: #fff0ca;
  --shadow: 0 22px 60px rgb(24 31 41 / 10%);
  --radius: 22px;
  --max: 1120px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f7f2eb;
  --ink-soft: #aeb7c5;
  --paper: #0b111b;
  --surface: #121b28;
  --surface-2: #192433;
  --line: #2d3948;
  --orange: #f47624;
  --orange-dark: #ff9a55;
  --orange-soft: #3c2418;
  --navy: #070c13;
  --green: #68cc91;
  --green-soft: #173628;
  --red: #ff817b;
  --red-soft: #3b2022;
  --amber: #f2bd51;
  --amber-soft: #3e321c;
  --shadow: 0 22px 60px rgb(0 0 0 / 30%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgb(228 108 26 / 11%), transparent 24rem),
    var(--paper);
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.site-header {
  width: min(calc(100% - 32px), var(--max));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  display: block;
}

.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 1.18rem; letter-spacing: -0.02em; }
.brand small { color: var(--ink-soft); font-size: 0.72rem; letter-spacing: 0.03em; }

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}

.site-nav { display: flex; align-items: center; gap: 16px; }
.site-nav > button:not(.icon-button), footer button {
  padding: 8px 0;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}
.site-nav > button:not(.icon-button):hover, footer button:hover { color: var(--orange-dark); }

main {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.screen { display: none; }
.screen.is-active { display: block; animation: enter 260ms ease both; }

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

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(24px, 6vw, 84px);
  padding: 54px clamp(24px, 5vw, 64px);
  border-radius: 34px;
  color: #fff;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 4%) 0 45%, transparent 45%),
    var(--navy);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  width: 420px;
  height: 420px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  position: absolute;
  right: -100px;
  bottom: -250px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--orange);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.app-heading h1 {
  margin: 0;
  max-width: 750px;
  font-size: clamp(2.45rem, 7vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero h1 { max-width: 650px; }
.hero-lede {
  max-width: 610px;
  margin: 25px 0 0;
  color: #cbd3dd;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.hero-actions, .foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, select:focus-visible, .choice-card:has(input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--orange) 45%, transparent);
  outline-offset: 2px;
}

.button-primary {
  color: #fff;
  background: var(--orange);
  box-shadow: 0 10px 26px rgb(228 108 26 / 28%);
}
.button-primary:hover { background: var(--orange-dark); }
.button-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.button-secondary {
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.hero .button-secondary {
  color: #fff;
  background: transparent;
  border-color: #465365;
}

.hero-art { display: grid; place-items: center; position: relative; z-index: 1; }
.hero-art img {
  width: min(100%, 440px);
  display: block;
  border-radius: 28px;
  box-shadow: 0 34px 80px rgb(0 0 0 / 35%);
  transform: rotate(2deg);
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0;
}

.trust-row article, .card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.trust-row article { padding: 28px; }
.trust-number { color: var(--orange); font-size: 0.75rem; font-weight: 900; }
.trust-row h2 { margin: 18px 0 8px; font-size: 1.05rem; }
.trust-row p, .notice, .card p { color: var(--ink-soft); line-height: 1.55; }
.trust-row p { margin: 0; font-size: 0.92rem; }

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 70px;
  padding: 18px 22px;
  border-left: 4px solid var(--orange);
  background: var(--orange-soft);
}
.notice strong { color: var(--ink); }

.app-screen { max-width: 940px; margin: 0 auto; padding: 40px 0 84px; }
.app-heading { margin-bottom: 38px; }
.app-heading h1 { font-size: clamp(2.3rem, 6vw, 4.5rem); }
.app-heading > p:last-child { max-width: 650px; color: var(--ink-soft); line-height: 1.6; }

.back-link, .text-button {
  padding: 0;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}
.back-link { margin-bottom: 36px; }
.text-button { color: var(--orange-dark); }

.lookup-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 18px; }
.card { padding: clamp(22px, 4vw, 34px); }
.card-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 26px; }
.card-heading h2, .result-notes h2 { margin: 0; font-size: 1.2rem; }
.card-heading p { margin: 4px 0 0; font-size: 0.86rem; }

.method-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--orange-dark);
  background: var(--orange-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

label { color: var(--ink); font-weight: 750; font-size: 0.86rem; }
label > span { float: right; color: var(--ink-soft); font-weight: 500; }
input, select {
  width: 100%;
  min-height: 49px;
  margin-top: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--paper);
}
input::placeholder { color: color-mix(in srgb, var(--ink-soft) 65%, transparent); }

.inline-control { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.inline-control .button { align-self: end; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.field-message { min-height: 1.4em; margin: 12px 0 0; font-size: 0.84rem; }
.field-message.is-error, .form-error { color: var(--red); }

.vehicle-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 22px 26px;
  border: 1px solid color-mix(in srgb, var(--green) 38%, var(--line));
  border-radius: var(--radius);
  background: var(--green-soft);
}
.vehicle-summary h2 { margin: 4px 0; font-size: 1.2rem; }
.vehicle-summary p { margin: 0; color: var(--ink-soft); }
.data-source { color: var(--green); font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; }

.guide-card { margin-top: 18px; }
.guide-card h2, .contact-card h2, .definition-card h2 { margin: 0 0 8px; }
.guide-card > div:first-child > p:not(.eyebrow) { margin-top: 0; }
.guide-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.guide-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
}
.guide-link:hover { border-color: var(--orange); }
.guide-link.is-recommended {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 18%, transparent);
  background: var(--orange-soft);
}

.foot-actions { justify-content: flex-end; margin-top: 26px; }
.mode-selector, .field-card { margin-bottom: 18px; }
fieldset { min-width: 0; }
fieldset > legend { padding: 0 8px; font-size: 1.1rem; font-weight: 900; }

.choice-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  cursor: pointer;
}
.choice-card + .choice-card { margin-top: 10px; }
.choice-card:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.choice-card input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--orange); }
.choice-card span { float: none; display: grid; gap: 4px; color: var(--ink); }
.choice-card small { color: var(--ink-soft); font-weight: 500; line-height: 1.4; }
.choice-card b { color: var(--orange-dark); font-size: 0.73rem; text-transform: uppercase; }
.section-note { margin: 0 0 24px; font-size: 0.87rem; }
.inline-help {
  padding: 0;
  border: 0;
  color: var(--orange-dark);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 800;
  cursor: pointer;
}
.estimate-note {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  padding: 15px;
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--amber-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}
.estimate-note strong { flex: 0 0 auto; color: var(--ink); }
.estimate-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.estimate-breakdown > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
}
.estimate-breakdown span { color: var(--ink-soft); font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.estimate-breakdown strong { font-size: 1.45rem; letter-spacing: -0.03em; }
.estimate-breakdown small { color: var(--ink-soft); line-height: 1.4; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 49px;
  align-self: end;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}
.toggle-row input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--orange); }
.toggle-row span { float: none; color: var(--ink); font-weight: 750; }
.form-error { min-height: 1.4em; text-align: right; }

.result-hero {
  padding: 30px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--navy);
}
.result-hero.is-pass { background: #163526; }
.result-hero.is-fail { background: #481f20; }
.result-hero span { color: #d5dce5; font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; }
.result-hero h2 { margin: 9px 0 5px; font-size: clamp(1.7rem, 5vw, 3rem); letter-spacing: -0.04em; }
.result-hero p { margin: 0; color: #d5dce5; }

.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.result-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.result-card-header { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.result-card h3 { margin: 0; font-size: 1rem; }
.status-pill { padding: 5px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 900; text-transform: uppercase; }
.status-pill.pass { color: var(--green); background: var(--green-soft); }
.status-pill.fail { color: var(--red); background: var(--red-soft); }
.status-pill.warn { color: var(--amber); background: var(--amber-soft); }
.status-pill.unknown { color: var(--ink-soft); background: var(--surface-2); }
.result-numbers { margin: 20px 0 10px; font-size: 1.7rem; font-weight: 900; letter-spacing: -0.03em; }
.result-numbers small { color: var(--ink-soft); font-size: 0.77rem; font-weight: 600; }
.meter { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.result-card.fail .meter span { background: var(--red); }
.result-card.warn .meter span { background: var(--amber); }
.result-caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--ink-soft); font-size: 0.76rem; }
.unknown-note { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.84rem; line-height: 1.5; }
.result-notes { margin-top: 18px; }
.result-notes p { margin-bottom: 0; }

.definition-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.definition-card { min-width: 0; overflow: hidden; }
.definition-card p { margin: 0 0 18px; }
.definition-card img {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  max-height: 300px;
  border: 1px solid var(--line);
  border-radius: 13px;
  object-fit: contain;
  background: #fff;
}
.definition-wide { grid-column: 1 / -1; }
.image-pair, .ticket-images { display: grid; width: 100%; min-width: 0; gap: 10px; overflow: hidden; }
.image-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ticket-images { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ticket-images img { aspect-ratio: 1.5; object-fit: cover; }
.contact-card { display: flex; align-items: flex-start; gap: 18px; }
.contact-card p { margin: 0 0 22px; }
.contact-card .button { display: inline-flex; align-items: center; text-decoration: none; }

footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 24px 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
}
footer nav { display: flex; gap: 18px; }

dialog {
  width: min(calc(100% - 32px), 510px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgb(8 12 18 / 72%); backdrop-filter: blur(5px); }
.dialog-card { padding: 34px; }
.dialog-card img { width: 76px; height: 76px; border-radius: 20px; }
.dialog-card h2 { margin: 0; font-size: 1.8rem; letter-spacing: -0.04em; }
.dialog-card p:not(.eyebrow) { color: var(--ink-soft); line-height: 1.6; }
.dialog-check { display: flex; align-items: flex-start; gap: 10px; margin: 22px 0; line-height: 1.4; }
.dialog-check input { width: 19px; min-height: 19px; margin: 1px 0 0; accent-color: var(--orange); }
.dialog-card .button { width: 100%; }

[hidden] { display: none !important; }

@media (max-width: 780px) {
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 38px 24px 28px; }
  .hero-art { order: -1; justify-content: start; }
  .hero-art img { width: 112px; border-radius: 24px; transform: none; }
  .trust-row { grid-template-columns: 1fr; }
  .notice { align-items: flex-start; flex-direction: column; }
  .lookup-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .guide-links { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .site-header { height: 76px; }
  .brand img { width: 46px; height: 46px; }
  .hero h1, .app-heading h1 { letter-spacing: -0.045em; }
  .app-screen { padding-top: 26px; }
  .form-grid, .result-grid { grid-template-columns: 1fr; }
  .inline-control { grid-template-columns: 1fr; }
  .inline-control .button { width: 100%; }
  .foot-actions .button { flex: 1 1 145px; }
  .choice-card { grid-template-columns: auto 1fr; }
  .choice-card b { display: none; }
  .vehicle-summary { align-items: flex-start; }
  .site-nav > button:not(.icon-button) { display: none; }
  .definition-grid { grid-template-columns: 1fr; }
  .definition-wide { grid-column: auto; }
  .ticket-images { grid-template-columns: 1fr; }
  .estimate-note, .contact-card { flex-direction: column; }
  .estimate-breakdown { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
