/* ==========================================================================
   Crash to Cash — Design Tokens & Base Styles
   Trust-first palette: deep navy + green "recovered value" accent.
   ========================================================================== */

:root {
  /* Color — brand */
  --navy-900: #0a1f3d;
  --navy-800: #0f2a52;
  --navy-700: #15366a;
  --navy-600: #1c4383;
  --navy-500: #2955a3;
  --navy-100: #e7edf7;
  --navy-50: #f4f7fc;

  --green-700: #0f7a3d;
  --green-600: #128a45;
  --green-500: #16a34a;
  --green-100: #e3f7ea;
  --green-50: #f0fbf4;

  --amber-600: #b45309;
  --amber-100: #fef3e0;
  --amber-50: #fffaeb;

  --red-600: #c0362c;
  --red-100: #fbe9e7;

  /* Color — neutrals */
  --ink-900: #10182b;
  --ink-700: #364157;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #eef2f7;
  --ink-50: #f7f9fc;
  --white: #ffffff;

  /* Semantic */
  --color-bg: var(--white);
  --color-bg-alt: var(--navy-50);
  --color-text: var(--ink-900);
  --color-text-muted: var(--ink-700);
  --color-text-subtle: var(--ink-500);
  --color-border: var(--ink-200);
  --color-primary: var(--navy-800);
  --color-primary-hover: var(--navy-900);
  --color-accent: var(--green-600);
  --color-accent-hover: var(--green-700);
  --color-focus: var(--navy-500);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 2.875rem;
  --fs-4xl: 3.5rem;
  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.6;

  /* Spacing scale (marketing site — spacious) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 5rem;
  --space-16: 7rem;

  /* Misc */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(10, 31, 61, 0.06), 0 1px 3px rgba(10, 31, 61, 0.08);
  --shadow-md: 0 8px 24px rgba(10, 31, 61, 0.10);
  --shadow-lg: 0 20px 48px rgba(10, 31, 61, 0.16);
  --container-max: 1180px;
  --header-h: 72px;
  --sticky-cta-h: 64px;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: light;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
input, select, textarea { font: inherit; color: inherit; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

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

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

#main, section[id] { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

.section { padding-block: var(--space-12); }
.section--tight { padding-block: var(--space-10); }
.section--alt { background: var(--color-bg-alt); }
.section--navy { background: var(--navy-900); color: var(--white); }
.section--navy .section-eyebrow { color: var(--green-500); }
.section--navy p { color: rgba(255, 255, 255, 0.78); }

.section-head { max-width: 760px; margin-bottom: var(--space-8); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

h1, .h1 { font-size: var(--fs-3xl); line-height: var(--lh-tight); font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
h2, .h2 { font-size: var(--fs-2xl); line-height: var(--lh-tight); font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
h3, .h3 { font-size: var(--fs-lg); line-height: var(--lh-snug); font-weight: 700; }
.lede { font-size: var(--fs-md); color: var(--color-text-muted); line-height: var(--lh-snug); }
.text-muted { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); font-size: var(--fs-sm); }

@media (min-width: 768px) {
  h1, .h1 { font-size: var(--fs-4xl); }
  h2, .h2 { font-size: var(--fs-3xl); }
}

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.stack { display: flex; flex-direction: column; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--fs-sm);
  border: 2px solid transparent;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--color-accent); color: var(--white); }
.btn--primary:hover { background: var(--color-accent-hover); }

.btn--secondary { background: transparent; border-color: rgba(255,255,255,0.5); color: var(--white); }
.btn--secondary:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

.btn--outline { background: transparent; border-color: var(--navy-800); color: var(--navy-800); }
.btn--outline:hover { background: var(--navy-800); color: var(--white); }

.btn--ghost { background: var(--navy-100); color: var(--navy-800); }
.btn--ghost:hover { background: var(--navy-100); box-shadow: inset 0 0 0 2px var(--navy-500); }

.btn--block { width: 100%; }
.btn--lg { min-height: 56px; padding: 0 var(--space-8); font-size: var(--fs-base); }

/* ==========================================================================
   Skip link
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 100;
  background: var(--navy-900);
  color: var(--white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--fs-sm);
  transition: top var(--transition);
}
.skip-link:focus {
  top: var(--space-4);
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }

.brand { display: flex; align-items: center; gap: var(--space-2); }
.brand svg { height: 34px; width: auto; }

.main-nav { display: none; }
.main-nav ul { display: flex; align-items: center; gap: var(--space-6); }
.main-nav a {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--navy-900); border-color: var(--color-accent); }

.header-actions { display: flex; align-items: center; gap: var(--space-3); }
.header-actions .btn { display: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--color-border);
  touch-action: manipulation;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (min-width: 960px) {
  .main-nav { display: block; }
  .header-actions .btn { display: inline-flex; }
  .nav-toggle { display: none; }
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--white);
  z-index: 49;
  padding: var(--space-6) var(--space-5);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: none;
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul { display: flex; flex-direction: column; gap: var(--space-1); }
.mobile-nav a {
  display: block;
  padding: var(--space-4) var(--space-2);
  font-size: var(--fs-md);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  min-height: 44px;
}
.mobile-nav .btn { margin-top: var(--space-6); }

@media (min-width: 960px) {
  .mobile-nav { display: none !important; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 45%, var(--navy-700) 100%);
  color: var(--white);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 60%;
  height: 140%;
  background: radial-gradient(closest-side, rgba(22, 163, 74, 0.35), transparent 70%);
  pointer-events: none;
}
.hero .container {
  position: relative;
  padding-block: var(--space-12) var(--space-10);
  display: grid;
  gap: var(--space-8);
}
.hero-copy { max-width: 640px; }
.hero-copy .eyebrow { color: var(--green-500); }
.hero-copy h1 { margin-bottom: var(--space-5); }
.hero-copy p { font-size: var(--fs-md); color: rgba(255, 255, 255, 0.82); max-width: 54ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.hero-note { margin-top: var(--space-5); font-size: var(--fs-xs); color: rgba(255,255,255,0.6); max-width: 54ch; }

@media (min-width: 1024px) {
  .hero .container { grid-template-columns: 1.1fr 0.9fr; align-items: center; padding-block: var(--space-16); }
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.card--icon .icon-badge { margin-bottom: var(--space-4); }
.card h3 { margin-bottom: var(--space-2); }
.card p { color: var(--color-text-muted); font-size: var(--fs-sm); }

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--navy-100);
  color: var(--navy-800);
}
.icon-badge--green { background: var(--green-100); color: var(--green-700); }
.icon-badge svg { width: 24px; height: 24px; }

/* Step cards (How it works) */
.step-card { position: relative; padding-top: var(--space-8); }
.step-number {
  position: absolute;
  top: var(--space-5);
  right: var(--space-6);
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--ink-200);
  line-height: 1;
}

/* ==========================================================================
   Stat / trust bar
   ========================================================================== */

.trust-bar {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .trust-bar { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .trust-bar { grid-template-columns: repeat(4, 1fr); } }

.trust-item { display: flex; flex-direction: column; gap: var(--space-2); }
.trust-item h3 { font-size: var(--fs-md); }
.trust-item p { font-size: var(--fs-sm); color: var(--color-text-muted); }

/* ==========================================================================
   Callouts / alerts
   ========================================================================== */

.callout {
  border-radius: var(--radius-md);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-3);
}
.callout p, .callout li { font-size: var(--fs-sm); }
.callout--amber { background: var(--amber-50); border-color: #f4dfae; }
.callout--amber strong { color: var(--amber-600); }
.callout--green { background: var(--green-50); border-color: #bfe8cd; }
.callout--navy { background: var(--navy-50); border-color: var(--navy-100); }
.callout svg { flex: none; width: 22px; height: 22px; margin-top: 2px; }

.fee-note {
  background: var(--navy-900);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.fee-note h3 { color: var(--white); margin-bottom: var(--space-2); }
.fee-note p { color: rgba(255,255,255,0.78); font-size: var(--fs-sm); margin-bottom: var(--space-1); }

/* ==========================================================================
   FAQ accordion
   ========================================================================== */

.accordion { border-top: 1px solid var(--color-border); }
.accordion-item { border-bottom: 1px solid var(--color-border); }
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  text-align: left;
  background: none;
  border: none;
  padding: var(--space-5) var(--space-1);
  font-size: var(--fs-md);
  font-weight: 700;
  min-height: 44px;
  color: var(--color-text);
  transition: color var(--transition);
  touch-action: manipulation;
}
.accordion-trigger:hover { color: var(--color-accent); }
.accordion-trigger .chevron { flex: none; width: 20px; height: 20px; transition: transform var(--transition); color: var(--color-accent); }
.accordion-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.accordion-panel {
  overflow: hidden;
  height: 0;
  transition: height var(--transition);
}
.accordion-panel-inner { padding: 0 var(--space-1) var(--space-5); color: var(--color-text-muted); font-size: var(--fs-sm); max-width: 68ch; }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}
@media (min-width: 640px) { .form-card { padding: var(--space-8); } }

/* Embedded Fillout form — same card treatment as .form-card, no inner
   padding so the embed's own UI fills the frame edge-to-edge. */
.fillout-embed-wrapper {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-width: 100%;
}
.fillout-embed-wrapper > div {
  max-width: 100%;
}

.field { margin-bottom: var(--space-5); }
.field label, .field legend {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-bottom: var(--space-2);
  padding: 0;
}
.field .hint { font-size: var(--fs-xs); color: var(--color-text-subtle); margin-top: var(--space-1); }
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: var(--fs-base);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field textarea { min-height: 110px; padding-block: var(--space-3); resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  border-color: var(--navy-600);
  box-shadow: 0 0 0 4px var(--navy-100);
  outline: none;
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--red-600); }
.field-error { display: none; color: var(--red-600); font-size: var(--fs-xs); margin-top: var(--space-1); font-weight: 600; }
.field.has-error .field-error { display: block; }

.row-2 { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 560px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.row-3 { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .row-3 { grid-template-columns: repeat(3, 1fr); } }

.option-grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 480px) { .option-grid { grid-template-columns: repeat(3, 1fr); } }
.option-grid--2 { grid-template-columns: 1fr; }
@media (min-width: 480px) { .option-grid--2 { grid-template-columns: repeat(2, 1fr); } }

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: border-color var(--transition), background var(--transition);
  touch-action: manipulation;
}
.option-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-card:hover { border-color: var(--ink-300); }
.option-card:has(input:checked) { border-color: var(--green-600); background: var(--green-50); }
.option-card:has(input:focus-visible) { outline: 3px solid var(--color-focus); outline-offset: 2px; }

.checkbox-row { display: flex; align-items: flex-start; gap: var(--space-3); }
.checkbox-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--green-600); }
.checkbox-row label { font-size: var(--fs-sm); font-weight: 500; }

/* Multi-step wizard */
.wizard-progress { margin-bottom: var(--space-6); }
.wizard-progress-track { height: 8px; border-radius: var(--radius-full); background: var(--ink-100); overflow: hidden; }
.wizard-progress-bar { height: 100%; background: var(--color-accent); border-radius: var(--radius-full); transition: width var(--transition); width: 14.28%; }
.wizard-progress-label { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--color-text-subtle); margin-top: var(--space-2); font-weight: 600; }

.wizard-step { display: none; }
.wizard-step.is-active { display: block; animation: fade-in 220ms ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.wizard-nav { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-6); }
.wizard-nav .btn--outline[hidden] { display: none; }

.form-success { display: none; text-align: center; padding: var(--space-8) var(--space-4); }
.form-success.is-visible { display: block; }
.form-success .icon-badge--green { width: 64px; height: 64px; margin-inline: auto; margin-bottom: var(--space-4); }
.form-success .icon-badge--green svg { width: 32px; height: 32px; }

/* ==========================================================================
   CTA band
   ========================================================================== */

.cta-band {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
}
.cta-band h2 { color: var(--white); margin-bottom: var(--space-3); }
.cta-band p { color: rgba(255,255,255,0.8); max-width: 56ch; margin-inline: auto; margin-bottom: var(--space-6); }
.cta-band .hero-ctas { justify-content: center; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--navy-900); color: rgba(255,255,255,0.72); padding-block: var(--space-10) var(--space-8); }
.footer-top { display: grid; gap: var(--space-8); margin-bottom: var(--space-8); }
.footer-brand svg { height: 30px; margin-bottom: var(--space-4); }
.footer-brand p { max-width: 40ch; font-size: var(--fs-sm); }
.footer-cols { display: grid; gap: var(--space-6); grid-template-columns: repeat(2, 1fr); }
.footer-col h4 { color: var(--white); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-3); }
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-col a { font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--white); }

@media (min-width: 768px) {
  .footer-top { grid-template-columns: 1.2fr 2fr; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}

.footer-disclaimer {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: var(--space-6);
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  color: rgba(255,255,255,0.55);
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-6);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.5);
}

/* ==========================================================================
   Sticky mobile CTA
   ========================================================================== */

.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  height: var(--sticky-cta-h);
  background: var(--white);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -8px 24px rgba(10,31,61,0.10);
  display: flex;
  align-items: center;
  padding-inline: var(--space-4);
  padding-bottom: env(safe-area-inset-bottom);
}
.sticky-cta .btn { width: 100%; }
body { padding-bottom: var(--sticky-cta-h); }

@media (min-width: 960px) {
  .sticky-cta { display: none; }
  body { padding-bottom: 0; }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.mt-0 { margin-top: 0; }
.center-text { text-align: center; }
.max-w-prose { max-width: 68ch; }
.divider { height: 1px; background: var(--color-border); border: none; margin: var(--space-8) 0; }
