/* ==========================================================================
   Expense Analyzer - Modern Dark SaaS Design System
   Color Palette: Emerald (#10B981), Logo Teal (#00C9A7), Navy/Obsidian Slate
   Fonts: Plus Jakarta Sans & Outfit
   ========================================================================== */

:root {
  --bg-dark: #090D14;
  --bg-surface: #111723;
  --bg-card: #17202E;
  --bg-card-hover: #1E2A3C;
  --bg-glass: rgba(23, 32, 46, 0.75);

  --emerald: #10B981;
  --emerald-dark: #059669;
  --emerald-light: #34D399;
  --emerald-glow: rgba(16, 185, 129, 0.2);

  --teal: #00C9A7;
  --teal-glow: rgba(0, 201, 167, 0.18);

  --blue-accent: #3B82F6;
  --indigo-accent: #6366F1;
  --purple-accent: #8B5CF6;
  --amber-accent: #F59E0B;
  --red-accent: #EF4444;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(16, 185, 129, 0.4);
  --border-card: rgba(255, 255, 255, 0.06);

  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 35px rgba(16, 185, 129, 0.15);
  --transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-dark);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Grids & Glows */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  height: 600px;
  background: radial-gradient(circle at 50% 10%, rgba(16, 185, 129, 0.12) 0%, rgba(0, 201, 167, 0.05) 35%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }

p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

a {
  color: var(--emerald-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--teal);
}

.gradient-text {
  background: linear-gradient(135deg, #FFFFFF 20%, var(--teal) 60%, var(--emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navbar - Fixed 72px height to prevent layout shifts */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  height: 72px;
  background: #090D14;
  background: rgba(9, 13, 20, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  align-items: center;
  contain: layout style;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  height: 38px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  height: 100%;
}

/* Fixed font-weight: 600 across all links to prevent width jumps on active state */
.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s ease;
  position: relative;
  display: inline-block;
  padding: 4px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

.nav-link.active {
  color: var(--emerald-light);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--emerald);
  border-radius: var(--radius-full);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mobile Nav Drawer - Strictly Hidden by default on Desktop */
.mobile-nav {
  display: none !important;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal) 0%, var(--emerald) 100%);
  color: #04121A;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(16, 185, 129, 0.45);
  color: #000;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--emerald-glow);
  border: 1px solid var(--border-active);
  color: var(--emerald-light);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

/* Hero Section */
.hero {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 860px;
  margin: 0 auto 32px;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin: 20px 0 28px;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-banner-wrap {
  position: relative;
  max-width: 1080px;
  margin: 32px auto 0;
  border-radius: var(--radius-lg);
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-glow);
}

.hero-banner {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 40px 0 20px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--emerald-light);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Carousel Section */
.carousel-section {
  padding: 50px 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 36px;
}

.section-header p {
  margin-top: 12px;
}

.carousel-container {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 32px 20px;
  box-shadow: var(--shadow-sm);
}

.carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-slide {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
}

.phone-mockup {
  position: relative;
  width: 280px;
  max-width: 80vw;
  border-radius: 36px;
  border: 8px solid #222938;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  background: #000;
  overflow: hidden;
}

.phone-mockup img {
  width: 100%;
  height: auto;
  display: block;
}

.slide-caption {
  text-align: center;
  max-width: 540px;
}

.slide-caption h4 {
  font-size: 1.35rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.slide-caption p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.carousel-btn:hover {
  background: var(--emerald);
  color: #000;
  border-color: var(--emerald);
}

.carousel-btn.prev { left: -24px; }
.carousel-btn.next { right: -24px; }

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.indicator.active {
  width: 32px;
  border-radius: 12px;
  background: var(--emerald);
}

/* Feature Cards & Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 28px;
  margin-top: 32px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--emerald-glow);
  border: 1px solid var(--border-active);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-light);
  margin-bottom: 16px;
}

.card h3 {
  margin-bottom: 10px;
}

.card-list {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.card-list svg {
  color: var(--emerald);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Tabbed Container (Statement Guide) */
.tab-container {
  margin-top: 28px;
}

.tab-nav {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn.active, .tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card);
}

.tab-btn.active {
  color: var(--emerald-light);
  border-bottom: 2px solid var(--emerald);
}

.tab-content {
  display: none;
  padding: 24px 0 8px;
}

.tab-content.active {
  display: block;
}

/* Modern Data Tables */
.data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  margin-top: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
  min-width: 600px;
}

.data-table th, .data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 600;
}

.data-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.data-table tr:hover {
  background: rgba(16, 185, 129, 0.03);
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 840px;
  margin: 32px auto 0;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  padding: 20px 24px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 20px;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

/* Contact Form */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 680px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Footer - Balanced 32px top gap and clean padding */
.footer {
  background: #06090F;
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 24px;
  margin-top: 36px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 32px;
}

.footer-brand p {
  margin-top: 12px;
  max-width: 300px;
  font-size: 0.9rem;
}

.footer-title {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--emerald-light);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */

/* Tablet & Mobile Screens (<= 900px) */
@media (max-width: 900px) {
  .nav-links, .nav-cta {
    display: none !important;
  }

  .mobile-toggle {
    display: block;
  }

  .mobile-nav.open {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    position: absolute;
    top: 72px;
    left: 0;
    width: 100%;
    background: rgba(17, 23, 35, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 24px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    z-index: 99;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

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

  .hero {
    padding: 40px 0 32px;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }
}

/* Mobile Small & Medium (<= 600px) */
@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px 12px;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  .carousel-btn {
    display: none;
  }

  .carousel-viewport {
    padding: 24px 10px;
  }

  .phone-mockup {
    width: 240px;
    border-width: 6px;
    border-radius: 28px;
  }

  .card {
    padding: 20px 16px;
  }

  .contact-form {
    padding: 20px 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
