/* comparemyloan — production styles. D3 "Form" system.
   Mobile-first; desktop at ≥880px. */

/* ── Self-hosted fonts (variable woff2 from Google Fonts, latin + latin-ext)
   Same-origin so font loading costs no third-party DNS/TLS and nothing
   render-blocking; unicode-range means a page downloads only the subset
   files whose characters it actually renders. second-opinion.html carries
   its own inline copy of these — keep the two in sync. ─────────────── */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/space-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/space-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #fdfdfb;
  --bg-alt: #f1f1ec;
  --card: #ffffff;
  --ink: #111314;
  --muted: rgba(17, 19, 20, 0.64);
  --dim: rgba(17, 19, 20, 0.42);
  --border: rgba(17, 19, 20, 0.14);
  --border-soft: rgba(17, 19, 20, 0.08);
  --accent: #3b50e8;
  --accent-soft: rgba(59, 80, 232, 0.07);
  --good: #177a4c;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 16px 44px -24px rgba(17, 19, 20, 0.28);
  --body: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; margin: 0; text-wrap: pretty; }
p { margin: 0; }
em { font-style: normal; color: var(--accent); }
img { max-width: 100%; }

.wrap { max-width: 1100px; margin: 0 auto; }
.wrap-narrow { max-width: 720px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); }

/* ── Type helpers ─────────────────────────────────────────────── */
.tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 8px;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sub { font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  font-family: var(--body); font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  padding: 16px 26px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #ffffff; transition: filter 0.15s, transform 0.1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-full { width: 100%; }
.btn-small { font-size: 14px; padding: 11px 18px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-ghost:hover { filter: none; background: var(--bg-alt); }

/* ── Nav ──────────────────────────────────────────────────────── */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 4px; position: relative; display: inline-block; flex: 0 0 auto; }
.logo-dot { position: absolute; right: 2.5px; top: 2.5px; width: 6px; height: 6px; background: var(--accent); border-radius: 2px; }
.logo-word { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-pill { font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 5px 11px; border-radius: 999px; }
.nav-cta { display: none; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero { padding: 18px 24px 50px; display: grid; gap: 28px; }
.hero h1 { font-size: 38px; line-height: 1.04; margin: 16px 0 0; }
.hero .sub { margin-top: 14px; max-width: 470px; }
.hero-ticks { display: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--dim); margin-top: 30px; }

/* ── Calculator ───────────────────────────────────────────────── */
.calc { padding: 22px 20px 20px; box-shadow: var(--shadow); border-color: var(--border); }
.calc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.calc-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.calc-pill { font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.calc-row { margin-bottom: 18px; }
.calc-row-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.calc-row-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.calc-row-val { font-family: var(--mono); font-size: 15px; font-weight: 600; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; margin: 0; display: block; }
.range::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--fill, 50%), var(--bg-alt) var(--fill, 50%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--accent); margin-top: -9.5px; box-shadow: 0 2px 8px rgba(0,0,0,0.18); cursor: grab; }
.range::-moz-range-track { height: 5px; border-radius: 3px; background: var(--bg-alt); }
.range::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--accent); }
.range::-moz-range-thumb { width: 19px; height: 19px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.18); cursor: grab; }

.calc-result { margin: 2px 0 16px; padding: 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid rgba(59, 80, 232, 0.2); }
.calc-save { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; color: var(--good); line-height: 1; }
.calc-save-mo { font-size: 18px; }
.calc-save-sub { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.calc-watch-h { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.calc-watch-sub { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.calc-result.is-watch { background: var(--bg-alt); border-color: var(--border-soft); }
.calc-micro { text-align: center; font-size: 12px; color: var(--dim); margin-top: 10px; }
.calc-disclaim { font-size: 10.5px; color: var(--dim); margin-top: 12px; line-height: 1.45; opacity: 0.85; }

/* ── Sections ─────────────────────────────────────────────────── */
section h2 { font-size: 30px; line-height: 1.08; margin-top: 14px; }
.steps { padding: 52px 24px; background: var(--bg-alt); }
.steps-grid { display: grid; gap: 12px; margin-top: 24px; }
.step { padding: 20px 20px 22px; }
.step-n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 10px; }
.step h3 { font-size: 20px; margin-bottom: 8px; }
.step p { font-size: 14px; line-height: 1.55; color: var(--muted); }

.alert-demo { padding: 52px 24px; }
.alert-grid { display: grid; gap: 28px; align-items: center; }
.alert-copy .sub { margin-top: 16px; max-width: 440px; }
.alert-card { padding: 20px 20px 22px; box-shadow: var(--shadow); border-color: var(--border); }
.alert-card-head { display: flex; justify-content: space-between; margin-bottom: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--dim); }
.alert-time { color: var(--accent); }
.alert-h { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.alert-h strong { color: var(--good); }
.alert-body { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 10px 0 18px; }
.alert-stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border-soft); }
.alert-stats > div { padding: 12px 0; display: grid; gap: 4px; }
.alert-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--border-soft); }
.alert-k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.13em; color: var(--dim); }
.alert-v { font-family: var(--mono); font-size: 17px; }
.alert-actions { display: flex; gap: 8px; margin-top: 14px; }

.trust { padding: 52px 24px; background: var(--bg-alt); }
.trust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trust-item { padding: 16px 14px 18px; }
.check { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.trust-item h3 { font-size: 13.5px; letter-spacing: -0.01em; margin-bottom: 6px; }
.trust-item p { font-size: 12px; line-height: 1.5; color: var(--muted); }
.money { margin-top: 14px; padding: 18px; }
.money h3 { font-size: 19px; margin-bottom: 8px; }
.money p { font-size: 13px; line-height: 1.55; color: var(--muted); max-width: 620px; }

.faq { padding: 52px 24px; }
.faq details { border-bottom: 1px solid var(--border); padding: 15px 0; }
.faq details:first-of-type { border-top: 1px solid var(--border); margin-top: 14px; }
.faq summary { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; cursor: pointer; }
.faq details p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 10px 0 2px; }

.final { padding: 56px 24px 64px; text-align: center; background: var(--bg-alt); }
.final h2 { font-size: 32px; max-width: 700px; margin: 14px auto 24px; }
.final-micro { font-size: 12.5px; color: var(--dim); margin-top: 14px; }

.footer { padding: 26px 24px 34px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.logo-foot .logo-word { font-size: 13px; }
.logo-foot .logo-mark { width: 14px; height: 14px; }
.footer-links { font-size: 11.5px; color: var(--dim); display: flex; gap: 16px; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-disclaim { font-size: 10.5px; color: var(--dim); line-height: 1.5; max-width: 560px; opacity: 0.85; }

/* ── Wizard ───────────────────────────────────────────────────── */
.wiz-overlay { position: fixed; inset: 0; background: rgba(17, 19, 20, 0.45); z-index: 50; display: grid; place-items: stretch; }
.wiz-overlay[hidden] { display: none; }
[hidden] { display: none !important; }
.wiz { background: var(--bg); width: 100%; height: 100%; padding: 20px 22px 22px; display: flex; flex-direction: column; overflow-y: auto; }
.wiz-head { display: flex; justify-content: space-between; align-items: center; }
.wiz-head-right { display: flex; align-items: center; gap: 12px; }
.wiz-stepcount { font-family: var(--mono); font-size: 10px; letter-spacing: 0.13em; color: var(--dim); }
.wiz-x { background: none; border: none; font-size: 26px; line-height: 1; color: var(--dim); cursor: pointer; padding: 4px 8px; }
.wiz-progress { height: 4px; border-radius: 2px; background: var(--bg-alt); margin-top: 16px; overflow: hidden; }
.wiz-bar { height: 100%; width: 25%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }
#lead-form { display: flex; flex-direction: column; flex: 1; }
.wiz-step { flex: 1; margin-top: 22px; }
.wiz-step h2 { font-size: 27px; line-height: 1.12; margin-bottom: 6px; }
.wiz-sub { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin-bottom: 20px; }
.wiz-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; letter-spacing: -0.01em; }
.field input {
  width: 100%; background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 15px 16px; font-family: var(--body);
  font-size: 16px; color: var(--ink); outline: none;
}
.field input:focus { border-color: var(--accent); }
.field input.is-invalid { border-color: #c0392b; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.chip {
  padding: 13px 16px; border-radius: var(--radius-sm); cursor: pointer; text-align: left;
  border: 1.5px solid var(--border); background: var(--card); color: var(--muted);
  font-family: var(--body); font-size: 14.5px; font-weight: 500;
}
.chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.wiz-note { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid rgba(59, 80, 232, 0.2); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.wiz-note strong { color: var(--accent); }
.sms-row {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer; font-size: 13px;
  color: var(--muted); line-height: 1.5; padding: 13px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--card); margin-bottom: 16px;
}
.sms-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.sms-row input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.consent-row {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer; font-size: 13px;
  color: var(--muted); line-height: 1.5; padding: 13px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--card); margin-bottom: 16px;
}
.consent-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.consent-row input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.consent-row a { color: var(--accent); text-decoration: underline; }
.wiz-fine { font-size: 11.5px; color: var(--dim); line-height: 1.5; }
.wiz-error { font-size: 13px; color: #c0392b; margin-top: 12px; font-weight: 600; }
.wiz-done { display: flex; flex-direction: column; align-items: flex-start; }
.check-big { width: 38px; height: 38px; font-size: 19px; margin-bottom: 14px; }
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 14px; border-top: 1px solid var(--border-soft); margin: 16px 0 12px; width: 100%; }
.done-stats > div { display: grid; gap: 4px; }
.done-stats .alert-v { color: var(--accent); font-size: 15px; }
.wiz-nav { display: flex; gap: 10px; margin-top: 18px; }
.wiz-nav .btn-full { flex: 1; }
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; opacity: 0; }
.btn[disabled] { opacity: 0.55; cursor: wait; }

/* ── Desktop ──────────────────────────────────────────────────── */
@media (min-width: 880px) {
  .nav { padding: 22px 72px; }
  .nav-cta { display: inline-block; }
  .nav .logo-word { font-size: 21px; }
  .nav .logo-mark { width: 23px; height: 23px; border-width: 2.4px; border-radius: 5px; }
  .nav .logo-dot { width: 7.5px; height: 7.5px; right: 3.5px; top: 3.5px; }
  .hero {
    padding: 40px 72px 90px; grid-template-columns: 1.05fr 1fr; gap: 72px;
    align-items: center; max-width: 1200px; margin: 0 auto;
  }
  .hero h1 { font-size: 62px; }
  .hero .sub { font-size: 18px; margin-top: 22px; }
  .hero-ticks { display: block; }
  .calc { padding: 28px 28px 26px; }
  .calc-save { font-size: 40px; }
  section h2 { font-size: 46px; }
  .steps, .alert-demo, .trust, .faq { padding: 90px 72px; }
  .steps-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
  .step { padding: 26px 24px 28px; }
  .step-n { margin-bottom: 18px; }
  .step h3 { font-size: 23px; }
  .alert-grid { grid-template-columns: 1fr 1.1fr; gap: 64px; }
  .alert-card { padding: 26px 28px 28px; }
  .alert-h { font-size: 26px; }
  .trust-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .trust-item { padding: 22px 20px 24px; }
  .trust-item h3 { font-size: 15px; }
  .trust-item p { font-size: 13px; }
  .money { margin-top: 22px; padding: 24px 28px; display: flex; align-items: center; gap: 32px; justify-content: space-between; }
  .money h3 { font-size: 22px; margin-bottom: 0; white-space: nowrap; }
  .money p { font-size: 14px; }
  .faq summary { font-size: 16px; }
  .faq details { padding: 18px 0; }
  .faq details p { font-size: 14.5px; }
  .final { padding: 100px 72px 110px; }
  .final h2 { font-size: 54px; margin-bottom: 36px; }
  .footer { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 34px 72px 40px; }
  .footer-disclaim { flex-basis: 100%; }
  .wiz-overlay { place-items: center; padding: 24px; }
  .wiz { max-width: 460px; height: auto; min-height: 640px; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow); }
}

/* ── Mode gate: refi (default) vs purchase-shopping ("shop") variants ──
   app.js stamps body[data-mode] from the active hero variant. With no JS
   (crawlers) the body has no data-mode, so refi blocks render and shop
   blocks stay hidden — the default page is unchanged. */
body:not([data-mode="shop"]) [data-mode="shop"] { display: none !important; }
body[data-mode="shop"] [data-mode="refi"] { display: none !important; }
