/* ============================================================
   FinanceDesk — Design System (phase-2)
   Tokens: ink #132733 · maroon #4D1728 · blue #244D9E ·
           copper #9B4F36 (decorative only) · paper #F6F4EE ·
           ivory #FFFDF7 · mist #DCE6E6 · line #BCC4C4 ·
           peach #EFB391 (sparing) · DM Sans only
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --ink: #132733;
  --maroon: #4D1728;
  --maroon-dark: #30101C;
  --blue: #244D9E;
  --copper: #9B4F36;
  --paper: #F6F4EE;
  --ivory: #FFFDF7;
  --mist: #DCE6E6;
  --line: #BCC4C4;
  --peach: #EFB391;
  --success: #1B7A4A;
  --warning: #9A6B1A;
  --error: #C0392B;
  --body: #132733;
  --muted: #4B5B62;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --max-w: 1200px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow-sm: 0 1px 2px rgba(19, 39, 51, .08);
  --shadow-md: 0 4px 16px rgba(19, 39, 51, .10);
  --shadow-lg: 0 12px 40px rgba(19, 39, 51, .14);
  --space-1: 4px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--body);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.25rem); }
h3 { font-size: 1.2rem; }
p { margin-block: 0 1rem; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.price, .tnum, td, th { font-feature-settings: "tnum"; }
ul, ol { padding-left: 1.25rem; margin-block: 0 1rem; }
li { margin-block-end: .35rem; }

.wrap { max-width: var(--max-w); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(48px, 7vw, 88px); }
.section--alt { background: var(--mist); }
.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--maroon); margin-block-end: 12px;
}
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 60ch; }
.section-head { margin-block-end: 32px; max-width: 70ch; }
.section-head h2 { margin-block-end: 8px; }

/* ---------- Skip link ---------- */
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 12px 20px; z-index: 200; border-radius: 0 0 var(--radius-md) var(--radius-md); }
.skip:focus { left: 12px; color: #fff; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--ivory);
  border-block-end: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.25rem; }
.brand img { width: 32px; height: 32px; }
.brand span { letter-spacing: -0.01em; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-inline-start: auto;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-md);
  cursor: pointer;
}
.nav-toggle .bars { display: block; width: 20px; height: 2px; background: var(--ink); position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--ink);
}
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }
.nav { display: none; width: 100%; }
.nav.open { display: block; }
.nav ul { list-style: none; padding: 12px 0 4px; margin: 0; display: grid; gap: 4px; }
.nav a { display: block; padding: 12px 8px; color: var(--ink); font-weight: 600; text-decoration: none; border-radius: var(--radius-sm); min-height: 44px; }
.nav a:hover { background: var(--mist); }
.nav a[aria-current="page"] { color: var(--maroon); box-shadow: inset 0 -3px 0 var(--maroon); }
.header-cta { display: none; }
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .nav { display: block; width: auto; margin-inline-start: auto; }
  .nav ul { display: flex; gap: 4px; padding: 0; }
  .nav a { padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; }
  .header-cta { display: inline-flex; margin-inline-start: 8px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 24px;
  font: 700 1rem/1.2 var(--font); text-decoration: none;
  border-radius: var(--radius-md); border: 2px solid transparent; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--maroon); color: #fff; }
.btn--accent { background: var(--maroon); color: #fff; }
.btn--accent:hover { background: var(--maroon-dark); color: #fff; }
.btn--outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--light { background: #fff; color: var(--maroon); }
.btn--light:hover { background: var(--peach); color: var(--maroon-dark); }
.btn--lg { padding: 16px 32px; font-size: 1.1rem; min-height: 52px; }
.btn--block { width: 100%; }

/* ---------- Hero ---------- */
.hero { background: var(--paper); padding-block: clamp(48px, 8vw, 96px); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 60%, rgba(155, 79, 54, .10) 100%);
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 20ch; margin-block-end: 16px; }
.hero .lead { margin-block-end: 28px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-block-end: 12px; }
.hero-note { font-size: .9rem; color: var(--muted); }

/* ---------- Trust bar ---------- */
.trust-bar { background: var(--ivory); border-block: 1px solid var(--line); }
.trust-bar .wrap { display: grid; gap: 16px; padding-block: 24px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .trust-bar .wrap { grid-template-columns: repeat(3, 1fr); } }
.trust-item { display: flex; gap: 12px; align-items: flex-start; }
.trust-item .tick {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--success); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem;
}
.trust-item p { margin: 0; font-size: .95rem; }
.trust-item strong { display: block; color: var(--ink); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px;
}
.card h3 { margin-block-end: 4px; }
.card .price { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.card .price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.card ul { margin: 0; }
.card .btn { margin-block-start: auto; }

/* ---------- Pricing tables ---------- */
.pricing-grid { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 768px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.tier {
  background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; gap: 14px; position: relative;
  box-shadow: var(--shadow-sm);
}
.tier--featured {
  border: 2px solid var(--maroon); box-shadow: var(--shadow-lg); transform: none;
}
@media (min-width: 768px) { .tier--featured { transform: scale(1.03); } }
.tier-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--maroon); color: #fff; font-size: .75rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: 6px 14px; border-radius: var(--radius-full);
  white-space: nowrap;
}
.tier-name { font-size: 1.1rem; font-weight: 800; color: var(--maroon); text-transform: uppercase; letter-spacing: .04em; }
.tier .price { font-size: 2rem; font-weight: 800; color: var(--ink); }
.tier .price small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.tier ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tier li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.tier li::before { content: "✓"; color: var(--success); font-weight: 800; flex: 0 0 auto; }
.tier-note { font-size: .9rem; color: var(--muted); }
.price-notes { display: grid; gap: 8px; margin-block-start: 24px; font-size: .95rem; color: var(--muted); }
.price-notes strong { color: var(--ink); }

/* ---------- Dark CTA sections (maroon) ---------- */
.cta-band { background: var(--maroon); color: #fff; border-radius: 0; }
.cta-band h2, .cta-band p { color: #fff; }
.cta-band p.lead { color: rgba(255, 255, 255, .85); }
.cta-band .wrap { display: grid; gap: 20px; align-items: center; padding-block: clamp(48px, 7vw, 80px); }
@media (min-width: 768px) { .cta-band .wrap { grid-template-columns: 1fr auto; } }
.cta-band .btn--light { white-space: nowrap; }
.cta-band .fine { font-size: .85rem; color: rgba(255, 255, 255, .7); margin: 0; }

/* ---------- Steps (how it works) ---------- */
.steps { display: grid; gap: 16px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step {
  background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 24px; position: relative;
}
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: var(--maroon); color: #fff; font-weight: 800; margin-block-end: 12px;
}
.step h3 { margin-block-end: 8px; }
.step p { margin: 0; font-size: .95rem; color: var(--muted); }

/* ---------- FAQ accordions ---------- */
.faq { max-width: 800px; margin-inline: auto; }
.faq details {
  background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-md);
  margin-block-end: 12px; overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 700; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: 0 0 28px; width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--mist); color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--maroon); color: #fff; }
.faq .faq-body { padding: 0 20px 20px; color: var(--muted); }
.faq .faq-body p:last-child { margin-block-end: 0; }

/* ---------- State links strip ---------- */
.states { background: var(--ivory); border-block: 1px solid var(--line); }
.states .wrap { padding-block: 32px; }
.states ul {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
@media (min-width: 768px) { .states ul { grid-template-columns: repeat(4, 1fr); } }
.states a {
  display: flex; align-items: center; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper);
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.states a:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Forms ---------- */
.form-card {
  background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-md); max-width: 760px; margin-inline: auto;
}
.field { margin-block-end: 20px; }
.field label { display: block; font-weight: 700; color: var(--ink); margin-block-end: 8px; }
.field .req { color: var(--error); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 12px 14px; font: 1rem var(--font);
  border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; color: var(--body);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--error); box-shadow: 0 0 0 3px rgba(192, 57, 43, .15);
}
.field-error { display: none; color: var(--error); font-size: .9rem; margin-block-start: 6px; }
.field-error.show { display: block; }
.field-hint { font-size: .88rem; color: var(--muted); margin-block-start: 6px; }
.form-grid { display: grid; gap: 0 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
.confirmation {
  display: none; background: var(--ivory); border: 2px solid var(--success);
  border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 40px); max-width: 760px; margin-inline: auto;
  text-align: center;
}
.confirmation.show { display: block; }
.confirmation .ref {
  display: inline-block; background: var(--mist); border-radius: var(--radius-md);
  padding: 10px 20px; font-weight: 800; font-size: 1.1rem; letter-spacing: .05em; margin-block: 12px;
}

/* ---------- Next-steps list ---------- */
.next-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.next-steps li {
  background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px 20px; display: flex; gap: 12px; align-items: flex-start;
}
.next-steps li::before { content: "→"; color: var(--maroon); font-weight: 800; flex: 0 0 auto; }
.next-steps p { margin: 0; font-size: .95rem; }

/* ---------- Trust badges / checklists ---------- */
.badge-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.badge-list li {
  display: flex; gap: 10px; align-items: flex-start; font-size: .95rem;
  background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 16px;
}
.badge-list li::before { content: "✓"; color: var(--success); font-weight: 800; flex: 0 0 auto; }

/* ---------- Scope limits (warning callout) ---------- */
.callout {
  border: 1px solid var(--line); border-left: 4px solid var(--warning);
  background: var(--ivory); border-radius: var(--radius-md); padding: 18px 20px; margin-block: 20px;
}
.callout p { margin: 0; font-size: .95rem; }
.callout strong { color: var(--ink); }

/* ---------- Comparison / details tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--ivory); }
table.cmp { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 640px; }
table.cmp th, table.cmp td { padding: 12px 16px; text-align: left; border-block-end: 1px solid var(--line); vertical-align: top; }
table.cmp thead th { background: var(--maroon); color: #fff; font-weight: 700; }
table.cmp tbody tr:last-child th, table.cmp tbody tr:last-child td { border-block-end: 0; }
table.cmp .hi { background: rgba(77, 23, 40, .06); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .85); }
.site-footer .wrap { padding-block: 48px 24px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; margin-block-end: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h3 { color: #fff; font-size: 1rem; margin-block-end: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; display: inline-block; padding-block: 6px; min-height: 32px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.2rem; margin-block-end: 12px; }
.footer-brand img { width: 30px; height: 30px; }
.footer-contact p { margin-block-end: 6px; font-size: .95rem; }
.footer-bottom { border-block-start: 1px solid rgba(255, 255, 255, .15); padding-block-start: 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .85rem; color: rgba(255, 255, 255, .6); }

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta {
  position: fixed; inset-inline: 12px; bottom: 12px; z-index: 90;
  display: flex; gap: 8px;
}
.sticky-cta .btn { flex: 1; box-shadow: var(--shadow-lg); }
@media (min-width: 768px) { .sticky-cta { display: none; } }
body.has-sticky-cta { padding-block-end: 76px; }
@media (min-width: 768px) { body.has-sticky-cta { padding-block-end: 0; } }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-1 { margin-block-start: 4px; } .mt-2 { margin-block-start: 8px; }
.mt-3 { margin-block-start: 16px; } .mt-4 { margin-block-start: 24px; } .mt-5 { margin-block-start: 32px; }
.mb-0 { margin-block-end: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hero--sub { padding-block: clamp(40px, 6vw, 72px); }
.bas-line {
  background: rgba(27, 122, 74, .08); border: 1px solid rgba(27, 122, 74, .35);
  border-radius: var(--radius-md); padding: 16px 20px; font-size: .95rem;
}
.bas-line strong { color: var(--ink); }
.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;
}

/* generic inline pill badge */
.badge{display:inline-block;background:var(--mist);color:var(--ink);font-size:.78rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;padding:4px 12px;border-radius:var(--radius-full);margin-right:8px;vertical-align:middle}

/* ============================================================
   Mobile UI fixes — audit 2026-10-19 (phone "not great" report)
   Mobile-only / touch-only overrides. Desktop rules above are
   untouched.
   ============================================================ */

/* FIX 1 — Open mobile nav dropped into the header flex row instead of
   below it. .site-header .wrap is display:flex without wrapping, so the
   opened .nav (a 100%-width flex item in a nowrap row) got squeezed by
   flex-shrink into the leftover space beside the brand + hamburger,
   rendering a cramped, sometimes overflowing menu. Wrap the header and
   force the nav onto its own full-width row (hamburger range only). */
@media (max-width: 1023px) {
  .site-header .wrap { flex-wrap: wrap; }
  .nav { flex: 1 1 100%; }
}

/* FIX 2 — Images could distort on narrow screens. img/svg had
   max-width:100% but no height:auto, so any image with width/height
   attributes that got shrunk kept its attribute height and squished. */
img, svg { height: auto; }

/* FIX 3 — Footer links were 32px tall, under the 44px minimum tap
   target. Touch devices only, so mouse-driven desktop is unchanged. */
@media (hover: none) {
  .site-footer a { min-height: 44px; }
}

/* FIX 4 — Wide comparison tables scroll, but without momentum on iOS.
   .table-scroll already clips via overflow-x:auto; this restores the
   native flick-scroll feel on iPhone/iPad. */
.table-scroll { -webkit-overflow-scrolling: touch; }
