:root {
  /* Brand Tokens - Visual Source of Truth */
  --bg-app: #0f1117;
  --bg-sidebar: #12151d;
  --bg-header: #11141b;
  --bg-surface: #171b24;
  --bg-surface-2: #1d2330;
  --bg-hover: #232a38;

  --text-primary: #f3ead7;
  --text-secondary: #B5C0CD;
  --text-muted: #8F9CAE;
  --text-disabled: #6C7A8C;

  --border-subtle: rgba(243, 234, 215, 0.10);
  --border-strong: rgba(243, 234, 215, 0.18);
  --divider: rgba(243, 234, 215, 0.08);

  --brand-primary: #3A7563;
  --brand-primary-hover: #2e5e50;
  --brand-primary-soft: rgba(58, 117, 99, 0.16);

  --brand-secondary: #0f6b6f;
  --brand-secondary-hover: #0c5a5e;
  --brand-secondary-soft: rgba(15, 107, 111, 0.16);

  --success: #3f8a57;
  --success-soft: rgba(63, 138, 87, 0.16);

  --warning: #cf8b2e;
  --warning-soft: rgba(207, 139, 46, 0.16);

  --danger: #b75050;
  --danger-soft: rgba(183, 80, 80, 0.16);

  --info: #4b7db8;
  --info-soft: rgba(75, 125, 184, 0.16);

  /* Semantic status palette */
  --status-trust: var(--success);               /* Verified, KYC/AML, SOC2 */
  --status-trust-soft: var(--success-soft);
  --status-neutral: var(--info);                /* Outcome steps, funnel, platform */
  --status-neutral-soft: var(--info-soft);
  --status-warning: var(--warning);             /* Cautionary messages */
  --status-warning-soft: var(--warning-soft);

  /* Persona colors */
  --color-founder: #0f6b6f;   /* Teal-like secondary */
  --color-investor: #3a7563;  /* Brand primary teal */
  --color-founder-soft: rgba(15, 107, 111, 0.16);
  --color-investor-soft: rgba(58, 117, 99, 0.16);

  /* Compatibility aliases mapping old theme names to new brand tokens */
  --bg-base: var(--bg-app);
  --bg-surface-hover: var(--bg-hover);
  --accent-primary: var(--brand-primary);
  /* FAQ section colors */
  --faq-bg: #0B1020;
  --faq-text: #F9FAFB;
  --faq-muted: #C6D0E5;
  /* Pricing FAQ question/answer colors */
  --pricing-faq-question: #111827; /* dark neutral for questions */
  --pricing-faq-answer: #4B5563;   /* muted dark for answers */
  /* Pricing FAQ design tokens */
  --pricing-faq-bg: #0F172A; /* deep navy */
  --pricing-faq-text: #F9FAFB; /* near‑white */
  --accent-primary-hover: var(--brand-primary-hover);
  --accent-secondary: var(--brand-secondary);
  --accent-gold: #c9a227;
  --accent-warning: var(--warning);
  --accent-danger: var(--danger);
  --border-focus: var(--brand-secondary-soft);

  /* Chart Tokens */
  --chart-1: var(--brand-primary);
  --chart-2: var(--brand-secondary);
  --chart-3: #7f7768;
  --chart-4: var(--success);
  --chart-5: var(--danger);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Borders & Shadows */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 15px rgba(58, 117, 99, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
}

html {
  scroll-behavior: smooth;
}

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

:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500; /* Sharper, more institutional weight */
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

h1 { font-size: 3rem; } /* Not oversized */
h2 { font-size: 2.25rem; }
h3 { font-size: 1.25rem; font-weight: 600; }

p {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

header { margin-bottom: 0; }
.hero { margin-top: 0; padding: 32px 0 64px; }
.hero-content { max-width: 640px; margin: 0 auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

/* Skip link */
.skip-link { position: absolute; left: -999px; top: -999px; }
.skip-link:focus { position: static; left: auto; top: auto; background: var(--bg-surface); color: var(--text-primary); padding: var(--space-2); z-index: 1000; }

/* Hero section */
.hero-section { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: var(--space-8) var(--space-4); background-color: var(--bg-surface); }
.hero-content { max-width: 600px; }
.hero-headline { font-size: 2.5rem; margin-bottom: var(--space-4); }
.hero-subtitle { font-size: 1.125rem; margin-bottom: var(--space-6); color: var(--text-secondary); }
.hero-credibility { font-size: 0.875rem; color: var(--text-secondary); margin-top: var(--space-2); text-align: center; }
.hero-cta-group { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.hero-image img { max-width: 100%; height: auto; border-radius: var(--radius-md); }

/* Button hierarchy */
.btn { display: inline-block; padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); font-weight: 600; text-align: center; transition: background var(--transition-fast), color var(--transition-fast); }
.btn-primary-hero { background: var(--brand-primary); color: #fff; }
.btn-primary-hero:hover { background: var(--brand-primary-hover); }
.btn-secondary-hero { background: var(--brand-secondary-soft); color: var(--brand-secondary); }
.btn-secondary-hero:hover { background: var(--brand-secondary); color: #fff; }
.btn-tertiary-hero { background: transparent; color: var(--brand-primary); border: 2px solid var(--brand-primary); }
.btn-tertiary-hero:hover { background: var(--brand-primary-soft); color: var(--brand-primary); }

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: var(--bg-app);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--text-secondary);
}

.btn-success {
  background-color: var(--accent-secondary);
  color: white;
}

.btn-tertiary {
  background-color: transparent;
  color: var(--brand-primary);
  border-color: transparent;
  padding: var(--space-2) var(--space-4);
}

.btn-tertiary:hover {
  color: var(--brand-primary-hover);
  text-decoration: underline;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Glassmorphism */
.glass {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.form-input, .form-select {
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--border-focus);
}

/* Badges / Chips */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: var(--success-soft); color: #7bc08f; }
.badge-verified { background: var(--brand-secondary-soft); color: #6fd0d4; }
.badge-premium { background: var(--brand-primary-soft); color: #f0cc63; }
.badge-pending { background: var(--warning-soft); color: #f0b35a; }
.badge-warning { background: var(--warning-soft); color: #f0b35a; }
.badge-danger { background: var(--danger-soft); color: #e08b8b; }
.badge-rejected { background: var(--danger-soft); color: #e08b8b; }
.badge-info { background: var(--info-soft); color: #8bbce0; }

/* Additional semantic badge utilities */
.badge-trust { background: var(--status-trust-soft); color: var(--status-trust); }
.badge-neutral { background: var(--status-neutral-soft); color: var(--status-neutral); }
.badge-warning { background: var(--status-warning-soft); color: var(--status-warning); }

/* Metric highlight (non‑interactive) */
.highlight-metric { color: var(--brand-secondary); font-weight: 600; }

/* Persona label styles */
.persona-founder { color: var(--color-founder); background: var(--color-founder-soft); border-radius: var(--radius-full); padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 600; }
.persona-investor { color: var(--color-investor); background: var(--color-investor-soft); border-radius: var(--radius-full); padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 600; }

/* Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.navbar.auth-variant {
  position: relative !important;
  top: auto !important;
  border-bottom: 1px solid var(--border-subtle);
  background-color: transparent !important;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-size: 1.15rem;
  margin-left: 0.5rem;
}

.logo-wordmark-primary {
  font-weight: 700;
}

.logo-wordmark-secondary {
  font-weight: 400;
  opacity: 0.9;
}

.logo-icon {
  width: 24px;
  height: 24px;
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
}

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

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 73px); /* Minus navbar */
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-6) 0;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 var(--space-4);
}

.sidebar-link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.sidebar-link:hover, .sidebar-link.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-8);
  overflow-y: auto;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Utilities */
.text-center { text-align: center; }
.text-accent { color: var(--accent-primary); }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-hover);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.sparkline-wrapper {
    margin-top: var(--space-2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.delta-badge {
    display: inline-block;
    margin-left: var(--space-2);
    padding: 0 var(--space-2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.delta-badge.positive {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}

.delta-badge.negative {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Card layout enhancements */
.kanban-card {
    background: var(--bg-surface-2);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}
.card-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}
.card-metrics {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.risk-badge {
    margin-right: var(--space-2);
}

/* Mobile Navigation Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #FAF8F5;
  cursor: pointer;
  padding: 8px;
  outline: none;
  align-items: center;
  justify-content: center;
}

/* Navigation Anchor Link Dot Indicator */
.nav-link-anchor::before {
  content: '•';
  color: #3A7563;
  margin-right: 6px;
  font-size: 0.85em;
  opacity: 0.8;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width: 1024px) {
  .nav-toggle {
    display: inline-flex;
    z-index: 60;
  }
  
  .navbar .container {
    position: relative;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(10, 13, 16, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: none; /* Hidden by default */
    flex-direction: column;
    padding: 24px 16px !important;
    gap: 16px !important;
    align-items: stretch !important;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 55;
  }

  .nav-links.mobile-open {
    display: flex !important;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .nav-links .btn {
    width: 100%;
    justify-content: center;
  }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Security and Password Strength Styling */
.security-badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

#password-strength-container {
  background: rgba(23, 27, 36, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all var(--transition-normal);
}

.strength-bar-wrapper {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  gap: 4px;
}

.strength-bar-segment {
  flex: 1;
  height: 100%;
  background: transparent;
  transition: background var(--transition-fast);
}

.password-feedback-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.password-feedback-check {
  font-weight: bold;
  font-size: 0.9rem;
  width: 14px;
  display: inline-block;
}

/* Accessibility Utilities */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background-color: var(--primary, #0E7C74);
  color: #FFFFFF !important;
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 500;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--primary, #0E7C74);
  outline-offset: 2px;
}

/* Investor Dashboard scoped overrides */
.investor-dashboard .view-header { padding: 24px 32px; gap: var(--space-4); }
.investor-dashboard .filter-row { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.investor-dashboard .status-badge { padding: 2px 8px; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; }
.investor-dashboard .status-pending { background: var(--warning-soft); color: var(--warning); }
.investor-dashboard .status-inreview { background: var(--info-soft); color: var(--info); }
.investor-dashboard .status-completed { background: var(--success-soft); color: var(--success); }

/* Pricing FAQ section */
.pricing-faq {
  background-color: var(--pricing-faq-bg);
  color: var(--pricing-faq-text);
  padding: var(--space-8) var(--space-4);
}
.pricing-faq h2,
.pricing-faq p,
.pricing-faq li {
  color: var(--pricing-faq-text);
}
.pricing-faq .faq-question {
  color: var(--pricing-faq-question);
}
.pricing-faq .faq-answer {
  color: var(--pricing-faq-answer);
}
  color: var(--pricing-faq-text);
}
.pricing-faq .faq-answer {
  color: var(--faq-muted);
}
  background-color: var(--faq-bg);
  color: var(--faq-text);
  padding: var(--space-8) var(--space-4);
}
.pricing-faq h2,
.pricing-faq p,
.pricing-faq li {
  color: var(--faq-text);
}
.pricing-faq .faq-question {
  color: var(--faq-text);
}
.pricing-faq .faq-answer {
  color: var(--faq-muted);
}

/* Footer Adjustments */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 32px;
}
.footer-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 24px;
}
.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast), transform var(--transition-fast);
    display: inline-block;
    padding: 2px 0;
}
.footer-link:hover {
    color: var(--text-primary);
    transform: translateX(2px);
}
.footer-column-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: 0.875rem;
}
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
    .footer-identity {
        grid-column: 1 / -1;
        margin-bottom: 16px;
    }
}
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .footer-identity {
        margin-bottom: 32px;
    }
    .footer-heading {
        margin-bottom: 0;
        padding: 16px 0;
        cursor: pointer;
        border-bottom: 1px solid var(--border-subtle);
        display: flex;
        justify-content: space-between;
        align-items: center;
        user-select: none;
    }
    .footer-heading::after {
        content: '+';
        font-size: 1.2rem;
        font-weight: 400;
        color: var(--text-muted);
    }
    .footer-nav-col.open .footer-heading {
        border-bottom-color: transparent;
    }
    .footer-nav-col.open .footer-heading::after {
        content: '\2212';
    }
    .footer-column-content {
        display: none;
        padding: 16px 0 24px 0;
        border-bottom: 1px solid var(--border-subtle);
    }
    .footer-nav-col.open .footer-column-content {
        display: flex;
    }
}
