/* App chrome follows the marketing site. The certificate sheet stays the light PDF card. */

:root {
  --bg: #070b0a;
  --bg-elevated: #0d1412;
  --bg-card: rgba(16, 25, 22, 0.72);
  --bg-card-solid: #101916;
  --bg-glass: rgba(13, 20, 18, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(16, 185, 129, 0.35);
  --ink: #f3f7f5;
  --ink-secondary: #9fb0a8;
  --ink-muted: #6c7d75;
  --accent: #10b981;
  --accent-bright: #34d399;
  --accent-dim: rgba(16, 185, 129, 0.14);
  --accent-glow: rgba(16, 185, 129, 0.25);
  --accent-ink: #04150f;
  --danger-dim: rgba(239, 68, 68, 0.1);
  --danger-ink: #fca5a5;
  --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 48px -12px rgba(16, 185, 129, 0.25);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1120px;
  --transition: 220ms cubic-bezier(0.22, 1, 0.36, 1);
  --muted: var(--ink-secondary);
  --faint: var(--ink-muted);
  --line: var(--border);
  --paper: var(--bg-card);
  --warn: var(--danger-ink);
  --warn-bg: var(--danger-dim);
  --accent-soft: var(--accent-dim);
  --accent-hover: #059669;
}

[data-theme="light"] {
  --bg: #f6f7f6;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --border: rgba(15, 28, 22, 0.08);
  --border-strong: rgba(15, 28, 22, 0.15);
  --border-accent: rgba(16, 185, 129, 0.4);
  --ink: #0f1c16;
  --ink-secondary: #485950;
  --ink-muted: #728279;
  --accent: #059669;
  --accent-bright: #10b981;
  --accent-dim: rgba(5, 150, 105, 0.1);
  --accent-glow: rgba(16, 185, 129, 0.18);
  --accent-ink: #ffffff;
  --danger-dim: rgba(220, 38, 38, 0.08);
  --danger-ink: #b91c1c;
  --shadow-lg: 0 20px 50px -15px rgba(15, 28, 22, 0.1);
  --shadow-glow: 0 0 40px -12px rgba(16, 185, 129, 0.18);
  --muted: var(--ink-secondary);
  --faint: var(--ink-muted);
  --line: var(--border);
  --paper: var(--bg-card);
  --warn: var(--danger-ink);
  --warn-bg: var(--danger-dim);
  --accent-soft: var(--accent-dim);
  --accent-hover: #047857;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  transition: background-color var(--transition), color var(--transition);
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 0.7rem;
  color: var(--ink);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

.wrap { width: min(var(--container), calc(100% - 2.5rem)); margin: 0 auto; }

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.ambient-orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.45; }
.ambient-orb--1 {
  width: 620px; height: 620px; top: -220px; right: -120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22), transparent 70%);
}
.ambient-orb--2 {
  width: 520px; height: 520px; bottom: 10%; left: -180px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.15), transparent 70%);
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 35%, transparent 100%);
  opacity: 0.45;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 70px;
  flex-wrap: nowrap;
  min-width: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name .dothealth { color: var(--accent-bright); }
.header-right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink-secondary);
  padding: 0;
  box-shadow: none;
}
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle:hover { transform: none; background: var(--accent-dim); color: var(--ink); box-shadow: none; }
.site-nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: nowrap; }
.site-nav a,
.site-nav button {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--ink-secondary);
  background: transparent;
  border: 0;
  text-decoration: none;
  transition: color var(--transition), background-color var(--transition);
}
.site-nav a:hover,
.site-nav button:hover {
  color: var(--ink);
  background: var(--accent-dim);
  text-decoration: none;
}
.site-nav form { margin: 0; display: inline; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink-secondary);
  padding: 0;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  transform: translateY(-1px);
  background: var(--bg-card);
}
.theme-toggle svg { width: 17px; height: 17px; }

main { padding: 2.25rem 0 3.5rem; }
.lede { color: var(--ink-secondary); font-size: 1.08rem; max-width: 62ch; }

.card,
.vehicle,
.cert-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1.15rem 1.25rem;
  margin: 0 0 1rem;
}
.vehicle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1.25rem;
  align-items: center;
  min-width: 0;
}
.vehicle-main { min-width: 0; }
.vehicle h2 { margin: 0; font-size: 1.25rem; }
.vehicle .meta,
.vehicle .result,
.vehicle .quiet { margin: 0.15rem 0 0; }
.vehicle .meta,
.vehicle .result,
.big,
.hero-number,
.id-value,
.stat,
code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.vehicle .meta,
.vehicle .quiet { color: var(--ink-muted); font-size: 0.86rem; }
.vehicle .result { font-size: 0.95rem; }
.vehicle .quiet { font-size: 0.86rem; }
.vehicle-action { display: flex; flex-direction: column; align-items: flex-end; gap: 0.45rem; }
.vehicle-action form { margin: 0; }
.eligibility { margin: 0; max-width: 18rem; text-align: right; font-size: 0.9rem; }

.row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.muted { color: var(--ink-secondary); }
.faint, .quiet { color: var(--ink-muted); font-size: 0.9rem; }
.disclaimer { max-width: 46rem; margin: 0 0 0.45rem; color: var(--ink-muted); }
.error { color: var(--danger-ink); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-dim);
  color: var(--accent-bright);
  border: 1px solid var(--border-accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-pill);
}
.pill.warn { background: var(--danger-dim); color: var(--danger-ink); border-color: transparent; }
.status-line { display: flex; align-items: flex-start; gap: 0.65rem; }
.spinner {
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  animation: cbh-spin 0.8s linear infinite;
}
@keyframes cbh-spin { to { transform: rotate(360deg); } }

button, .button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 28px -8px var(--accent-glow);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}
button:hover, .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -8px rgba(16, 185, 129, 0.45);
  text-decoration: none;
  color: var(--accent-ink);
}
button.secondary, a.secondary, .vehicle-action .secondary {
  background: var(--bg-card);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: none;
}
button.secondary:hover, a.secondary:hover, .vehicle-action .secondary:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--ink);
  transform: translateY(-1px);
}
.site-nav button.secondary {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--ink-secondary);
  padding: 0.45rem 0.85rem;
}
.site-nav button.secondary:hover {
  background: var(--accent-dim);
  color: var(--ink);
  transform: none;
}

form.inline { display: inline; }
label { display: block; margin: 0.85rem 0; color: var(--ink-secondary); font-size: 0.92rem; }
label.check { color: var(--ink); font-size: 0.95rem; }
input[type="text"], input[type="email"], input[type="password"] {
  display: block;
  width: 100%;
  max-width: min(24rem, 100%);
  box-sizing: border-box;
  margin-top: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--ink);
  background: var(--bg-elevated);
}
input[name="registration"] {
  text-transform: uppercase;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 0.8rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 0.92rem;
}
th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: var(--bg-elevated);
}
tr:last-child td { border-bottom: 0; }
.stat { font-variant-numeric: tabular-nums; }
code {
  font-size: 0.86em;
  color: var(--accent-bright);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.2rem 0 2.6rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
}
.site-footer p { margin: 0 0 0.4rem; }

/* Light certificate card. Colours are fixed so a dark page still matches the PDF. */
.sheet {
  position: relative;
  color: #1b241f;
  background: #fffcf7;
  border: 1px solid #ddd6cb;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 1.15rem 1.15rem 1.3rem;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.sheet::before {
  content: "";
  display: block;
  height: 0.28rem;
  margin: -1.15rem -1.15rem 1rem;
  background: #1f5e4b;
}
.sheet h2 { color: #1b241f; font-size: 1.05rem; margin: 1rem 0 0.45rem; }
.sheet a { color: #1f5e4b; }
.sheet a.button { color: var(--accent-ink); }
.sheet-top, .hero, .verify-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.sheet-top { margin-bottom: 0.8rem; padding-bottom: 0.7rem; border-bottom: 2px solid #1f5e4b; }
.lockup {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1b241f;
}
.lockup span { color: #1f5e4b; font-weight: 600; }
.kicker {
  margin: 0.2rem 0 0;
  color: #1f5e4b;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.sheet-id { text-align: right; max-width: 16rem; }
.sheet-id p { margin: 0.15rem 0; }
.id-label, .id-meta { color: #5c655f; font-size: 0.82rem; }
.id-value { font-weight: 600; color: #1b241f; }
.hero {
  align-items: center;
  background: #fffcf7;
  border-radius: 0.35rem;
  box-shadow: inset 4px 0 0 #1f5e4b;
  padding: 0.85rem 0.9rem 0.85rem 1rem;
  margin: 0.2rem 0 1rem;
}
.hero-figure { min-width: 9rem; }
.hero-number {
  margin: 0.1rem 0 0;
  color: #1b241f;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1;
  font-weight: 600;
}
.sheet-table {
  margin: 0 0 0.4rem;
  background: #fffcf7;
  border-color: #ddd6cb;
  border-radius: 8px;
}
.sheet-table th {
  background: #e3efe9;
  color: #1f5e4b;
  border-color: #ddd6cb;
}
.sheet-table td { color: #1b241f; border-color: #ddd6cb; }
.sheet-table td:nth-child(2) { font-weight: 650; }
.sheet-table td:nth-child(2),
.sheet-table td:nth-child(3) { font-family: var(--font-mono); font-size: 0.86rem; }
.verify-row { align-items: center; margin: 0.3rem 0 0.8rem; color: #1b241f; }
.qr svg { width: 7.2rem; height: auto; display: block; background: white; }
.method {
  background: #fffcf7;
  border: 1px solid #ddd6cb;
  border-left: 3px solid #1f5e4b;
  border-radius: 0.35rem;
  padding: 0.7rem 0.85rem;
  color: #1b241f;
}
.method h2 { margin-top: 0; color: #1f5e4b; font-size: 0.85rem; }
.method p { margin: 0.35rem 0 0; font-size: 0.92rem; }
.download { margin: 1rem 0 0; }
.link-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.15rem;
  margin: 0.35rem 0 0.7rem;
}

@media (max-width: 720px) {
  .site-header { position: sticky; z-index: 50; overflow: visible; }
  .site-header .wrap { height: 64px; padding: 0; position: static; }
  .brand { font-size: 1rem; }
  .header-right { gap: 12px; }
  .nav-toggle, .theme-toggle { width: 44px; height: 44px; flex-shrink: 0; }
  .nav-toggle { display: inline-flex; }
  .vehicle .result { margin-top: 0.35rem; }
  .vehicle .quiet { margin-top: 18px; }
  .vehicle .quiet a,
  .vehicle .result a,
  .link-stack a,
  .back-link a,
  .cert-row a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    vertical-align: middle;
  }
  .vehicle-action {
    align-items: stretch;
    width: 100%;
    margin-top: 18px;
    gap: 18px;
  }
  .vehicle-action .button,
  .vehicle-action button { min-height: 44px; width: 100%; }
  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    margin-top: 18px;
  }
  .actions .button,
  .actions button { min-height: 44px; width: 100%; }
  .link-stack { flex-direction: column; align-items: flex-start; gap: 16px; }
  .cert-row form { margin-top: 18px; }
  .cert-row button { min-height: 44px; }
  .back-link { margin-top: 18px; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 70;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    padding: 0.55rem 0.75rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-top: 0;
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav form,
  .site-nav form.inline {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
  }
  .site-nav a,
  .site-nav button,
  .site-nav button.secondary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0.65rem 0.9rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    color: var(--ink-secondary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    transform: none;
  }
  .site-nav a:hover,
  .site-nav button:hover,
  .site-nav button.secondary:hover {
    background: var(--accent-dim);
    color: var(--ink);
    transform: none;
    box-shadow: none;
  }
  .vehicle, .sheet-top, .hero, .verify-row { display: block; }
  .vehicle-action, .sheet-id { align-items: flex-start; text-align: left; }
  .sheet-id { margin-top: 18px; }
  button, .button { min-height: 44px; }
  .eligibility { text-align: left; }
  .sheet-table thead { display: none; }
  .sheet-table, .sheet-table tbody, .sheet-table tr, .sheet-table td { display: block; width: 100%; }
  .sheet-table tr { border-bottom: 1px solid #ddd6cb; padding: 0.35rem 0; }
  .sheet-table td { border: 0; padding: 0.05rem 0.55rem; }
  .sheet-table td::before {
    content: attr(data-label);
    display: block;
    color: #5c655f;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}
