:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --accent: #2f6feb;
  --accent-soft: #d9e8ff;
  --text: #1e2a3b;
  --muted: #5b6b82;
  --success: #117a37;
  --danger: #b83837;
  --shadow: 0 14px 30px rgba(25, 39, 67, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #edf3ff 0%, var(--bg) 240px);
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

.hero {
  padding: 3rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.eyebrow {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

h1 {
  margin: 0.1rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.subtitle {
  margin-top: 0;
  max-width: 54ch;
  color: var(--muted);
  line-height: 1.55;
}

.quick-stats {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stat-pill {
  background: var(--accent-soft);
  color: #123f96;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.rate-check label,
.form-grid label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.big-rate {
  font-size: 2.75rem;
  margin: 0.4rem 0;
  color: var(--accent);
  font-weight: 800;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.focus-tag {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

select,
input,
button {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #cfd8ea;
  font: inherit;
  margin-top: 0.35rem;
}

button {
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(47, 111, 235, 0.25);
}

.main-grid {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 2.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.9rem;
}


.target-alert {
  margin-top: 0.5rem;
  margin-bottom: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  display: none;
  font-weight: 600;
}

.target-alert.success {
  display: block;
  background: #e9f8ed;
  color: #0f6a30;
  border: 1px solid #bfe6c9;
}

.target-alert.info {
  display: block;
  background: #f1f5ff;
  color: #29446b;
  border: 1px solid #d4e0fb;
}


.result-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 0.8rem;
}

.estimator-note {
  margin-top: -0.2rem;
  margin-bottom: 1rem;
}

.result-grid > div {
  background: #f5f8ff;
  border-radius: 12px;
  padding: 0.8rem;
}

.result-grid .total {
  background: #e9f8ed;
}

.result-label {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.result-value {
  margin: 0.25rem 0 0;
  font-size: 1.35rem;
  font-weight: 750;
}

#trendChart {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #f7f9fd;
  border: 1px solid #e7ecf6;
}

.neighborhood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.neighborhood-card {
  border: 1px solid #e4ebf8;
  border-radius: 12px;
  padding: 0.9rem;
}

.neighborhood-card h3 {
  margin: 0;
}

.delta {
  font-weight: 700;
  margin-top: 0.45rem;
}

.delta.positive {
  color: var(--danger);
}

.delta.negative {
  color: var(--success);
}

.footer {
  padding: 0.4rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}
