/* Vehicle Cost Tools — Trust Forward design system */

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

:root {
  --ink:          #0f172a;
  --ink-mid:      #334155;
  --ink-soft:     #64748b;
  --ink-faint:    #94a3b8;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;
  --accent:       #1e40af;
  --accent-hover: #1e3a8a;
  --accent-light: #eff6ff;
  --accent-mid:   #dbeafe;
  --accent-glow:  rgba(30,64,175,0.08);
  --green:        #15803d;
  --radius:       13px;
  --radius-sm:    9px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.05);
  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --max-w:        720px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--surface-2);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ─────────────────────────────────────────────── */
header {
  background: var(--ink);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-icon {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.brand-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.brand-name span { color: #93c5fd; }
.nav-tag {
  font-size: 0.6875rem; font-weight: 600;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Legacy header h1 support (kept for safety) */
header h1 { font-size: 1rem; color: #fff; }
header h1 a { color: inherit; text-decoration: none; }

/* ─── Layout ──────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 20px 16px; }

/* ─── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.8125rem;
  margin-bottom: 18px;
  color: var(--ink-faint);
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ─── Hero / Intro ────────────────────────────────────────── */
.intro, .hero { margin-bottom: 24px; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.6875rem; font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.07em; text-transform: uppercase;
  margin-bottom: 10px;
}
.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: block;
}

.intro h2, .hero h2 {
  font-size: clamp(1.4rem, 5vw, 1.875rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 8px;
}
.intro p, .hero p { color: var(--ink-soft); font-size: 0.9375rem; max-width: 520px; }

/* ─── Trust badges ────────────────────────────────────────── */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}
.trust-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 500;
  color: var(--ink-soft);
}
.trust-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

/* ─── Tool grid ───────────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 560px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.12s;
  border-radius: 0;
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.tool-card:hover::before { background: var(--accent); }

.tool-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  background: var(--accent-light);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.tool-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.tool-card p {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 14px;
}
.card h2 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.card p { color: var(--ink-soft); font-size: 0.875rem; }
.secondary-card { box-shadow: none; }
.prose h2:not(:first-child) { margin-top: 20px; }
.prose ul { margin: 8px 0 0 20px; color: var(--ink-soft); font-size: 0.875rem; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--accent); }
.site-purpose { margin-top: 20px; }

/* Calculator card — structured with header strip */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.calc-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; gap: 10px;
}
.calc-card-header .icon { font-size: 1rem; }
.calc-card-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}
.calc-card-body { padding: 20px; }

/* Also keep .primary-card for back-compat */
.primary-card { border-top: 3px solid var(--accent); }

/* ─── Forms ───────────────────────────────────────────────── */
label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ink-mid);
}
select,
input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}
.form-group { margin-bottom: 16px; }
.helper { font-size: 0.75rem; margin-top: 5px; color: var(--ink-faint); line-height: 1.4; }
.check-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; margin-bottom: 16px; cursor: pointer;
}
.check-row input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 48px;
  transition: background 0.12s, box-shadow 0.12s;
  letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(30,64,175,0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 3px 8px rgba(30,64,175,0.3);
}
.btn-block { width: 100%; }

/* ─── Result box (hybrid: blue gradient, not dark) ────────── */
.result-box {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-mid) 100%);
  border: 1px solid rgba(30,64,175,0.14);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-top: 16px;
  text-align: center;
  display: none;
}
.result-box.visible { display: block; }
.result-value {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
}
.result-label {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 6px;
  font-weight: 500;
}
.result-breakdown {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 14px;
  text-align: left;
  background: rgba(255,255,255,0.65);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.result-breakdown div {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}
.result-breakdown div:not(:last-child) {
  border-bottom: 1px solid rgba(30,64,175,0.08);
}
.result-breakdown strong { color: var(--ink); }

/* ─── Source / notes ──────────────────────────────────────── */
.source-link { display: block; font-size: 0.75rem; margin-top: 8px; word-break: break-all; }
.source-link a { color: var(--accent); }
.source-note {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 1.6;
}
.source-note a { color: var(--accent); }

/* ─── Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 28px 16px;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--border);
  margin-top: 32px;
}
footer a { color: var(--ink-soft); text-decoration: none; margin: 0 6px; }
footer a:hover { color: var(--accent); }
.footer-brand { font-weight: 600; color: var(--ink-mid); margin-bottom: 6px; font-size: 0.875rem; }

/* ─── Ad container ────────────────────────────────────────── */
.ad-container {
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 16px 0;
}

/* ─── Consent banner ──────────────────────────────────────── */
.consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
  z-index: 100; padding: 20px;
}
.consent-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px;
}
.consent-inner h2 { font-size: 1rem; margin-bottom: 4px; color: var(--ink); }
.consent-inner p { font-size: 0.8125rem; color: var(--ink-soft); }
.consent-inner a { color: var(--accent); }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.consent-actions .btn { flex: 1 1 auto; min-width: 160px; }
.consent-essential { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
.consent-essential:hover { background: var(--border); }
.privacy-settings {
  background: none; border: none;
  color: var(--accent); cursor: pointer;
  font-size: 0.8125rem; text-decoration: underline; padding: 0;
}
.privacy-settings:hover { color: var(--accent-hover); }
@media (min-width: 560px) {
  .consent-inner { flex-direction: row; align-items: center; }
  .consent-inner > div { flex: 1; }
  .consent-actions { flex: 0 0 auto; }
}

/* ─── Narrow viewport ─────────────────────────────────────── */
@media (max-width: 359px) {
  .card, .calc-card-body { padding: 16px; }
  .result-value { font-size: 2.25rem; }
}
