:root {
  --bg: #f3f6f9;
  --card: #ffffff;
  --ink: #18222f;
  --muted: #64748b;
  --line: #dce4ec;
  --primary: #0f766e;
  --primary-dark: #0a5b55;
  --soft: #e7f6f3;
  --blue-soft: #eaf2ff;
  --danger: #b42318;
  --shadow: 0 16px 45px rgba(23, 42, 58, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: var(--primary); }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px clamp(18px, 4vw, 48px); background: #102a2b; color: white; }
.brand-wrap { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(135deg,#42c2b5,#f3c969); color: #102a2b; font-size: 30px; font-weight: 900; }
.site-header h1 { margin: 0; font-size: clamp(25px,4vw,38px); letter-spacing: -.04em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; color: #6a7a8a; }
.site-header .eyebrow { color: #b9d5d3; }
.status-pill { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.09); border-radius: 999px; padding: 8px 12px; font-size: 12px; }
.status-pill.good { background: rgba(46, 204, 113, .14); color: #c9f7d9; }
.status-pill.warn { background: rgba(245, 183, 66, .14); color: #ffe4a7; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px clamp(12px,4vw,48px); background: white; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.tab { white-space: nowrap; border: 0; background: transparent; padding: 10px 14px; border-radius: 10px; font-weight: 750; color: #516171; cursor: pointer; }
.tab:hover, .tab.active { background: var(--soft); color: var(--primary-dark); }

main { max-width: 1400px; margin: 0 auto; padding: clamp(20px,4vw,46px); }
.panel { display: none; }
.panel.active { display: block; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: clamp(22px,5vw,46px); background: linear-gradient(135deg,#e9f8f5,#fff8e6); border: 1px solid #d7ebe7; border-radius: 26px; margin-bottom: 22px; }
.hero h2, h2 { margin: 6px 0 10px; font-size: clamp(25px,4vw,40px); line-height: 1.08; letter-spacing: -.035em; }
.hero p { max-width: 760px; margin: 0; color: #506172; font-size: 17px; line-height: 1.6; }
.hero-note { padding: 18px; border-radius: 16px; background: #113435; color: #d9f2ee; font-weight: 750; line-height: 1.55; text-align: center; min-width: 190px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: clamp(18px,3vw,30px); }
.form-card h3, .info-card h3 { margin: 4px 0 12px; font-size: 24px; }
.info-card { padding: 26px; line-height: 1.65; }
.info-card ol { padding-left: 22px; }
.info-card li { margin: 10px 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h3, .section-heading h2 { margin: 4px 0; }
.section-heading p { color: var(--muted); margin: 6px 0 0; }
.results-heading { margin-top: 34px; }

.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-grid.four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.span-2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 7px; color: #344253; font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid #cbd6df; border-radius: 11px; padding: 12px 13px; background: white; color: var(--ink); outline: none; transition: .15s ease; }
input:focus, select:focus, textarea:focus { border-color: #38a99e; box-shadow: 0 0 0 4px rgba(15,118,110,.12); }
.help { color: var(--muted); font-size: 12px; font-weight: 500; }
.feature-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.check { flex-direction: row; align-items: center; gap: 7px; background: #f6f8fa; border: 1px solid var(--line); padding: 9px 11px; border-radius: 999px; font-weight: 650; cursor: pointer; }
.check input { width: auto; }

.button-row { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.button-row.compact { margin: 0; }
.button-row.wrap { flex-wrap: wrap; }
.button { appearance: none; border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform .1s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #153b58; color: white; }
.button.ghost { background: #edf2f5; color: #344253; }
.button.danger { background: #feeceb; color: var(--danger); }
.button.full { width: 100%; }
.button.small { padding: 8px 10px; font-size: 12px; }

.provider-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.provider-card { padding: 17px; border-radius: 15px; border: 1px solid var(--line); background: white; text-decoration: none; color: var(--ink); box-shadow: 0 8px 24px rgba(23,42,58,.05); }
.provider-card strong { display: block; margin-bottom: 5px; }
.provider-card span { color: var(--muted); font-size: 12px; }
.provider-card:hover { border-color: #72c2ba; }

.listing-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.listing-card { background: white; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; box-shadow: 0 10px 32px rgba(23,42,58,.06); display: flex; flex-direction: column; }
.listing-accent { height: 9px; background: linear-gradient(90deg,#0f766e,#f1c85d); }
.listing-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.listing-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.listing-card h3 { margin: 10px 0 8px; font-size: 19px; line-height: 1.25; }
.listing-address { color: #526274; min-height: 42px; }
.listing-price { font-size: 21px; font-weight: 900; margin: 10px 0; }
.property-stats { display: flex; gap: 12px; color: #475569; font-size: 14px; margin-bottom: 10px; }
.estimate-box { background: var(--blue-soft); border-radius: 11px; padding: 10px; font-size: 13px; color: #24415e; margin: 5px 0 12px; }
.listing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.empty-state { padding: 30px; color: var(--muted); text-align: center; border: 1px dashed #c8d3dc; background: rgba(255,255,255,.55); border-radius: var(--radius); }

.two-column { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.calculator-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.wide-card { max-width: 1100px; margin: auto; }
.criteria-preview { background: #f1f6f7; color: #3f5960; border-radius: 11px; padding: 13px; margin: 18px 0; font-size: 13px; }
.calculation-result { margin-top: 18px; border-radius: 13px; background: #f1f7f6; padding: 0; overflow: hidden; }
.calculation-result:not(:empty) { padding: 16px; }
.calculation-result.large { line-height: 1.65; }
.metric-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.metric { border-radius: 11px; background: white; border: 1px solid #dbe5e7; padding: 12px; }
.metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.metric strong { font-size: 18px; }
.legal-note { max-width: 1100px; margin: 18px auto 0; padding: 15px 18px; border-left: 4px solid #d2a42d; background: #fff8e7; color: #604f24; border-radius: 8px; font-size: 13px; }

.service-card { border: 1px solid var(--line); border-radius: 13px; padding: 14px; margin: 10px 0; background: white; }
.service-card h4 { margin: 0 0 5px; }
.service-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.plan-total { background: #113435; color: white; border-radius: 14px; padding: 16px; margin-top: 14px; }
.plan-total strong { font-size: 24px; }
.history-list { display: grid; gap: 12px; }
.history-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; justify-content: space-between; gap: 15px; align-items: center; }
.history-card p { margin: 4px 0 0; color: var(--muted); }
.status-list { display: grid; gap: 10px; }
.status-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.message { margin-top: 12px; font-size: 13px; color: var(--muted); }
.message.good { color: #08734d; }
.message.bad { color: var(--danger); }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(15,23,42,.62); }
.modal.hidden, .hidden { display: none !important; }
.modal-card { position: relative; width: min(480px,100%); background: white; border-radius: 20px; padding: 28px; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; font-size: 28px; cursor: pointer; color: var(--muted); }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px clamp(18px,4vw,48px); color: #657485; border-top: 1px solid var(--line); background: white; font-size: 12px; }

@media (max-width: 1050px) {
  .form-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .provider-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .listing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .site-header { align-items: flex-start; }
  .status-pill { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-note { text-align: left; min-width: 0; }
  .two-column, .calculator-grid, .form-grid.two, .form-grid.four { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .provider-grid, .listing-grid { grid-template-columns: 1fr; }
  .section-heading, footer { flex-direction: column; }
  .button-row { flex-wrap: wrap; }
  .button-row .button { flex: 1; }
  .history-card { align-items: flex-start; flex-direction: column; }
}
