/* ═══════════════════════════════════════════════════════════════════════════
   Front Door Grant Finder — Design System & Global Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ────────────────────────────────────────────────── */
:root {
  /* Colors */
  --color-bg-primary: #0a0a1a;
  --color-bg-secondary: #0f0f2a;
  --color-bg-tertiary: #141432;
  --color-bg-card: rgba(255, 255, 255, 0.04);
  --color-bg-card-hover: rgba(255, 255, 255, 0.08);

  --color-purple: #533483;
  --color-purple-light: #7c4dbd;
  --color-coral: #e94560;
  --color-coral-dark: #c23152;
  --color-teal: #00d9ff;
  --color-teal-dark: #00b8d9;
  --color-green: #00e676;
  --color-green-dark: #00c853;
  --color-yellow: #ffd740;
  --color-orange: #ff9100;
  --color-red: #ff5252;

  --color-text-primary: #f0f0f5;
  --color-text-secondary: rgba(240, 240, 245, 0.7);
  --color-text-muted: rgba(240, 240, 245, 0.45);

  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-hover: rgba(255, 255, 255, 0.2);

  /* Gradients */
  --gradient-coral: linear-gradient(135deg, #e94560 0%, #c23152 100%);
  --gradient-purple: linear-gradient(135deg, #533483 0%, #7c4dbd 100%);
  --gradient-teal: linear-gradient(135deg, #00b8d9 0%, #00d9ff 100%);
  --gradient-hero: linear-gradient(135deg, #0a0a1a 0%, #1a1040 30%, #0f0f2a 60%, #0a0a1a 100%);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3.5rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-coral: 0 0 20px rgba(233, 69, 96, 0.3);
  --shadow-glow-teal: 0 0 20px rgba(0, 217, 255, 0.3);
  --shadow-glow-purple: 0 0 20px rgba(83, 52, 131, 0.4);
  --shadow-glow-green: 0 0 20px rgba(0, 230, 118, 0.3);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);

  /* Navbar */
  --navbar-height: 72px;
}

/* ─── CSS Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--color-teal); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-teal-dark); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

::selection {
  background: var(--color-coral);
  color: #fff;
}

/* ─── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg-primary); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* ─── Container ────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ─── Typography ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-primary);
}
h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

.page-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}
.page-header h1 {
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}
.section-title {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-xl);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.8rem 1.8rem;
  font-size: var(--font-size-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-coral);
  color: #fff;
  box-shadow: var(--shadow-glow-coral);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
  color: #fff;
}
.btn-secondary {
  background: transparent;
  color: var(--color-teal);
  border: 2px solid var(--color-teal);
}
.btn-secondary:hover {
  background: rgba(0, 217, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-teal);
  color: var(--color-teal);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  background: var(--glass-bg);
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--font-size-sm);
}

/* ─── Form Inputs ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-lg); }
.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  backdrop-filter: var(--glass-blur);
  transition: all 0.3s ease;
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.15);
}
.form-input::placeholder { color: var(--color-text-muted); }
.form-select { cursor: pointer; }
.form-select option { background: var(--color-bg-secondary); color: var(--color-text-primary); }
.form-textarea { min-height: 100px; resize: vertical; }

/* ─── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  backdrop-filter: var(--glass-blur);
  transition: all 0.3s ease;
}
.card:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ─── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-federal { background: rgba(66, 133, 244, 0.2); color: #64b5f6; border: 1px solid rgba(66, 133, 244, 0.3); }
.badge-state_local { background: rgba(0, 230, 118, 0.15); color: var(--color-green); border: 1px solid rgba(0, 230, 118, 0.3); }
.badge-utility { background: rgba(255, 215, 64, 0.15); color: var(--color-yellow); border: 1px solid rgba(255, 215, 64, 0.3); }
.badge-nonprofit { background: rgba(124, 77, 189, 0.2); color: var(--color-purple-light); border: 1px solid rgba(124, 77, 189, 0.3); }
.badge-grant { background: rgba(0, 230, 118, 0.15); color: var(--color-green); }
.badge-loan { background: rgba(255, 145, 0, 0.15); color: var(--color-orange); }
.badge-rebate { background: rgba(0, 217, 255, 0.15); color: var(--color-teal); }
.badge-mixed { background: rgba(124, 77, 189, 0.15); color: var(--color-purple-light); }

/* ─── Status Indicators ────────────────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: var(--space-sm);
}
.status-likely_eligible .status-dot { background: var(--color-green); box-shadow: 0 0 8px rgba(0, 230, 118, 0.6); }
.status-may_be_eligible .status-dot { background: var(--color-yellow); box-shadow: 0 0 8px rgba(255, 215, 64, 0.6); }
.status-likely_ineligible .status-dot { background: var(--color-red); box-shadow: 0 0 8px rgba(255, 82, 82, 0.6); }

.status-text { font-weight: 600; font-size: var(--font-size-sm); }
.status-likely_eligible .status-text { color: var(--color-green); }
.status-may_be_eligible .status-text { color: var(--color-yellow); }
.status-likely_ineligible .status-text { color: var(--color-red); }

/* ─── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary) !important;
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: var(--space-sm);
}
.nav-link {
  padding: 0.5rem 1rem;
  color: var(--color-text-secondary) !important;
  font-weight: 500;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.nav-link:hover {
  color: var(--color-text-primary) !important;
  background: var(--glass-bg);
}
.nav-link.active {
  color: var(--color-teal) !important;
  background: rgba(0, 217, 255, 0.08);
}

/* ─── Mobile Menu ──────────────────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
}
.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.mobile-menu-btn.open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.open .hamburger-line:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(24px);
    flex-direction: column;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
  }
  .nav-links.open { display: flex; }
  .nav-link {
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base);
  }
}

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: var(--space-3xl) 0 var(--space-xl);
  text-align: center;
}
.footer-brand {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-md);
}
.footer-disclaimer {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  max-width: 600px;
  margin: 0 auto var(--space-md);
  line-height: 1.8;
}
.footer-copyright {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

/* ─── Toast Notifications ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + var(--space-md));
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1rem;
  background: var(--color-bg-tertiary);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 420px;
  opacity: 0;
  transform: translateX(100%);
}
.toast-enter {
  opacity: 1;
  transform: translateX(0);
  transition: all 0.3s ease;
}
.toast-exit {
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}
.toast-icon { font-size: var(--font-size-lg); flex-shrink: 0; }
.toast-message { flex: 1; font-size: var(--font-size-sm); }
.toast-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
  padding: 0 4px;
  cursor: pointer;
}
.toast-success { border-left: 3px solid var(--color-green); }
.toast-success .toast-icon { color: var(--color-green); }
.toast-error { border-left: 3px solid var(--color-red); }
.toast-error .toast-icon { color: var(--color-red); }
.toast-warning { border-left: 3px solid var(--color-yellow); }
.toast-warning .toast-icon { color: var(--color-yellow); }
.toast-info { border-left: 3px solid var(--color-teal); }
.toast-info .toast-icon { color: var(--color-teal); }

/* ─── Category Tag Pills ───────────────────────────────────────────────────── */
.category-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: var(--font-size-xs);
  background: rgba(83, 52, 131, 0.2);
  color: var(--color-purple-light);
  border-radius: var(--radius-full);
  border: 1px solid rgba(83, 52, 131, 0.3);
}

/* ─── Loading Skeleton ─────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255,255,255,0.08) 50%, var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
.skeleton-text { height: 1rem; margin-bottom: var(--space-sm); }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: var(--space-md); }
.skeleton-card { height: 180px; margin-bottom: var(--space-md); }

/* ─── Responsive Typography ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  .container { padding: 0 var(--space-md); }
}
