/* ─── 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;
  --shadow:       0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.10);
  --radius:       12px;
  --radius-sm:    8px;
  --font-display: 'Cabinet Grotesk', 'Segoe UI', sans-serif;
  --font-body:    'Satoshi', 'Segoe UI', sans-serif;
}

[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;
  --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); }
.nav-center { flex: 1; display: flex; justify-content: center; }
.portal-link { font-size: 0.875rem; font-weight: 500; color: rgba(255,255,255,0.75); text-decoration: none; transition: color 0.2s; }
.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; flex-shrink: 0; transition: background 0.2s;
}
.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.2rem, 5vw, 3.4rem);
  font-weight: 800; color: #fff; letter-spacing: -0.03em; margin-bottom: 20px;
}
.hero-desc { font-size: 1.05rem; color: rgba(255,255,255,0.72); max-width: 680px; margin-bottom: 40px; line-height: 1.7; }
.hero-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.stat { padding: 0 32px 0 0; }
.stat-num { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--gold-light); line-height: 1; margin-bottom: 4px; }
.stat-label { display: block; font-size: 0.67rem; font-weight: 600; letter-spacing: 0.1em; color: rgba(255,255,255,0.45); }
.stat-divider { width: 1px; height: 38px; background: rgba(255,255,255,0.15); margin-right: 32px; }

/* ─── HOW TO USE ─── */
.howto-section { padding: 24px 24px 0; }
.container { max-width: 1100px; margin: 0 auto; }
.howto-bar {
  background: var(--navy); border-radius: var(--radius);
  padding: 22px 28px;
}
.howto-title {
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5); margin-bottom: 14px;
}
.howto-steps {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.howto-step {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 0.875rem; color: rgba(255,255,255,0.75); line-height: 1.55;
}
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ─── LENDERS MAIN ─── */
.lenders-main { padding: 32px 24px 0; }

/* ─── CATEGORY BLOCK ─── */
.category-block { margin-bottom: 48px; }

.category-header {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 20px;
}
.category-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.category-icon.featured { background: rgba(201,146,42,0.15); color: var(--gold); }
.category-icon.newbuild  { background: rgba(59,130,246,0.12); color: #2563eb; }
.category-icon.credit    { background: rgba(34,197,94,0.12);  color: #15803d; }
[data-theme="dark"] .category-icon.newbuild { color: #60a5fa; }
[data-theme="dark"] .category-icon.credit   { color: #4ade80; }

.category-title {
  font-family: var(--font-display); font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.category-sub {
  font-size: 0.875rem; color: var(--text-muted); line-height: 1.55; max-width: 600px;
}

/* ─── LENDER GRID ─── */
.lender-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* ─── LENDER CARD ─── */
.lender-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
}
.lender-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* Featured "Local Favorite" card */
.featured-card {
  border-color: rgba(201,146,42,0.4);
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--gold-pale) 100%);
}
[data-theme="dark"] .featured-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(42,30,7,0.6) 100%);
}

.featured-badge {
  position: absolute; top: -1px; right: 20px;
  background: var(--gold); color: var(--navy);
  font-family: var(--font-display); font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.06em; padding: 3px 10px;
  border-radius: 0 0 8px 8px;
}

/* ─── LENDER TOP ─── */
.lender-top { display: flex; flex-direction: column; gap: 8px; }
.lender-name {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 800;
  color: var(--text-primary); letter-spacing: -0.01em; line-height: 1.25;
}
.lender-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Tags */
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em; padding: 3px 9px; border-radius: 100px;
}
.tag.credit    { background: rgba(34,197,94,0.12);  color: #15803d; border: 1px solid rgba(34,197,94,0.25); }
.tag.dpa       { background: rgba(201,146,42,0.12); color: #92680d; border: 1px solid rgba(201,146,42,0.3); }
.tag.newbuild  { background: rgba(59,130,246,0.12); color: #1d4ed8; border: 1px solid rgba(59,130,246,0.25); }
.tag.local     { background: rgba(139,92,246,0.10); color: #6d28d9; border: 1px solid rgba(139,92,246,0.2); }
.tag.online    { background: rgba(14,27,46,0.07);   color: var(--text-muted); border: 1px solid var(--border); }
.tag.directory { background: rgba(107,114,128,0.1); color: var(--text-muted); border: 1px solid var(--border); }

[data-theme="dark"] .tag.credit   { color: #4ade80; }
[data-theme="dark"] .tag.dpa      { color: var(--gold-light); border-color: rgba(201,146,42,0.35); }
[data-theme="dark"] .tag.newbuild { color: #60a5fa; }
[data-theme="dark"] .tag.local    { color: #a78bfa; }
[data-theme="dark"] .tag.online,
[data-theme="dark"] .tag.directory { color: var(--text-muted); border-color: var(--border); }

/* ─── LENDER DESC ─── */
.lender-desc {
  font-size: 0.875rem; color: var(--text-muted); line-height: 1.7;
  flex: 1;
}

/* ─── LENDER DETAILS ─── */
.lender-details { display: flex; flex-direction: column; gap: 7px; }
.lender-detail-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.82rem; color: var(--text-primary); line-height: 1.5;
}
.lender-detail-item svg { color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.lender-detail-item strong { font-weight: 600; }

/* ─── LENDER ACTIONS ─── */
.lender-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.btn-primary {
  display: inline-block; background: var(--gold); color: var(--navy);
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 700;
  padding: 9px 16px; border-radius: 8px; text-decoration: none;
  transition: background 0.2s, transform 0.15s; white-space: nowrap;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }

.btn-secondary {
  display: inline-block; background: var(--surface); color: var(--text-primary);
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 600;
  padding: 9px 14px; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s; white-space: nowrap;
}
.btn-secondary:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ─── AGENT NOTE ─── */
.agent-note-section { padding: 0 24px 32px; }
.agent-note {
  display: flex; align-items: flex-start; gap: 16px;
  background: var(--gold-pale);
  border: 1px solid rgba(201,146,42,0.3);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 24px;
  max-width: 860px; margin: 0 auto;
}
.agent-note svg { color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.agent-note strong {
  display: block; font-family: var(--font-display); font-size: 0.95rem;
  font-weight: 700; color: var(--text-primary); margin-bottom: 6px;
}
.agent-note p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; }

/* ─── CTA ─── */
.cta-section { padding: 0 24px 64px; }
.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;
}
.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.76rem; 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: 14px; }
  .stat-divider { display: none; }
  .stat { padding: 0; }
  .howto-section { padding: 20px 20px 0; }
  .howto-steps { grid-template-columns: 1fr; gap: 10px; }
  .lenders-main { padding: 24px 20px 0; }
  .agent-note-section { padding: 0 20px 24px; }
  .cta-section { padding: 0 20px 48px; }
  .lender-grid { grid-template-columns: 1fr; }
  .cta-box { padding: 36px 24px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .navbar-inner { padding: 0 16px; }
  .brand-sub { display: none; }
}

@media (max-width: 480px) {
  .howto-section, .lenders-main, .agent-note-section, .cta-section { padding-left: 16px; padding-right: 16px; }
  .howto-bar { padding: 18px 18px; }
  .lender-card { padding: 18px 18px 16px; }
  .agent-note { padding: 16px 18px; }
  .category-title { font-size: 1.25rem; }
}
