/* ─── RESET & TOKENS ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #0e1b2e;
  --navy-mid:    #142339;
  --navy-light:  #1e3254;
  --gold:        #c9922a;
  --gold-light:  #e8a83a;
  --gold-pale:   #f5e9d0;
  --cream:       #f7f4ef;
  --text-primary: #1a1a2e;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;
  --card-bg:     #ffffff;
  --surface:     #f7f4ef;
  --success:     #166534;
  --success-bg:  #dcfce7;
  --warn-bg:     #fef9ec;
  --warn-border: #f0c842;
  --alert-bg:    #fff1f2;
  --alert-border:#fda4af;

  --font-display: 'Cabinet Grotesk', 'Segoe UI', sans-serif;
  --font-body:    'Satoshi', 'Segoe UI', sans-serif;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.10);
}

[data-theme="dark"] {
  --navy:        #0a1628;
  --navy-mid:    #0f1f3d;
  --navy-light:  #1a2f52;
  --cream:       #0e1b2e;
  --text-primary: #f0ece4;
  --text-muted:  #9ca3af;
  --border:      #1e3254;
  --card-bg:     #0f1f3d;
  --surface:     #0a1628;
  --success:     #4ade80;
  --success-bg:  #052e16;
  --warn-bg:     #1c1400;
  --warn-border: #92650a;
  --alert-bg:    #1c0a0a;
  --alert-border:#991b1b;
  --gold-pale:   #2a1e07;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background 0.3s, color 0.3s;
}

/* ─── NAVBAR ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.navbar-gold-bar { height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}
.brand-icon { width: 32px; height: 32px; color: var(--gold); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: -0.01em;
}
.brand-sub { font-size: 0.68rem; color: rgba(255,255,255,0.55); font-weight: 400; }

.nav-center { flex: 1; display: flex; justify-content: center; }
.portal-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}
.portal-link:hover { color: var(--gold-light); }

.theme-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 6px 8px;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* ─── HERO ─── */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 55%, var(--navy-light) 100%);
  padding: 64px 24px 56px;
}
.hero-inner { max-width: 860px; margin: 0 auto; }

.badge {
  display: inline-block;
  background: rgba(201,146,42,0.18);
  border: 1px solid rgba(201,146,42,0.4);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.72);
  max-width: 640px;
  margin-bottom: 40px;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  gap: 0;
}
.stat { padding: 0 32px 0 0; }
.stat:first-child { padding-left: 0; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45);
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  margin-right: 32px;
}

/* ─── AZ NOTE ─── */
.az-note-section { padding: 24px 24px 0; }
.container { max-width: 1100px; margin: 0 auto; }
.az-note {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--gold-pale);
  border: 1px solid rgba(201,146,42,0.3);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 32px;
}
.az-note-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 1px; }
.az-note-text { font-size: 0.92rem; line-height: 1.65; color: var(--text-primary); }
.az-note-text strong { color: var(--text-primary); }

/* ─── SECTIONS ─── */
.timeline-section,
.bring-section,
.costs-section,
.dodont-section,
.glossary-section { padding: 64px 24px; }
.bring-section,
.glossary-section { background: var(--card-bg); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.section-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 640px;
}

/* ─── TIMELINE ─── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0 24px;
  position: relative;
}
.timeline-item.last .marker-line { display: none; }

.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.marker-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
  z-index: 1;
}
.marker-circle.gold {
  background: var(--gold);
  border-color: var(--gold-light);
  color: var(--navy);
}
[data-theme="light"] .marker-circle { background: #fff; }
[data-theme="light"] .marker-circle.gold { background: var(--gold); color: #fff; }

.marker-line {
  flex: 1;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold) 0%, rgba(201,146,42,0.2) 100%);
  margin: 4px 0;
  min-height: 32px;
}

.timeline-content {
  padding-bottom: 48px;
  padding-top: 8px;
}
.timeline-item.last .timeline-content { padding-bottom: 0; }

.timeline-header { margin-bottom: 10px; }
.step-day {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.step-day.gold-text { color: var(--gold-light); }
.step-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.step-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.65;
}
.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.step-list li {
  font-size: 0.875rem;
  color: var(--text-primary);
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}
.step-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.7;
}
.step-tip {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-primary);
}
.step-tip.success {
  background: var(--success-bg);
  border-color: #86efac;
  border-left-color: #22c55e;
  color: var(--success);
}
[data-theme="dark"] .step-tip.success { color: #4ade80; }
.step-tip strong { font-weight: 700; }
.step-tip em { font-style: italic; }

/* ─── WHAT TO BRING ─── */
.bring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.bring-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.bring-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.bring-card.required { border-top: 3px solid var(--gold); }
.bring-card.recommended { border-top: 3px solid var(--navy-light); }
[data-theme="dark"] .bring-card.recommended { border-top-color: #4a6fa5; }

.bring-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.bring-card-header svg { color: var(--gold); flex-shrink: 0; }
.bring-card-header h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
.required-badge {
  background: rgba(201,146,42,0.15);
  border: 1px solid rgba(201,146,42,0.35);
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.recommended-badge {
  background: rgba(30,50,84,0.15);
  border: 1px solid rgba(30,50,84,0.2);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
[data-theme="dark"] .recommended-badge { background: rgba(74,111,165,0.15); border-color: rgba(74,111,165,0.3); color: #9ca3af; }
.bring-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.65; }

/* ─── CLOSING COSTS TABLE ─── */
.costs-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.costs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.costs-table thead tr {
  background: var(--navy);
  color: #fff;
}
.costs-table th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 18px;
  text-align: left;
  white-space: nowrap;
}
.costs-table tbody tr {
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  transition: background 0.15s;
}
.costs-table tbody tr:last-child { border-bottom: none; }
.costs-table tbody tr:hover { background: var(--surface); }
.costs-table td { padding: 13px 18px; color: var(--text-primary); vertical-align: middle; }

.payer {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.payer.buyer { background: rgba(201,146,42,0.15); color: var(--gold); border: 1px solid rgba(201,146,42,0.3); }
.payer.split { background: rgba(30,50,84,0.1); color: var(--text-muted); border: 1px solid var(--border); }
[data-theme="dark"] .payer.split { background: rgba(74,111,165,0.15); border-color: rgba(74,111,165,0.3); }

.costs-note {
  font-size: 0.83rem;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--gold-pale);
  border: 1px solid rgba(201,146,42,0.2);
  border-radius: var(--radius-sm);
  font-style: italic;
}

/* ─── DO / DON'T ─── */
.dodont-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.do-column, .dont-column {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.dodont-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.dodont-header.do { background: #166534; color: #dcfce7; }
.dodont-header.dont { background: #991b1b; color: #fee2e2; }
[data-theme="dark"] .dodont-header.do { background: #14532d; }
[data-theme="dark"] .dodont-header.dont { background: #7f1d1d; }

.dodont-list {
  list-style: none;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card-bg);
}
.dodont-list li {
  font-size: 0.875rem;
  color: var(--text-primary);
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}
.do-column .dodont-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #22c55e;
  font-weight: 700;
  font-size: 0.8rem;
}
.dont-column .dodont-list li::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: #ef4444;
  font-weight: 700;
  font-size: 0.8rem;
}

/* ─── GLOSSARY ─── */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.glossary-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.glossary-item dt {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}
.glossary-item dd {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── CTA ─── */
.cta-section { padding: 64px 24px; }
.cta-box {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.cta-icon { font-size: 2.5rem; margin-bottom: 16px; }
.cta-box h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.cta-box p {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.cta-btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}
.cta-btn:hover { background: var(--gold-light); transform: translateY(-2px); }

/* ─── FOOTER ─── */
.footer {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 20px 24px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
}
.footer-inner a {
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-inner a:hover { color: var(--gold); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .hero { padding: 48px 20px 44px; }
  .hero-stats { flex-direction: column; gap: 16px; align-items: flex-start; }
  .stat-divider { display: none; }
  .stat { padding: 0; }

  .timeline-item { grid-template-columns: 44px 1fr; gap: 0 16px; }
  .marker-circle { width: 36px; height: 36px; }
  .marker-circle svg { width: 16px; height: 16px; }

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

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

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

  .cta-box { padding: 36px 24px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }

  .navbar-inner { padding: 0 16px; }
  .brand-sub { display: none; }

  .costs-table th, .costs-table td { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .timeline-section, .bring-section, .costs-section,
  .dodont-section, .glossary-section, .cta-section { padding: 48px 16px; }
  .az-note-section { padding: 16px 16px 0; }
  .container { padding: 0; }
  .step-title { font-size: 1rem; }
}
