:root {
  --gold: #b49630;
  --gold-light: #d4b84a;
  --gold-dark: #8a6f1f;
  --dark: #1a1208;
  --dark2: #2a1e0a;
  --text: #2c2c2c;
  --light: #f9f6ef;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; background: #f4f0e6; color: var(--text); }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* Global focus-visible indicator for keyboard users — WCAG 2.4.7 */
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; border-radius: 3px; }
/* Screen-reader-only utility — visually hidden but read by assistive tech */
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}
/* Skip-to-main link — WCAG 2.4.1 Bypass Blocks. Off-screen until focused. */
.skip-link {
  position: absolute; left: -9999px; top: -9999px;
  background: var(--gold); color: var(--dark);
  padding: 10px 16px; border-radius: 6px;
  font-weight: 700; text-decoration: none; z-index: 9999;
}
.skip-link:focus, .skip-link:focus-visible {
  position: fixed; left: 8px; top: 8px;
  outline: 3px solid var(--gold-light); outline-offset: 2px;
}

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(26,18,8,0.97); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 64px; border-bottom: 1px solid rgba(180,150,60,0.3);
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: #ccc; font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--gold-light); }
.nav-cta {
  background: var(--gold); color: var(--dark) !important; font-weight: 700;
  padding: 0.5rem 1.2rem; border-radius: 6px; font-size: 0.9rem !important;
}
.nav-cta:hover { background: var(--gold-light) !important; }

/* HERO */
.hero {
  position: relative; z-index: 2;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(26,18,8,0.95) 0%, rgba(42,30,10,0.92) 100%);
  text-align: center; padding: 8rem 2rem 4rem;
}
.hero-content { max-width: 800px; }
.hero h1 { font-size: clamp(2rem,5vw,3.5rem); color: #fff; line-height: 1.2; margin-bottom: 1.5rem; }
.hero h1 span { color: var(--gold-light); }
.hero p { font-size: 1.2rem; color: #ccc; margin-bottom: 2rem; line-height: 1.7; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  background: var(--gold); color: var(--dark); font-weight: 700;
  padding: 1rem 2.5rem; border-radius: 8px; font-size: 1.05rem;
  transition: all 0.2s; border: none; cursor: pointer; display: inline-block;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); color: var(--dark); }
.btn-outline {
  background: transparent; color: var(--gold-light); font-weight: 700;
  padding: 1rem 2.5rem; border-radius: 8px; font-size: 1.05rem;
  border: 2px solid var(--gold); transition: all 0.2s; cursor: pointer; display: inline-block;
}
.btn-outline:hover { background: var(--gold); color: var(--dark); transform: translateY(-2px); }
.btn {
  display: inline-block; padding: 0.9rem 1.8rem; border-radius: 8px;
  font-weight: 700; font-size: 1rem; text-decoration: none; border: none; cursor: pointer;
  transition: all 0.2s;
}
.btn-gold { background: var(--gold); color: var(--dark); }
.btn-gold:hover { background: var(--gold-light); color: var(--dark); transform: translateY(-2px); }
.btn-nav {
  background: var(--gold); color: var(--dark) !important; font-weight: 700;
  padding: 0.5rem 1.2rem; border-radius: 6px; font-size: 0.9rem !important;
}
.btn-nav:hover { background: var(--gold-light) !important; }

/* SECTIONS */
section { position: relative; z-index: 2; }
.section-light { background: rgba(255,255,255,0.88); padding: 5rem 2rem; }
.section-dark { background: rgba(26,18,8,0.93); padding: 5rem 2rem; color: #f0e8d0; }
.section-gold { background: rgba(180,150,60,0.12); padding: 5rem 2rem; }
.container { max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 0.5rem; }
.section-sub { text-align: center; color: #888; margin-bottom: 3rem; font-size: 1.05rem; }
.section-dark .section-sub { color: #bbb; }
.section-dark .section-title { color: var(--gold-light); }

/* STATS BAR */
.stats-bar {
  position: relative; z-index: 2;
  background: var(--gold); padding: 1.5rem 2rem;
  display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--dark); }
.stat-label { font-size: 0.85rem; color: var(--dark2); font-weight: 600; }

/* CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 1.5rem; }
.card {
  background: rgba(255,255,255,0.9); border-radius: var(--radius);
  padding: 2rem; border: 1px solid rgba(180,150,60,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06); transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); }
.card-icon { font-size: 2rem; margin-bottom: 1rem; }
.card h3 { font-size: 1.15rem; color: var(--dark); margin-bottom: 0.5rem; }
.card p { color: #666; font-size: 0.95rem; line-height: 1.6; }

/* TIERS */
.tiers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 1.5rem; }
.tier-card {
  background: rgba(255,255,255,0.92); border-radius: var(--radius);
  padding: 2rem; border: 2px solid rgba(180,150,60,0.25); text-align: center;
  cursor: pointer; transition: all 0.2s;
}
.tier-card:hover, .tier-card.active {
  border-color: var(--gold); background: rgba(180,150,60,0.1);
  transform: translateY(-4px); box-shadow: 0 8px 30px rgba(180,150,60,0.2);
}
.tier-down { font-size: 2rem; font-weight: 800; color: var(--gold); }
.tier-rate { font-size: 1.1rem; font-weight: 600; color: var(--dark); margin: 0.5rem 0; }
.tier-pay { font-size: 0.9rem; color: #666; }
.tier-badge {
  display: inline-block; background: var(--gold); color: var(--dark);
  font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.7rem;
  border-radius: 20px; margin-top: 0.7rem;
}

/* CALCULATOR */
.calc-box {
  background: rgba(255,255,255,0.92); border-radius: var(--radius);
  padding: 2.5rem; max-width: 700px; margin: 0 auto;
  border: 1px solid rgba(180,150,60,0.25); box-shadow: 0 8px 40px rgba(0,0,0,0.1);
}
.calc-box h3 { font-size: 1.4rem; color: var(--dark); margin-bottom: 1.5rem; text-align: center; }
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.calc-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--dark); }
.form-group input, .form-group select {
  padding: 0.7rem 1rem; border: 1.5px solid #ddd; border-radius: 6px;
  font-size: 1rem; outline: none; transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--gold); }
.calc-results {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #eee;
}
.result-item { text-align: center; }
.result-val { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.result-label { font-size: 0.78rem; color: #888; margin-top: 0.2rem; }
.calc-note { font-size: 0.8rem; color: #888; text-align: center; margin-top: 1rem; line-height: 1.5; }

/* FORM */
.form-section { background: rgba(255,255,255,0.9); padding: 5rem 2rem; position: relative; z-index: 2; }
.big-form {
  max-width: 780px; margin: 0 auto; background: rgba(255,255,255,0.95);
  border-radius: var(--radius); padding: 2.5rem;
  border: 1px solid rgba(180,150,60,0.2); box-shadow: 0 8px 40px rgba(0,0,0,0.1);
}
.form-step-title {
  font-size: 1.15rem; font-weight: 700; color: var(--gold-dark);
  border-bottom: 2px solid var(--gold); padding-bottom: 0.5rem; margin: 2rem 0 1.2rem;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-full { grid-column: 1 / -1; }
.form-group textarea {
  padding: 0.7rem 1rem; border: 1.5px solid #ddd; border-radius: 6px;
  font-size: 0.95rem; resize: vertical; min-height: 90px; outline: none;
  transition: border 0.2s; font-family: inherit;
}
.form-group textarea:focus { border-color: var(--gold); }
.checkbox-group { display: flex; align-items: flex-start; gap: 0.7rem; }
.checkbox-group input[type=checkbox] { margin-top: 3px; accent-color: var(--gold); }
.submit-btn {
  width: 100%; padding: 1.2rem; background: var(--gold); color: var(--dark);
  font-size: 1.1rem; font-weight: 700; border: none; border-radius: 8px;
  cursor: pointer; margin-top: 2rem; transition: all 0.2s;
}
.submit-btn:hover { background: var(--gold-light); transform: translateY(-2px); }

/* DASHBOARD */
.dashboard-body { background: #1a1208; color: #f0e8d0; min-height: 100vh; }
.db-header {
  background: rgba(26,18,8,0.98); border-bottom: 1px solid rgba(180,150,60,0.3);
  padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between;
}
.db-header h1 { color: var(--gold-light); font-size: 1.3rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 1rem; padding: 2rem; }
.kpi-card {
  background: rgba(255,255,255,0.06); border-radius: 8px; padding: 1.5rem;
  text-align: center; border: 1px solid rgba(180,150,60,0.2);
}
.kpi-num { font-size: 2.5rem; font-weight: 800; color: var(--gold-light); }
.kpi-label { font-size: 0.8rem; color: #aaa; margin-top: 0.3rem; }
.score-strong { background: #1a7a3a; color: #fff; }
.score-qualified { background: #b8860b; color: #fff; }
.score-marginal { background: #c25a00; color: #fff; }
.score-review { background: #a01010; color: #fff; }
.score-badge {
  padding: 0.25rem 0.7rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
}
.lead-table { width: 100%; border-collapse: collapse; }
.lead-table th {
  background: rgba(180,150,60,0.2); color: var(--gold-light); font-size: 0.8rem;
  text-align: left; padding: 0.7rem 1rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.lead-table td { padding: 0.8rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem; }
.lead-table tr:hover { background: rgba(255,255,255,0.04); cursor: pointer; }
.filter-bar { padding: 0 2rem 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn {
  padding: 0.4rem 1rem; border-radius: 20px; border: 1px solid rgba(180,150,60,0.4);
  background: transparent; color: #ccc; cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover { background: var(--gold); color: var(--dark); border-color: var(--gold); }
.detail-panel {
  position: fixed; right: -420px; top: 0; width: 420px; height: 100vh;
  background: #241a06; border-left: 1px solid rgba(180,150,60,0.3);
  overflow-y: auto; z-index: 200; transition: right 0.3s; padding: 2rem;
}
.detail-panel.open { right: 0; }
.detail-close { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; float: right; }
.detail-field { margin-bottom: 1rem; }
.detail-field label { font-size: 0.75rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; }
.detail-field p { font-size: 0.95rem; color: #f0e8d0; margin-top: 0.2rem; }

/* MAP */
#map { height: 500px; width: 100%; }

/* FAQ */
.faq-item { border-bottom: 1px solid rgba(180,150,60,0.2); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none;
  padding: 1.2rem 0; font-size: 1rem; font-weight: 600; color: var(--dark);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.faq-a { display: none; padding: 0 0 1.2rem; color: #555; line-height: 1.7; font-size: 0.95rem; }
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-q { color: var(--gold-dark); }

/* CHATBOT */
.chat-toggle {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 300;
  width: 56px; height: 56px; border-radius: 50%; background: var(--gold);
  border: none; cursor: pointer; font-size: 1.5rem; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.chat-toggle:hover { transform: scale(1.1); }
.chat-window {
  position: fixed; bottom: 6rem; right: 2rem; z-index: 300;
  width: 340px; background: #fff; border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2); display: none; flex-direction: column; overflow: hidden;
}
.chat-window.open { display: flex; }
.chat-header { background: var(--gold); color: var(--dark); padding: 1rem 1.2rem; font-weight: 700; font-size: 0.95rem; }
.chat-messages { flex: 1; padding: 1rem; min-height: 200px; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.8rem; }
.chat-msg { padding: 0.6rem 1rem; border-radius: 10px; font-size: 0.9rem; max-width: 85%; line-height: 1.5; }
.chat-msg.bot { background: #f3f0e8; align-self: flex-start; }
.chat-msg.user { background: var(--gold); color: var(--dark); align-self: flex-end; }
.chat-input-row { display: flex; border-top: 1px solid #eee; }
.chat-input-row input { flex: 1; padding: 0.8rem 1rem; border: none; outline: none; font-size: 16px; }
.chat-input-row button { background: var(--gold); border: none; padding: 0 1.2rem; cursor: pointer; font-size: 1.1rem; color: var(--dark); }

/* FOOTER */
footer {
  position: relative; z-index: 2;
  background: rgba(26,18,8,0.97); color: #aaa; padding: 3rem 2rem 2rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 2rem; max-width: 1100px; margin: 0 auto 2rem; }
.footer-col h4 { color: var(--gold-light); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; }
.footer-col p, .footer-col a { font-size: 0.85rem; color: #999; line-height: 1.8; display: block; }
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom { border-top: 1px solid rgba(180,150,60,0.2); padding-top: 1.5rem; text-align: center; font-size: 0.8rem; max-width: 1100px; margin: 0 auto; }
.footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.footer-inner p { color: #999; font-size: 0.85rem; margin: 0.4rem 0; }
.footer-links { margin-top: 0.8rem; display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--gold); font-size: 0.85rem; }
.footer-links a:hover { color: var(--gold-light); }
.nav-links a.active, .nav-links a[aria-current="page"] { color: var(--gold-light); font-weight: 700; }

/* HOW IT WORKS */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1.5rem; text-align: center; }
.step-num { font-size: 2.5rem; font-weight: 900; color: var(--gold); line-height: 1; }
.step-title { font-size: 1rem; font-weight: 700; color: var(--dark); margin: 0.5rem 0; }
.step-desc { font-size: 0.9rem; color: #666; line-height: 1.6; }

/* RESPONSIVE */
@media(max-width:768px) {
  /* Hide secondary nav links on mobile but keep Apply CTA visible for conversion */
  .nav-links a:not(.btn-nav):not(.nav-cta) { display: none; }
  .nav-links { gap: 0.5rem; }
  .calc-row { grid-template-columns: 1fr; }
  .calc-row.three { grid-template-columns: 1fr; }
  .calc-results { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .stats-bar { gap: 1.5rem; }
  .detail-panel { width: 100%; right: -100%; }
  .tiers-grid { grid-template-columns: 1fr 1fr; }
}
@media(max-width:480px) {
  .tiers-grid { grid-template-columns: 1fr; }
  .calc-results { grid-template-columns: 1fr; }
  .featured-panel { grid-template-columns: 1fr !important; padding: 1.5rem !important; }
}

/* CANONICAL SITE FOOTER — Fair Housing Act §3604(c) + FSBO identity disclosure */
.site-footer {
  position: relative; z-index: 2;
  background: rgba(26,18,8,0.97); color: #d8d0b8;
  padding: 3rem 2rem 2rem;
  border-top: 1px solid rgba(180,150,60,0.3);
}
.site-footer-inner { max-width: 1100px; margin: 0 auto; }
.site-footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem; margin-bottom: 2rem;
}
.site-footer-col h2.site-footer-heading,
.site-footer-heading {
  color: var(--gold-light); font-size: 0.88rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 1rem; font-weight: 700;
}
.site-footer-list { list-style: none; padding: 0; margin: 0; }
.site-footer-list li { margin: 0.35rem 0; }
.site-footer-col a,
.site-footer-list a {
  color: #d8d0b8; font-size: 0.9rem; line-height: 1.7;
  text-decoration: none;
}
.site-footer-col a:hover,
.site-footer-list a:hover {
  color: var(--gold-light); text-decoration: underline;
}
.site-footer-address {
  font-style: normal; font-size: 0.9rem; line-height: 1.75; color: #d8d0b8;
}
.site-footer-hours {
  display: inline-block; margin-top: 0.3rem;
  color: #c8c0a8; font-size: 0.85rem;
}
.site-footer-disclosures {
  border-top: 1px solid rgba(180,150,60,0.2);
  padding: 1.5rem 0; display: grid; gap: 1rem;
}
.site-footer-fairhousing,
.site-footer-fsbo {
  font-size: 0.82rem; line-height: 1.65;
  color: #c8c0a8; margin: 0;
}
.site-footer-fairhousing strong,
.site-footer-fsbo strong { color: #e8dfc2; }
.site-footer-fh-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4em; height: 1.4em; padding: 0.05em;
  margin-right: 0.4rem;
  border: 1.5px solid var(--gold-light); color: var(--gold-light);
  font-weight: 700; border-radius: 3px; font-size: 0.9em;
  vertical-align: -0.2em;
}
.site-footer-bottom {
  border-top: 1px solid rgba(180,150,60,0.2);
  padding-top: 1.5rem; text-align: center;
  font-size: 0.8rem; color: #b0a890;
}
.site-footer-bottom p { margin: 0.2rem 0; line-height: 1.6; }
@media (max-width: 640px) {
  .site-footer { padding: 2.5rem 1.25rem 1.5rem; }
  .site-footer-grid { gap: 1.5rem; }
  .site-footer-fairhousing,
  .site-footer-fsbo { font-size: 0.8rem; }
}

/* REG Z / 12 CFR §1026.24(d) — Trigger-term disclosure block */
.reg-z-disclosure {
  max-width: 1000px; margin: 1.5rem auto 0;
  padding: 1.1rem 1.4rem;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(180,150,60,0.35);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  font-size: 0.82rem; line-height: 1.65; color: #3a342a;
}
.reg-z-disclosure strong { color: var(--gold-dark); }
.reg-z-disclosure .reg-z-title {
  display: block; font-weight: 700; color: var(--gold-dark);
  margin-bottom: 0.4rem; font-size: 0.88rem;
}
.section-dark .reg-z-disclosure {
  background: rgba(255,255,255,0.06); color: #d8d0b8;
  border-color: rgba(180,150,60,0.4);
}
.section-dark .reg-z-disclosure strong,
.section-dark .reg-z-disclosure .reg-z-title { color: var(--gold-light); }

/* Inline FSBO / equal-opportunity micro-notes */
.legal-note {
  font-size: 0.8rem; line-height: 1.6; color: #5a5348;
  margin-top: 0.8rem;
}
.section-dark .legal-note { color: #c8c0a8; }

/* Contrast fix — small helper labels on tier cards previously used #999 */
.tier-card .tier-helper,
.tier-card .tier-sublabel { color: #666; font-size: 0.78rem; margin-top: 4px; }
