:root {
  --primary: #1f3a5f;
  --primary-light: #4a6b8f;
  --accent: #c89b3c;
  --text: #2a2a2a;
  --text-light: #6b6b6b;
  --border: #e4e4e4;
  --bg: #ffffff;
  --bg-soft: #f7f5f1;
  --bg-card: #ffffff;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --max-w: 1240px;
  --radius: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

/* ---------- top bar ---------- */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap;
}
.topbar .brand {
  font-weight: 700; font-size: 20px; color: var(--primary);
  text-decoration: none; letter-spacing: 0.2px;
}
.topbar .address {
  color: var(--text-light); font-size: 14px; flex: 1;
}
.topbar nav {
  display: flex; gap: 18px; font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
}
.topbar nav a {
  color: var(--text); text-decoration: none; padding: 6px 0;
  border-bottom: 2px solid transparent; transition: all 0.15s;
}
.topbar nav a:hover { color: var(--primary); border-bottom-color: var(--accent); }

/* ---------- hero carousel ---------- */
.hero {
  position: relative;
  background: var(--bg-soft);
  padding: 0;
  overflow: hidden;
}
.hero-scroller {
  display: flex; gap: 16px; padding: 24px;
  overflow-x: auto; scroll-snap-type: x mandatory;
}
.hero-card {
  flex: 0 0 auto; width: 380px; scroll-snap-align: start;
  background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.hero-card img {
  width: 100%; height: 220px; object-fit: cover; display: block;
}
.hero-card .meta {
  padding: 12px 16px; font-size: 14px;
}
.hero-card .price { font-weight: 700; color: var(--primary); font-size: 17px; }
.hero-card .addr { color: var(--text); margin: 4px 0; }
.hero-card .specs, .hero-card .brokerage {
  color: var(--text-light); font-size: 13px;
}

/* ---------- container & sections ---------- */
.container {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
}
section { padding: 56px 0; border-bottom: 1px solid var(--border); }
section:last-child { border-bottom: none; }

h1.community-title {
  font-size: 38px; color: var(--primary); margin: 0 0 8px;
  font-weight: 700;
}
.location-line {
  color: var(--text-light); font-size: 15px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 8px;
}
.location-line .material-symbols-outlined { font-size: 18px; }

.narrative p {
  font-size: 16px; line-height: 1.75; margin: 16px 0;
  color: var(--text);
}

/* ---------- stats strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-top: 32px; padding: 24px;
  background: var(--bg-soft); border-radius: var(--radius);
}
.stat { text-align: center; }
.stat .icon { font-size: 32px; color: var(--accent); margin-bottom: 6px; }
.stat .value { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat .label { color: var(--text-light); font-size: 13px; margin-top: 2px; }

/* ---------- amenities ---------- */
h2 { font-size: 26px; color: var(--primary); margin: 0 0 20px; font-weight: 700; }
h3 { font-size: 20px; color: var(--primary); margin: 0 0 16px; font-weight: 600; }

.amenity-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.amenity {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 12px; background: var(--bg-soft); border-radius: var(--radius);
  text-align: center; font-size: 14px;
}
.amenity .material-symbols-outlined { font-size: 28px; color: var(--accent); }

/* ---------- map ---------- */
.map-wrap {
  display: grid; grid-template-columns: 1fr 280px; gap: 16px; margin-top: 16px;
}
#leaflet-map { height: 480px; border-radius: var(--radius); border: 1px solid var(--border); }
.map-side {
  background: var(--bg-soft); border-radius: var(--radius); padding: 16px;
  font-size: 14px; overflow-y: auto; max-height: 480px;
}
.map-side h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-light); margin: 0 0 8px; font-weight: 600; }
.poi-category {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.poi-category .material-symbols-outlined { font-size: 18px; color: var(--accent); }
.poi-category .count { margin-left: auto; color: var(--text-light); font-size: 13px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
table th {
  text-align: left; padding: 12px 10px; background: var(--bg-soft);
  border-bottom: 2px solid var(--border); color: var(--primary);
  font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.3px;
}
table td { padding: 12px 10px; border-bottom: 1px solid var(--border); }
table tr:hover { background: var(--bg-soft); }
.status-badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.status-Sold { background: #f0e0e0; color: #843; }
.status-For\ Sale, .status-Listed { background: #e0f0e0; color: #356; }
.status-In\ Contract { background: #fff0d0; color: #864; }
.status-Price\ Reduction { background: #f0e8d0; color: #844; }

/* ---------- floorplans ---------- */
.floorplan-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.floorplan-card {
  background: var(--bg-soft); padding: 20px; border-radius: var(--radius);
  text-align: center;
}
.floorplan-card .name { font-weight: 700; color: var(--primary); }
.floorplan-card .specs { color: var(--text-light); font-size: 14px; margin-top: 6px; }

/* ---------- community facts ---------- */
.facts-box {
  background: var(--bg-soft); padding: 28px; border-radius: var(--radius);
  margin-top: 16px;
}
.facts-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px;
  list-style: none; padding: 0; margin: 0 0 16px;
}
.facts-list li { padding: 6px 0; border-bottom: 1px dotted var(--border); }
.facts-list .label { font-weight: 600; color: var(--text-light); margin-right: 8px; }
.lifestyle { font-size: 15px; line-height: 1.7; color: var(--text); }

/* ---------- HOA confidence badge ---------- */
.hoa-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
  margin-left: 8px;
}
.hoa-badge.high { background: #e0f0e0; color: #356; }
.hoa-badge.mid { background: #fff0d0; color: #864; }
.hoa-badge.low { background: #f0e0e0; color: #843; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  padding: 16px 0; cursor: pointer; font-weight: 600; color: var(--primary);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: '+'; font-size: 24px; font-weight: 400; color: var(--accent);
  transition: transform 0.15s;
}
.faq-item[open] summary::before { transform: rotate(45deg); }
.faq-item p { padding: 0 0 16px 28px; color: var(--text); margin: 0; }

/* ---------- nearby ---------- */
.nearby-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.nearby-card {
  background: var(--bg-soft); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit; transition: transform 0.15s;
}
.nearby-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.nearby-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.nearby-card .body { padding: 12px 14px; }
.nearby-card .city { color: var(--text-light); font-size: 13px; }
.nearby-card .name { font-weight: 700; color: var(--primary); margin: 4px 0; }
.nearby-card .homes { color: var(--text-light); font-size: 13px; }

/* ---------- forms / CTA ---------- */
.cta-box {
  background: var(--primary); color: white; border-radius: var(--radius);
  padding: 28px; margin: 28px 0;
}
.cta-box h3 { color: white; }
.cta-box .form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px;
}
.cta-box input, .cta-box select, .cta-box textarea {
  padding: 10px 12px; border-radius: 4px; border: none; font-size: 14px; width: 100%;
  font-family: inherit;
}
.cta-box button {
  background: var(--accent); color: white; padding: 12px 28px; border: none;
  border-radius: 4px; cursor: pointer; font-weight: 600; margin-top: 16px;
  text-transform: uppercase; letter-spacing: 0.5px; font-size: 13px;
}
.cta-box button:hover { background: #b08930; }

/* ---------- footer ---------- */
footer {
  background: var(--bg-soft); padding: 40px 24px; margin-top: 0;
  border-top: 1px solid var(--border); color: var(--text-light); font-size: 13px;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.disclaimer { margin-top: 16px; font-size: 12px; color: var(--text-light); line-height: 1.6; }

/* ---------- landing page ---------- */
.landing-hero {
  padding: 80px 24px; text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}
.landing-hero h1 { font-size: 44px; margin: 0 0 12px; color: white; }
.landing-hero p { font-size: 18px; opacity: 0.95; max-width: 700px; margin: 0 auto; }
.landing-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px; padding: 48px 0;
}
.landing-card {
  background: white; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
.landing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.landing-card img { width: 100%; height: 200px; object-fit: cover; }
.landing-card .body { padding: 20px; flex: 1; }
.landing-card .body h3 { color: var(--primary); margin: 0 0 6px; }
.landing-card .body .meta { color: var(--text-light); font-size: 14px; }
.landing-card .body .stats-inline { display: flex; gap: 16px; margin-top: 12px;
  font-size: 13px; color: var(--text); }

/* ---------- admin page ---------- */
.admin-page { padding: 40px 24px; max-width: var(--max-w); margin: 0 auto; }
.admin-page h1 { color: var(--primary); }
.evidence-table .matched { color: #356; font-weight: 700; }
.evidence-table .unmatched { color: #843; }
.score-bar {
  display: inline-block; width: 120px; height: 8px; background: var(--border);
  border-radius: 4px; overflow: hidden; vertical-align: middle;
}
.score-bar > div {
  height: 100%; background: linear-gradient(90deg, var(--accent), #2a8a40);
}
.community-picker {
  display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap;
}
.community-picker button {
  padding: 8px 16px; background: white; border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; font-size: 14px;
}
.community-picker button.active { background: var(--primary); color: white; }

/* responsive */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .map-wrap { grid-template-columns: 1fr; }
  .facts-list { grid-template-columns: 1fr; }
  h1.community-title { font-size: 28px; }
  .topbar { padding: 10px 16px; gap: 12px; }
  .topbar nav { display: none; }
}
