/* Any element with `display:` set (e.g. .row is flex) beats the UA stylesheet's
 * [hidden] rule, so the attribute silently stops working. This must win. */
[hidden] { display: none !important; }

:root {
  --bg: #eef1f6;
  --bg-2: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6eaf0;
  --line-2: #eef1f6;
  --primary: #2563eb;
  --primary-ink: #1d4ed8;
  --primary-soft: #eff4ff;
  --t1: #2563eb;
  --t2: #0d9488;
  --t3: #d97706;
  --ok: #16a34a;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow: 0 4px 12px rgba(15,23,42,.06), 0 16px 40px rgba(15,23,42,.07);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1a; --bg-2: #0e1524; --card: #131a2a; --ink: #e8edf5; --ink-2: #c2cbd9;
    --muted: #8b96a8; --line: #243044; --line-2: #1b2536; --primary: #4c8dff; --primary-ink: #6ba1ff;
    --primary-soft: #16223c; --t1: #4c8dff; --t2: #2dd4bf; --t3: #fbbf24;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 8px 30px rgba(0,0,0,.45);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; letter-spacing: -.01em;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
h1, h2 { letter-spacing: -.025em; margin: 0; }
strong { font-weight: 600; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 2px 8px rgba(37,99,235,.4); }
.logo-mark svg { width: 17px; height: 17px; }
.brand-name { font-weight: 700; font-size: 17px; }
.brand-accent { color: var(--primary); }
.header-tag { color: var(--muted); font-size: 12.5px; }

/* Hero */
.hero { background: radial-gradient(1200px 300px at 50% -60px, var(--primary-soft), transparent), var(--bg); padding: 46px 0 10px; text-align: center; }
.hero h1 { font-size: clamp(28px, 4.4vw, 44px); font-weight: 800; line-height: 1.08; }
.lede { color: var(--ink-2); max-width: 60ch; margin: 16px auto 0; font-size: clamp(15px, 1.6vw, 17px); }
.stat-strip { display: inline-flex; gap: 8px; margin: 26px auto 0; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.stat { padding: 8px 20px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line-2); }
.stat-num { display: block; font-weight: 800; font-size: 20px; color: var(--primary); }
.stat-lbl { font-size: 12px; color: var(--muted); }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start; padding: 30px 0 8px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-title { font-size: 18px; font-weight: 700; }
.form .card-title { margin-bottom: 6px; }

/* Form */
fieldset { border: 0; border-top: 1px solid var(--line-2); margin: 0; padding: 16px 0 6px; }
fieldset:first-of-type { border-top: 0; padding-top: 14px; }
legend { font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; }
.row > span { flex: 1; font-size: 14.5px; color: var(--ink-2); font-weight: 500; }
.row small { color: var(--muted); font-weight: 400; }
.row small.hint { display: block; font-size: 12px; line-height: 1.35; margin-top: 2px; }

/* Co-brand strip for real estate partners (?ref=) */
.partner-bar { border-top: 1px solid var(--line); background: var(--bg-2); font-size: 13px; color: var(--ink-2); }
.partner-bar .wrap { padding: 8px 0; }
.partner-bar b { color: var(--ink); font-weight: 600; }
input, select {
  width: 150px; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; text-align: right; transition: border-color .15s, box-shadow .15s;
}
select { text-align: left; }
input::placeholder { color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

/* Buttons */
.btn { display: inline-block; width: 100%; font: inherit; font-weight: 600; border: 0; border-radius: 12px; cursor: pointer; transition: transform .05s, background .15s, box-shadow .15s; }
.btn-lg { padding: 14px 18px; font-size: 15.5px; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,.32); }
.btn.primary:hover { background: var(--primary-ink); }
.btn.primary:active { transform: translateY(1px); }
.form .btn { margin-top: 18px; }

.fineprint, .lead-status { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; line-height: 1.5; }

/* Results — empty state */
.results { display: flex; flex-direction: column; min-height: 340px; }
.results-empty { margin: auto; text-align: center; max-width: 34ch; padding: 20px 0; }
.empty-badge { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.results-empty .card-title { margin-bottom: 8px; }
.results-empty p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* Results — populated */
.headline { text-align: center; padding: 4px 0 20px; border-bottom: 1px solid var(--line-2); }
.headline-label { color: var(--muted); font-size: 13.5px; }
.headline-range { font-size: clamp(28px, 4vw, 36px); font-weight: 800; letter-spacing: -.03em; margin-top: 6px; background: linear-gradient(90deg, var(--t1), var(--t3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.headline-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 8px; }
.headline-sub b { color: var(--ink); font-weight: 600; }

/* Two result blocks: servicing (income only) and buying power (with deposit) */
.result-block { margin-top: 22px; }
.result-block + .result-block { padding-top: 20px; border-top: 1px solid var(--line-2); }
.tier-label { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-2); }
.tier-label small { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 500;
  letter-spacing: .02em; text-transform: none; color: var(--muted); }
.block-note { margin: 12px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.block-note strong { color: var(--ink-2); font-weight: 600; }
/* Single consolidated row shown when the deposit, not the lender, sets the price */
.tier-row.tier-all { border-left: 3px solid var(--t2); }

/* Lead submit feedback */
.lead-status.ok { color: #16a34a; }
.lead-status.err { color: #dc2626; }

/* Verdict panel for a specific property price the visitor named */
.target-block { margin-top: 20px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); border-left-width: 3px; background: var(--bg-2); }
.target-block.good { border-left-color: #16a34a; }
.target-block.warn { border-left-color: #d97706; }
.target-block.bad  { border-left-color: #dc2626; }
.target-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.target-verdict { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.target-block.good .target-verdict { color: #16a34a; }
.target-block.warn .target-verdict { color: #d97706; }
.target-block.bad  .target-verdict { color: #dc2626; }
.target-price { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.target-detail { margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.target-detail b { color: var(--ink); font-weight: 600; }

.tier-grid { display: flex; flex-direction: column; gap: 14px; padding: 20px 0 4px; }
.tier-row { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg-2); }
.tier-head { display: flex; align-items: center; gap: 10px; }
.tier-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tier-1 .tier-dot { background: var(--t1); } .tier-2 .tier-dot { background: var(--t2); } .tier-3 .tier-dot { background: var(--t3); }
.tier-name { font-weight: 600; font-size: 14px; }
.tier-amount { margin-left: auto; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.tier-bar { height: 8px; border-radius: 999px; background: var(--line); margin: 11px 0 9px; overflow: hidden; }
.tier-bar-fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.tier-1 .tier-bar-fill { background: linear-gradient(90deg, #60a5fa, var(--t1)); }
.tier-2 .tier-bar-fill { background: linear-gradient(90deg, #2dd4bf, var(--t2)); }
.tier-3 .tier-bar-fill { background: linear-gradient(90deg, #fbbf24, var(--t3)); }
.tier-elig { color: var(--muted); font-size: 13px; }
.tier-elig b { color: var(--ink); font-weight: 700; }

.cta { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-2); text-align: center; }
.cta-line { color: var(--ink-2); font-size: 14.5px; margin: 0 0 14px; }

/* Lead */
.lead { margin: 20px 0 26px; }
.lead-head { text-align: center; max-width: 52ch; margin: 0 auto 18px; }
.lead-head p { color: var(--muted); margin: 6px 0 0; }
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .lead-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field select { width: 100%; text-align: left; }
.lead .btn { margin-top: 16px; }
.lead-status { text-align: center; }

/* Disclaimer */
.disclaimer { color: var(--muted); font-size: 12px; line-height: 1.6; border-top: 1px solid var(--line); margin: 10px 0 48px; padding-top: 18px; }

.br-desktop { display: inline; }
@media (max-width: 640px) { .br-desktop { display: none; } }
