@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #F8FAFC; --surface: #FFFFFF; --border: #E2E8F0; --border-light: #F1F5F9;
  --text: #1E293B; --text-secondary: #64748B; --text-muted: #94A3B8;
  --primary: #0F172A; --accent: #1E40AF; --accent-light: #DBEAFE; --accent-hover: #1D4ED8;
  --green: #059669; --green-light: #D1FAE5; --green-bg: #ECFDF5;
  --orange: #D97706; --orange-light: #FEF3C7;
  --red: #DC2626; --red-light: #FEE2E2;
  --purple: #7C3AED; --purple-light: #EDE9FE;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.65; font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ── NAV ── */
.sticky-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: 0;
}
.sticky-nav .container {
  display: flex; gap: 4px; overflow-x: auto; padding: 10px 24px;
  scrollbar-width: none;
}
.sticky-nav .container::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); text-decoration: none; white-space: nowrap;
  transition: all .2s;
}
.nav-link:hover, .nav-link.active { background: var(--accent-light); color: var(--accent); }

/* ── HERO ── */
.hero {
  padding: 64px 0 48px; text-align: center;
  background: linear-gradient(180deg, #EEF2FF 0%, var(--bg) 100%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-bg); color: var(--green); border: 1px solid #A7F3D0;
  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  margin-bottom: 20px; letter-spacing: .02em;
}
.hero-badge::before { content: ''; width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.hero h1 { font-size: 36px; font-weight: 800; color: var(--primary); line-height: 1.2; margin-bottom: 12px; letter-spacing: -.02em; }
.hero h1 span { background: linear-gradient(135deg, var(--accent), #7C3AED); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero .subtitle { font-size: 17px; color: var(--text-secondary); max-width: 600px; margin: 0 auto 24px; }
.hero-meta { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.hero-meta strong { color: var(--text); }

/* ── SECTION ── */
.section { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--border-light); }
.section-header { margin-bottom: 32px; }
.section-num { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.section-title { font-size: 24px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.section-desc { font-size: 15px; color: var(--text-secondary); max-width: 640px; }

/* ── CARDS ── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow);
  transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: #CBD5E1; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 12px; }
.card-title { font-size: 17px; font-weight: 700; color: var(--primary); }
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.card-badge {
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.badge-green { background: var(--green-light); color: var(--green); }
.badge-blue { background: var(--accent-light); color: var(--accent); }
.badge-orange { background: var(--orange-light); color: var(--orange); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-red { background: var(--red-light); color: var(--red); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card-stat { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.card-stat .val { font-size: 20px; font-weight: 700; color: var(--accent); }
.card-stat .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.card-detail { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.card-detail p { margin-bottom: 8px; }
.card-detail strong { color: var(--text); }
.card-results { background: var(--green-bg); border: 1px solid #A7F3D0; border-radius: var(--radius-sm); padding: 16px; margin: 12px 0; }
.card-results .results-title { font-size: 13px; font-weight: 700; color: var(--green); margin-bottom: 8px; }

.tier-label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 20px; }
.tier-1 { background: #FEF3C7; color: #92400E; }
.tier-2 { background: var(--accent-light); color: var(--accent); }
.tier-3 { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── FILTER BAR ── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; align-items: center;
}
.search-input {
  flex: 1; min-width: 200px; padding: 10px 14px 10px 38px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; background: var(--surface);
  transition: border-color .2s; outline: none;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-btn {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 20px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  background: var(--surface); color: var(--text-secondary); cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ── TABLE ── */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.data-table thead th {
  background: var(--bg); padding: 10px 14px; text-align: left;
  font-weight: 600; font-size: 12px; color: var(--text-muted);
  letter-spacing: .04em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); position: sticky; top: 50px; z-index: 5;
}
.data-table tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #F8FAFC; }
.data-table .fund-name { font-weight: 600; color: var(--primary); }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow); overflow-x: auto; }

/* ── CHECKLIST ── */
.checklist { list-style: none; }
.checklist li {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border-light); font-size: 14px;
  transition: background .15s; cursor: pointer;
}
.checklist li:last-child { border-bottom: none; }
.checklist li:hover { background: var(--bg); }
.checklist li.checked { color: var(--text-muted); }
.checklist li.checked .check-text { text-decoration: line-through; }
.check-box {
  width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 5px;
  flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.checklist li.checked .check-box { background: var(--green); border-color: var(--green); }
.checklist li.checked .check-box::after { content: '✓'; color: white; font-size: 12px; font-weight: 700; }
.check-cat { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-light); padding: 2px 8px; border-radius: 8px; margin-left: auto; flex-shrink: 0; }
.progress-bar { background: var(--border-light); height: 6px; border-radius: 3px; margin-bottom: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width .4s ease; }
.progress-text { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

/* ── COPY TEMPLATE ── */
.template-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow);
}
.template-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.template-title { font-size: 14px; font-weight: 600; color: var(--primary); }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; color: var(--text-secondary);
  transition: all .2s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { background: var(--green); border-color: var(--green); color: white; }
.template-body { padding: 20px; font-size: 14px; color: var(--text); line-height: 1.75; white-space: pre-wrap; }

/* ── CTA ── */
.section-cta {
  margin-top: 32px; padding: 24px; border-radius: var(--radius);
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  border: 1px solid #C7D2FE; text-align: center;
}
.section-cta h3 { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.section-cta p { font-size: 14px; color: var(--text-secondary); margin-bottom: 14px; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; background: var(--accent); color: white;
  border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; text-decoration: none;
  transition: background .2s;
}
.cta-btn:hover { background: var(--accent-hover); }

/* ── NOTES / INSIGHT ── */
.insight-card {
  background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.insight-num { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.insight-title { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.insight-text { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ── FOOTER ── */
.footer {
  padding: 48px 0; background: var(--primary); color: #CBD5E1; text-align: center;
}
.footer h3 { font-size: 20px; color: white; font-weight: 700; margin-bottom: 8px; }
.footer p { font-size: 14px; max-width: 500px; margin: 0 auto 20px; }
.footer-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: #93C5FD; text-decoration: none; font-size: 14px; font-weight: 500; }
.footer-links a:hover { color: white; }
.footer-bottom { margin-top: 32px; padding-top: 24px; border-top: 1px solid #334155; font-size: 12px; color: #64748B; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 10px 18px; font-size: 13px; font-weight: 600; font-family: inherit;
  border: none; background: none; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { background: var(--bg); padding: 1px 7px; border-radius: 10px; font-size: 11px; margin-left: 6px; }

/* ── GOV BENEFITS ── */
.benefit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.benefit-item {
  background: var(--green-bg); border: 1px solid #A7F3D0; border-radius: var(--radius-sm);
  padding: 14px; text-align: center;
}
.benefit-val { font-size: 24px; font-weight: 800; color: var(--green); }
.benefit-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ── RESPONSIVE ── */

/* Nav scroll fade indicator */
.sticky-nav .container {
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}

@media (min-width: 769px) {
  .sticky-nav .container { -webkit-mask-image: none; mask-image: none; }
}

/* ── TABLET & MOBILE TABLE CARDS (≤768) ── */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .hero h1 { font-size: 28px; }
  .hero .subtitle { font-size: 15px; }
  .section-title { font-size: 20px; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .benefit-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 10px 14px; white-space: nowrap; }

  /* ─── TABLE → STACKED CARDS ─── */
  .table-wrap { overflow-x: visible; }
  .data-table thead { display: none; }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td { display: block; width: 100%; }
  .data-table tbody tr {
    padding: 16px; margin-bottom: 0;
    border-bottom: 1px solid var(--border-light);
    position: relative;
  }
  .data-table tbody tr:last-child { border-bottom: none; }
  .data-table tbody td {
    padding: 4px 0; border-bottom: none;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; font-size: 14px;
  }
  .data-table tbody td::before {
    content: attr(data-label);
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .04em;
    flex-shrink: 0; min-width: 72px;
    padding-top: 2px;
  }
  .data-table tbody td:first-child { padding-top: 0; }
  .data-table tbody td:first-child::before { display: none; }
  .data-table tbody td:first-child {
    display: block; font-size: 15px; font-weight: 600;
    margin-bottom: 6px; color: var(--primary);
  }
  .data-table .fund-name { font-size: 15px; }
}

/* ── MOBILE (≤480) ── */
@media (max-width: 480px) {
  .container { padding: 0 16px; }

  /* Hero */
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 24px; letter-spacing: -.01em; }
  .hero h1 br { display: none; }
  .hero .subtitle { font-size: 14px; margin-bottom: 20px; }
  .hero-badge { font-size: 11px; padding: 4px 12px; }
  .hero-meta { flex-direction: column; gap: 6px; font-size: 12px; }

  /* Nav */
  .nav-link { padding: 5px 10px; font-size: 12px; }

  /* Sections */
  .section { padding: 28px 0; }
  .section-header { margin-bottom: 20px; }
  .section-title { font-size: 18px; }
  .section-desc { font-size: 13px; }
  .section-num { font-size: 11px; }

  /* Cards */
  .card { padding: 16px; margin-bottom: 12px; }
  .card-title { font-size: 15px; }
  .card-subtitle { font-size: 12px; }
  .card-badge { font-size: 10px; padding: 2px 8px; }
  .card-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
  .card-stat { padding: 10px 6px; }
  .card-stat .val { font-size: 16px; }
  .card-stat .label { font-size: 10px; }
  .card-detail { font-size: 13px; }
  .card-results { padding: 12px; margin: 8px 0; }
  .tier-label { font-size: 12px; padding: 5px 12px; }

  /* Benefits grid */
  .benefit-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .benefit-item { padding: 10px 8px; }
  .benefit-val { font-size: 20px; }
  .benefit-label { font-size: 11px; }

  /* Filter bar */
  .filter-bar { flex-direction: column; gap: 8px; }
  .search-wrap { width: 100%; min-width: 0; }
  .search-input { min-width: 0; width: 100%; font-size: 14px; }

  /* Tabs */
  .tabs { gap: 0; }
  .tab { padding: 8px 12px; font-size: 12px; flex-shrink: 0; }
  .tab-count { font-size: 10px; padding: 1px 5px; margin-left: 4px; }

  /* Table card refinements for narrow screens */
  .data-table tbody tr { padding: 12px 14px; }
  .data-table tbody td { font-size: 13px; gap: 10px; }
  .data-table tbody td:first-child { font-size: 14px; }
  .data-table .fund-name { font-size: 14px; }

  /* Checklist */
  .checklist li { padding: 10px 12px; gap: 10px; font-size: 13px; }
  .check-box { width: 18px; height: 18px; }
  .check-cat { font-size: 10px; padding: 2px 6px; }

  /* Templates */
  .template-header { padding: 12px 16px; }
  .template-title { font-size: 13px; }
  .template-body { padding: 14px 16px; font-size: 13px; line-height: 1.7; }
  .copy-btn { padding: 5px 10px; font-size: 11px; }

  /* CTA */
  .section-cta { padding: 20px 16px; margin-top: 24px; }
  .section-cta h3 { font-size: 15px; }
  .section-cta p { font-size: 13px; }
  .cta-btn { padding: 10px 20px; font-size: 13px; width: 100%; justify-content: center; }

  /* Insights */
  .insight-card { padding: 16px 18px; }
  .insight-title { font-size: 14px; }
  .insight-text { font-size: 13px; }

  /* Footer */
  .footer { padding: 32px 0; }
  .footer h3 { font-size: 17px; }
  .footer p { font-size: 13px; }
  .footer-links { gap: 10px; font-size: 13px; }
  .footer-links a { font-size: 13px; }
  .footer-bottom { margin-top: 20px; padding-top: 16px; font-size: 11px; }
}
