/* Campaign Brain Public Website - Marketing Styles */
/* Based on Campaign Brain Style Guide v1.0 */

/* ============================================================================
   CSS Variables - Design Tokens
   ============================================================================ */
:root {
    /* Primary Brand Colors - Campaign Brain palette */
    --color-navy-primary: #1E3A5F;
    --color-navy-dark: #152942;
    --color-red-primary: #8B2332;
    --color-red-light: #A63446;

    /* Neutral Colors - Soft and professional */
    --color-bg-page: #F8FAFC;
    --color-bg-card: #FFFFFF;
    --color-border: #E2E8F0;
    --color-border-light: #F1F5F9;
    --color-border-hover: #CBD5E1;
    --color-text-primary: #334155;
    --color-text-secondary: #64748B;
    --color-text-muted: #94A3B8;

    /* Gray scale for utility */
    --gray-100: #F3F4F6;
    --gray-200: #E2E8F0;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #64748B;
    --gray-600: #4B5563;
    --gray-700: #334155;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Semantic Colors */
    --color-success: #059669;
    --color-success-bg: #ECFDF5;
    --color-success-border: #A7F3D0;
    --color-warning: #D97706;
    --color-warning-bg: #FFFBEB;
    --color-warning-border: #FDE68A;
    --color-error: #DC2626;
    --color-error-bg: #FEF2F2;
    --color-error-border: #FECACA;
    --color-info: #0284C7;
    --color-info-bg: #EFF6FF;
    --color-info-border: #BFDBFE;

    /* Typography */
    --font-display: 'Libre Baskerville', Georgia, serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Legacy aliases for backward compatibility */
    --primary: var(--color-navy-primary);
    --secondary: var(--color-red-primary);
    --accent: var(--color-red-primary);
    --text: var(--color-text-primary);
    --text-light: var(--color-text-secondary);
    --text-dark: var(--color-navy-primary);
    --light-gray: var(--color-bg-page);
    --bg: #ffffff;
    --bg-light: var(--color-bg-page);
    --bg-dark: var(--color-navy-dark);
    --border: var(--color-border);
    --success: var(--color-success);
    --warning: var(--color-warning);
    --error: var(--color-error);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-full: 9999px;
    --radius: 8px;
    --radius-xl: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(10px);
}

/* ============================================================================
   Dark Mode Theme Variables
   ============================================================================ */
[data-theme="dark"] {
    /* Dark mode neutrals */
    --color-bg-page: #0F172A;
    --color-bg-card: #1E293B;
    --color-border: #334155;
    --color-border-light: #1E293B;
    --color-border-hover: #475569;
    --color-text-primary: #F1F5F9;
    --color-text-secondary: #94A3B8;
    --color-text-muted: #64748B;

    /* Adjusted brand colors for dark mode */
    --color-navy-primary: #5B8DEF;
    --color-navy-dark: #1E3A5F;
    --color-red-primary: #C4475A;
    --color-red-light: #D4636F;

    /* Semantic colors adjusted for dark mode */
    --color-success-bg: rgba(5, 150, 105, 0.2);
    --color-success-border: rgba(5, 150, 105, 0.4);
    --color-warning-bg: rgba(217, 119, 6, 0.2);
    --color-warning-border: rgba(217, 119, 6, 0.4);
    --color-error-bg: rgba(220, 38, 38, 0.2);
    --color-error-border: rgba(220, 38, 38, 0.4);
    --color-info-bg: rgba(2, 132, 199, 0.2);
    --color-info-border: rgba(2, 132, 199, 0.4);

    /* Legacy aliases for dark mode */
    --text: var(--color-text-primary);
    --text-light: var(--color-text-secondary);
    --text-dark: #F1F5F9;
    --bg: var(--color-bg-card);
    --bg-light: var(--color-bg-page);
    --bg-dark: #0F172A;
    --border: var(--color-border);

    /* Dark mode shadows - more subtle */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);

    /* Glassmorphism for dark */
    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(71, 85, 105, 0.5);
}

/* System preference based dark mode (when no explicit theme set) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg-page: #0F172A;
        --color-bg-card: #1E293B;
        --color-border: #334155;
        --color-border-light: #1E293B;
        --color-border-hover: #475569;
        --color-text-primary: #F1F5F9;
        --color-text-secondary: #94A3B8;
        --color-text-muted: #64748B;
        --color-navy-primary: #5B8DEF;
        --color-navy-dark: #1E3A5F;
        --color-red-primary: #C4475A;
        --color-red-light: #D4636F;
        --color-success-bg: rgba(5, 150, 105, 0.2);
        --color-success-border: rgba(5, 150, 105, 0.4);
        --color-warning-bg: rgba(217, 119, 6, 0.2);
        --color-warning-border: rgba(217, 119, 6, 0.4);
        --color-error-bg: rgba(220, 38, 38, 0.2);
        --color-error-border: rgba(220, 38, 38, 0.4);
        --color-info-bg: rgba(2, 132, 199, 0.2);
        --color-info-border: rgba(2, 132, 199, 0.4);
        --text: var(--color-text-primary);
        --text-light: var(--color-text-secondary);
        --text-dark: #F1F5F9;
        --bg: var(--color-bg-card);
        --bg-light: var(--color-bg-page);
        --bg-dark: #0F172A;
        --border: var(--color-border);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
        --glass-bg: rgba(30, 41, 59, 0.8);
        --glass-border: rgba(71, 85, 105, 0.5);
    }
}

/* ============================================================================
   Light Mode Enhancements - Crisp and Vibrant
   ============================================================================ */

/* Explicit light mode for when user selects it */
[data-theme="light"] {
    --color-bg-page: #F8FAFC;
    --color-bg-card: #FFFFFF;
    --color-text-primary: #334155;
    --color-text-secondary: #64748B;
    --color-navy-primary: #1E3A5F;
    --color-navy-dark: #152942;
    --color-red-primary: #8B2332;
    --color-red-light: #A63446;
}

/* Light mode specific enhancements */
:root:not([data-theme="dark"]),
[data-theme="light"] {
    /* Crisper shadows for light mode */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --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.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-primary);
    background: var(--color-bg-page);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-navy-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Smooth theme transitions for all elements */
*, *::before, *::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(15deg);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.theme-toggle .icon-sun {
    display: block;
}

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun,
:root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon,
:root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun {
        display: none;
    }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon {
        display: block;
    }
}

a {
    color: var(--color-navy-primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* ============================================================================
   Typography - Libre Baskerville (headings), Source Sans 3 (body)
   ============================================================================ */
h1, h2, .page-title, .section-title, .hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-navy-primary);
    line-height: 1.25;
}

h3 {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

h4, h5, h6 {
    font-family: var(--font-body);
    color: var(--color-text-primary);
    font-weight: 600;
    line-height: 1.3;
}

h1, .page-title { font-size: 2rem; }
h2, .section-title { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

@media (max-width: 768px) {
    h1, .page-title { font-size: 1.5rem; }
    h2, .section-title { font-size: 1.25rem; }
    h3 { font-size: 1rem; }
}

/* ============================================================================
   Layout
   ============================================================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    min-height: calc(100vh - 160px);
}

/* ============================================================================
   Header
   ============================================================================ */
.header {
    background: var(--color-navy-primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header a {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s;
}

.header a:hover {
    color: white;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: white;
    border-bottom-color: var(--color-red-primary);
}

.nav-link.active {
    color: white;
    border-bottom-color: var(--color-red-primary);
}

/* Top Navigation - cbtenant style */
.header {
    height: 64px;
}

.header > div:first-child {
    height: 100%;
}

/* Logo styling - make logo white on dark backgrounds */
.logo-white {
    filter: brightness(0) invert(1) !important;
}

.header .logo-white,
.footer .logo-white {
    filter: brightness(0) invert(1) !important;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Mobile Menu Dropdown */
.mobile-menu {
    background: var(--color-navy-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.mobile-nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 3px solid var(--color-red-primary);
}

/* ============================================================================
   Dark Mode Component Overrides
   ============================================================================ */

/* Header in dark mode keeps navy but adjusts */
[data-theme="dark"] .header {
    background: #1E293B;
    border-bottom: 1px solid var(--color-border);
}

/* Cards need explicit background in dark mode */
[data-theme="dark"] .pain-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .tier-card,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .stat-card-v2,
[data-theme="dark"] .overview-card,
[data-theme="dark"] .contact-card {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}

/* Form inputs in dark mode */
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .district-input {
    background: var(--color-bg-card);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus,
[data-theme="dark"] .district-input:focus {
    border-color: var(--color-navy-primary);
    outline: none;
}

/* Hero and CTA sections stay dark in dark mode - just adjust slightly */
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
}

[data-theme="dark"] .cta-section {
    background: linear-gradient(135deg, var(--color-red-primary) 0%, #7F1D1D 100%);
}

/* Stats section dark mode */
[data-theme="dark"] .stats-section {
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
}

/* Pain section gradient in dark mode */
[data-theme="dark"] .pain-section {
    background: linear-gradient(180deg, var(--color-bg-page) 0%, #1E293B 100%);
}

/* Feature section background */
[data-theme="dark"] .features-section {
    background: var(--color-bg-card);
}

/* Pricing section gradient */
[data-theme="dark"] .pricing-section {
    background: linear-gradient(180deg, var(--color-bg-card) 0%, var(--color-bg-page) 100%);
}

/* Signup form */
[data-theme="dark"] .signup-form,
[data-theme="dark"] .signup-success {
    background: var(--color-bg-card);
}

/* Footer stays dark */
[data-theme="dark"] .footer {
    background: #0F172A;
    border-top: 1px solid var(--color-border);
}

/* Page header in dark mode */
[data-theme="dark"] .page-header {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
}

/* White text in hero sections should stay white */
[data-theme="dark"] .hero-title,
[data-theme="dark"] .hero-subtitle,
[data-theme="dark"] .cta-title,
[data-theme="dark"] .cta-subtitle,
[data-theme="dark"] .page-title,
[data-theme="dark"] .page-subtitle {
    color: white;
}

/* Section titles need proper color in dark mode */
[data-theme="dark"] .section-title,
[data-theme="dark"] .section-title-sg {
    color: var(--color-text-primary);
}

/* Video placeholder */
[data-theme="dark"] .video-placeholder {
    background: var(--color-bg-page);
    border-color: var(--color-border);
}

/* FAQ section */
[data-theme="dark"] .faq-section {
    background: var(--color-bg-page);
}

/* District section */
[data-theme="dark"] .district-section {
    background: var(--color-bg-page);
}

/* Overview section */
[data-theme="dark"] .overview-section {
    background: var(--color-bg-card);
}

/* Media query dark mode overrides */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .header {
        background: #1E293B;
        border-bottom: 1px solid var(--color-border);
    }
    :root:not([data-theme="light"]) .pain-card,
    :root:not([data-theme="light"]) .feature-card,
    :root:not([data-theme="light"]) .tier-card,
    :root:not([data-theme="light"]) .faq-item,
    :root:not([data-theme="light"]) .stat-card-v2,
    :root:not([data-theme="light"]) .overview-card,
    :root:not([data-theme="light"]) .contact-card {
        background: var(--color-bg-card);
        border-color: var(--color-border);
    }
    :root:not([data-theme="light"]) .hero {
        background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    }
    :root:not([data-theme="light"]) .page-header {
        background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    }
    :root:not([data-theme="light"]) .footer {
        background: #0F172A;
        border-top: 1px solid var(--color-border);
    }
}

/* ============================================================================
   Light Mode Component Enhancements
   ============================================================================ */

/* Cards get subtle shadows and borders in light mode */
:root:not([data-theme="dark"]) .pain-card,
:root:not([data-theme="dark"]) .feature-card,
:root:not([data-theme="dark"]) .tier-card,
:root:not([data-theme="dark"]) .faq-item,
:root:not([data-theme="dark"]) .stat-card-v2,
:root:not([data-theme="dark"]) .overview-card,
:root:not([data-theme="dark"]) .contact-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

:root:not([data-theme="dark"]) .pain-card:hover,
:root:not([data-theme="dark"]) .feature-card:hover,
:root:not([data-theme="dark"]) .tier-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Sections get subtle backgrounds for visual separation */
:root:not([data-theme="dark"]) .pain-section {
    background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
}

:root:not([data-theme="dark"]) .features-section {
    background: #F9FAFB;
}

:root:not([data-theme="dark"]) .pricing-section {
    background: linear-gradient(180deg, #FFFFFF 0%, #F3F4F6 100%);
}

:root:not([data-theme="dark"]) .faq-section {
    background: #FFFFFF;
}

:root:not([data-theme="dark"]) .overview-section {
    background: #F9FAFB;
}

/* Hero gradient with Campaign Brain navy */
:root:not([data-theme="dark"]) .hero {
    background: linear-gradient(135deg, #1E3A5F 0%, #152942 100%);
}

:root:not([data-theme="dark"]) .page-header {
    background: linear-gradient(135deg, #1E3A5F 0%, #152942 100%);
}

/* CTA section with Campaign Brain red */
:root:not([data-theme="dark"]) .cta-section {
    background: linear-gradient(135deg, #8B2332 0%, #6B1A27 100%);
}

/* Stats section with navy gradient */
:root:not([data-theme="dark"]) .stats-section {
    background: linear-gradient(180deg, #152942 0%, #1E3A5F 100%);
}

/* Footer dark and professional */
:root:not([data-theme="dark"]) .footer {
    background: #152942;
}

/* Header with Campaign Brain navy */
:root:not([data-theme="dark"]) .header {
    background: linear-gradient(90deg, #1E3A5F 0%, #152942 100%);
}

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-navy-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-navy-dark);
    color: white;
}

.btn-secondary {
    background: var(--color-bg-card);
    color: var(--color-navy-primary);
    border: 1px solid var(--color-border);
}

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

.btn-accent, .btn-cta {
    background: var(--color-red-primary);
    color: white;
}

.btn-accent:hover, .btn-cta:hover {
    background: var(--color-red-light);
    color: white;
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background: #B91C1C;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-navy-primary);
    color: var(--color-navy-primary);
}

.btn-outline:hover {
    background: var(--color-navy-primary);
    border-color: var(--color-navy-primary);
    color: white;
}

/* Outline buttons in dark contexts (hero, page-header, CTA sections) */
.hero .btn-outline,
.page-header .btn-outline,
.cta-section .btn-outline,
.district-cta-box .btn-outline {
    border-color: white;
    color: white;
}

.hero .btn-outline:hover,
.page-header .btn-outline:hover,
.cta-section .btn-outline:hover,
.district-cta-box .btn-outline:hover {
    background: white;
    border-color: white;
    color: var(--color-navy-primary);
}

/* Secondary buttons in dark contexts */
.hero .btn-secondary,
.page-header .btn-secondary,
.cta-section .btn-secondary,
.district-cta-box .btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.hero .btn-secondary:hover,
.page-header .btn-secondary:hover,
.cta-section .btn-secondary:hover,
.district-cta-box .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-block {
    width: 100%;
}

.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* White button for dark backgrounds - inverse CTA */
.btn-white {
    background: white;
    color: var(--color-red-primary);
}

.btn-white:hover {
    background: #F8FAFC;
    color: var(--color-red-light);
}

/* Ghost button for dark backgrounds */
.btn-ghost-light {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-ghost-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ============================================================================
   Hero Section
   ============================================================================ */
.hero {
    background: linear-gradient(135deg, #1E3A5F 0%, #152942 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle pattern overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.03) 0%, transparent 50%),
                      radial-gradient(circle at 75% 75%, rgba(255,255,255,0.03) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.25rem;
    margin-bottom: 1.5rem;
    color: white;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Hero badge for social proof */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(4px);
}

.hero-badge-icon {
    width: 16px;
    height: 16px;
    color: var(--color-red-light);
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0;
    }
    .hero-title {
        font-size: 2.25rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* ============================================================================
   Sections
   ============================================================================ */
.section-title {
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2.5rem;
}

/* Pain Points Section */
.pain-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, #F8FAFC 0%, #EDF2F7 100%);
}

.pain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.pain-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pain-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.pain-icon-wrapper {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-red-primary) 0%, var(--color-red-light) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(139, 35, 50, 0.2);
}

.pain-icon {
    width: 28px;
    height: 28px;
    color: white;
}

.pain-quote {
    font-style: italic;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.pain-solution {
    font-weight: 600;
    color: var(--color-navy-primary);
    font-size: 1rem;
}

/* Feature Section */
.features-section {
    padding: 5rem 0;
    background: white;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--color-bg-page);
    border: 1px solid var(--color-border);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    border-color: transparent;
}

.feature-icon-wrapper {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--color-navy-primary) 0%, var(--color-navy-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 16px rgba(30, 58, 95, 0.2);
}

.feature-icon {
    width: 32px;
    height: 32px;
    color: white;
}

.feature-title {
    margin-bottom: 0.75rem;
    color: var(--color-navy-primary);
    font-size: 1.25rem;
}

.feature-desc {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* District Section */
.district-section {
    padding: 5rem 0;
    background: var(--bg-light);
    text-align: center;
}

.district-form {
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.district-form-inner {
    display: flex;
    gap: 0.75rem;
}

.district-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-transform: lowercase;
}

.district-input:focus {
    outline: none;
    border-color: var(--primary);
}

.district-example {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* CTA Section */
.cta-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #8B2332 0%, #6B1A27 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.05) 0%, transparent 40%),
                      radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 40%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-title {
    color: white;
    margin-bottom: 0.75rem;
    font-size: 2rem;
}

.cta-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.25rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================================
   Footer
   ============================================================================ */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 4rem 0 2rem;
}

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

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
}

.footer-heading {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-link:hover {
    color: var(--color-red-light);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* ============================================================================
   Page Header
   ============================================================================ */
.page-header {
    background: linear-gradient(135deg, #1E3A5F 0%, #152942 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

/* Page titles inside page-header are white */
.page-header .page-title {
    color: white;
    margin-bottom: 0.75rem;
}

.page-header .page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
}

/* Page titles outside page-header use navy */
.page-title {
    color: var(--color-navy-primary);
    margin-bottom: 0.75rem;
}

.page-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.125rem;
}

/* ============================================================================
   Pricing
   ============================================================================ */
.pricing-section {
    padding: 3rem 0 5rem;
    background: linear-gradient(180deg, white 0%, #F8FAFC 100%);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
    max-width: 1000px;
    margin: 0 auto;
}

.tier-card {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tier-card:hover {
    transform: translateY(-4px);
}

.tier-highlighted {
    border-color: var(--color-red-primary);
    box-shadow: 0 20px 40px rgba(139, 35, 50, 0.15);
    position: relative;
    transform: scale(1.02);
}

.tier-highlighted:hover {
    transform: scale(1.02) translateY(-4px);
}

.tier-highlighted::before {
    content: 'Most Popular';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--color-red-primary) 0%, var(--color-red-light) 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.375rem 1.25rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 6px rgba(139, 35, 50, 0.2);
}

.tier-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.tier-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-navy-primary);
}

.tier-price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-navy-dark);
}

.tier-period {
    color: var(--text-light);
    font-size: 1rem;
}

.tier-features {
    flex: 1;
    margin-bottom: 1.5rem;
}

.tier-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text);
}

.check-icon {
    width: 18px;
    height: 18px;
    color: var(--success);
    flex-shrink: 0;
}

.pricing-note {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ============================================================================
   FAQ
   ============================================================================ */
.faq-section {
    padding: 4rem 0;
    background: var(--bg-light);
}

.faq-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 800px;
    margin: 2rem auto 0;
}

.faq-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.faq-answer {
    color: var(--text-light);
}

/* ============================================================================
   Demo Page
   ============================================================================ */
.demo-section {
    padding: 4rem 0;
}

.demo-container {
    max-width: 800px;
}

.video-placeholder {
    background: var(--bg-light);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.video-placeholder-inner {
    text-align: center;
}

.play-icon {
    width: 64px;
    height: 64px;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.video-placeholder-text {
    color: var(--text-light);
}

.demo-features {
    margin: 1.5rem 0;
}

.demo-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.demo-cta {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================================================
   Signup Flow
   ============================================================================ */
.signup-section {
    padding: 4rem 0;
    background: var(--bg-light);
    min-height: calc(100vh - 200px);
}

.signup-container {
    max-width: 480px;
}

.signup-progress {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step-number.active {
    background: var(--primary);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-label.active {
    color: var(--primary);
    font-weight: 600;
}

.signup-form {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.signup-title {
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-help {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

.signup-login-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.signup-success {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.success-icon-wrapper {
    margin-bottom: 1.5rem;
}

.success-icon {
    width: 64px;
    height: 64px;
    color: var(--success);
}

.signup-subdomain {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    font-family: monospace;
}

.signup-info {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ============================================================================
   District Map Component
   ============================================================================ */
.district-map-section {
    padding: 0;
    background: var(--color-bg-page);
    position: relative;
}

.district-map-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    margin-top: -4rem;
    position: relative;
    z-index: 10;
}

.district-map-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
}

.district-map {
    height: 350px;
    width: 100%;
    background: var(--color-bg-page);
}

@media (max-width: 768px) {
    .district-map {
        height: 280px;
    }
    .district-map-container {
        margin-top: -2rem;
        padding: 0 1rem;
    }
}

.district-map-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--color-bg-page);
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.district-map-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
}

.district-map-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.district-map-legend-dot.republican {
    background: #E91D0E;
}

.district-map-legend-dot.democrat {
    background: #232066;
}

/* Layer Switcher */
.layer-switcher {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-left: 1rem;
    min-width: 180px;
}

.layer-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem 0;
    color: var(--color-text-primary);
    transition: color 0.15s ease;
}

.layer-toggle:hover {
    color: var(--color-navy-primary);
}

.layer-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-navy-primary);
}

.layer-toggle input[type="checkbox"]:checked + span {
    font-weight: 500;
}

/* Responsive layer switcher - stack on mobile */
@media (max-width: 640px) {
    .district-map-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .layer-switcher {
        margin-left: 0;
        width: 100%;
    }
}

/* Dark mode layer switcher */
[data-theme="dark"] .layer-switcher {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}

[data-theme="dark"] .layer-toggle {
    color: var(--color-text-primary);
}

[data-theme="dark"] .layer-toggle:hover {
    color: var(--color-navy-primary);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .layer-switcher {
        background: var(--color-bg-card);
        border-color: var(--color-border);
    }

    :root:not([data-theme="light"]) .layer-toggle {
        color: var(--color-text-primary);
    }
}

/* MapLibre overrides */
.maplibregl-popup-content {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-body);
    background: var(--color-bg-card);
    color: var(--color-text-primary);
}

.maplibregl-popup-close-button {
    color: var(--color-text-secondary);
    font-size: 1.25rem;
    padding: 0 8px;
}

.maplibregl-ctrl-group {
    background: var(--color-bg-card) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-md) !important;
}

.maplibregl-ctrl-group button {
    background: var(--color-bg-card) !important;
}

[data-theme="dark"] .maplibregl-popup-content {
    background: var(--color-bg-card);
    color: var(--color-text-primary);
}

[data-theme="dark"] .maplibregl-ctrl-group {
    background: var(--color-bg-card) !important;
}

[data-theme="dark"] .maplibregl-ctrl-group button {
    background: var(--color-bg-card) !important;
    color: var(--color-text-primary);
}

/* ============================================================================
   District Page
   ============================================================================ */
.district-content {
    padding: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.district-section-title {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.district-overview {
    margin-bottom: 3rem;
}

.district-overview-text {
    color: var(--text);
    line-height: 1.8;
}

.district-cta-box {
    background: var(--primary);
    color: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.district-cta-title {
    color: white;
    margin-bottom: 1.5rem;
}

.district-cta-list {
    display: inline-block;
    text-align: left;
    margin-bottom: 2rem;
}

.district-cta-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.9);
}

.district-cta-list .check-icon {
    color: var(--color-red-light);
}

.district-cta-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* District Page - Stats Section */
.stats-section {
    padding: 3rem 0;
    background: linear-gradient(180deg, #152942 0%, #1E3A5F 100%);
    margin-top: -2rem;
    position: relative;
    z-index: 2;
}

.stats-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .stats-grid-v2 {
        grid-template-columns: 1fr;
    }
}

.stat-card-v2 {
    background: white;
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.stat-card-v2:hover {
    transform: translateY(-2px);
}

.stat-icon-wrapper {
    width: 52px;
    height: 48px;
    background: var(--color-navy-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.stat-icon {
    width: 24px;
    height: 24px;
    color: white;
}

.stat-card-v2 .stat-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.stat-card-v2 .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-navy-primary);
}

/* District Page - Overview Section */
.overview-section {
    padding: 4rem 0;
    background: white;
}

.overview-card {
    background: var(--color-bg-page);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    max-width: 800px;
    margin: 0 auto;
}

.overview-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-primary);
}

.overview-subsection-title {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-navy-primary);
    font-size: 1.125rem;
}

/* Partisan Lean Indicator */
.partisan-lean-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
}

.partisan-bar {
    flex: 1;
    height: 8px;
    background: linear-gradient(90deg, #2563EB 0%, #9CA3AF 50%, #DC2626 100%);
    border-radius: 4px;
    position: relative;
}

.partisan-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--color-navy-dark);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.partisan-label {
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 60px;
}

.partisan-label-dem {
    color: #2563EB;
}

.partisan-label-rep {
    color: #DC2626;
}

.overview-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--color-text-primary);
}

.overview-subsection-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 1.5rem 0 0.75rem;
}

.overview-counties {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.counties-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.county-tag {
    background: var(--color-bg-page);
    color: var(--color-text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
}

/* Representative info */
.overview-representative {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.representative-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.representative-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.representative-name.rep-republican {
    color: #dc2626;
}

.representative-name.rep-democrat {
    color: #2563eb;
}

.representative-party {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* Wikipedia link */
.overview-wiki-link {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.wiki-link {
    color: var(--color-primary);
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.wiki-link:hover {
    text-decoration: underline;
}

/* Hero hint text */
.hero-hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ============================================================================
   About Page
   ============================================================================ */
.about-section {
    padding: 4rem 0;
}

.about-block {
    margin-bottom: 3rem;
}

.about-block:last-child {
    margin-bottom: 0;
}

.about-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--color-text-primary);
    max-width: 700px;
}

/* ============================================================================
   Contact Page
   ============================================================================ */
.contact-section {
    padding: 4rem 0;
}

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

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

.contact-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    text-align: center;
}

.contact-title {
    font-size: 1.25rem;
    color: var(--color-navy-primary);
    margin-bottom: 0.5rem;
}

.contact-desc {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.contact-email {
    font-weight: 600;
    color: var(--color-navy-primary);
}

/* ============================================================================
   Districts Page
   ============================================================================ */
.districts-section {
    padding: 4rem 0;
}

.districts-lookup {
    margin-bottom: 3rem;
    text-align: center;
}

.region-block {
    margin-bottom: 2rem;
}

.region-title {
    font-size: 1.25rem;
    color: var(--color-navy-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.states-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.state-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-bg-page);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.state-link:hover {
    background: var(--color-navy-primary);
    border-color: var(--color-navy-primary);
    color: white;
}

/* ============================================================================
   Features Page (Full)
   ============================================================================ */
.feature-section-full {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border);
}

.feature-section-full:nth-child(even) {
    background: var(--bg-light);
}

.feature-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon {
    width: 24px;
    height: 24px;
    color: white;
}

.feature-section-title {
    font-size: 1.5rem;
    margin: 0;
}

.feature-list {
    margin-left: 4rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text);
}

.features-cta {
    padding: 4rem 0;
    text-align: center;
}

/* ============================================================================
   Legal Pages
   ============================================================================ */
.legal-section {
    padding: 3rem 0;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-date {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.legal-content h2 {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
}

.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* ============================================================================
   Error Pages
   ============================================================================ */
.error-section {
    padding: 4rem 0;
    text-align: center;
}

.district-examples {
    text-align: left;
    display: inline-block;
    margin: 1.5rem 0 2rem;
}

.district-examples li {
    padding: 0.5rem 0;
}

.error-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ============================================================================
   Utilities
   ============================================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-xl { font-size: 1.25rem; }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.tracking-tight { letter-spacing: -0.025em; }
.text-gray-400 { color: #9ca3af; }
.text-muted { color: var(--color-text-muted); }

/* Margin utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* Max width utilities */
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.inline { display: inline; }
.break-all { word-break: break-all; }

/* Semantic color utilities for style guide icons */
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-info { color: var(--color-info); }
.text-primary { color: var(--color-navy-primary); }
.text-accent { color: var(--color-red-primary); }
.text-purple { color: #9333EA; }
.text-blue { color: #2563EB; }
.text-orange { color: #F97316; }
.text-cyan { color: #06B6D4; }

/* ============================================================================
   Style Guide Page Enhancements
   ============================================================================ */

/* Style guide page-specific improvements for depth and sophistication */
.style-section {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced color swatches with depth */
.color-swatch {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.color-swatch:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.color-preview {
    position: relative;
    overflow: hidden;
}

.color-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.color-swatch:hover .color-preview::after {
    left: 100%;
}

/* Enhanced typography samples */
.typography-sample {
    transition: all 0.3s ease;
    position: relative;
}

.typography-sample:hover {
    transform: translateX(8px);
    border-left: 4px solid var(--color-red-primary);
    padding-left: calc(1rem - 4px);
}

/* Enhanced component cards */
.component-row > div {
    transition: all 0.3s ease;
}

.component-row > div:hover {
    transform: scale(1.05);
}

/* Enhanced icon grid items */
.icon-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.icon-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.icon-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-navy-primary);
}

.icon-item:hover::before {
    opacity: 1;
}

.icon-item:hover i {
    transform: scale(1.2);
    color: var(--color-red-primary);
}

.icon-item i {
    transition: all 0.3s ease;
}

/* Enhanced resource cards */
.resource-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-navy-primary), var(--color-red-primary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.resource-card:hover::before {
    transform: scaleX(1);
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Enhanced TOC links */
.toc-link {
    transition: all 0.2s ease;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    margin: -0.5rem -0.75rem;
}

.toc-link:hover {
    background: var(--color-info-bg);
    transform: translateX(4px);
}

/* Enhanced code blocks */
.code-block {
    position: relative;
    transition: all 0.3s ease;
}

.code-block:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
}

.code-block::before {
    content: 'CODE';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
}

/* Enhanced code labels */
.code-label {
    transition: all 0.2s ease;
}

.code-label:hover {
    background: var(--color-navy-primary);
    color: white;
}

/* Spacing demo enhancements */
.spacing-item {
    transition: all 0.3s ease;
}

.spacing-item:hover {
    transform: translateY(-4px);
}

.spacing-item:hover .spacing-box {
    background: var(--color-red-primary);
    box-shadow: var(--shadow-md);
}

/* Enhanced buttons in style guide */
.component-row .btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.component-row .btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.component-row .btn:active {
    transform: translateY(0) scale(0.98);
}

/* Glassmorphism card effect for style guide sections */
.style-section > div:first-child {
    backdrop-filter: blur(4px);
}

/* Enhanced section titles with animated underline */
.section-title-sg {
    position: relative;
    display: inline-flex;
    padding-bottom: 0.5rem;
}

.section-title-sg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-red-primary), var(--color-navy-primary));
    border-radius: 2px;
    transition: width 0.4s ease;
}

.style-section:hover .section-title-sg::after {
    width: 100%;
}

/* Subsection title enhancement */
.subsection-title {
    position: relative;
    padding-left: 1rem;
}

.subsection-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--color-red-primary);
    border-radius: 2px;
    transition: height 0.3s ease;
}

.subsection-title:hover::before {
    height: 100%;
}

/* Badge/status indicator enhancements */
.component-row span[class*="rounded-full"] {
    transition: all 0.2s ease;
}

.component-row span[class*="rounded-full"]:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Card pattern enhancements */
.style-section .bg-white {
    transition: all 0.3s ease;
}

.style-section .bg-white:hover {
    box-shadow: var(--shadow-xl);
}

/* Form input focus enhancements for style guide */
.style-section input:focus,
.style-section select:focus,
.style-section textarea:focus {
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
    border-color: var(--color-navy-primary);
}

/* CSS variables table enhancements */
.css-var-table tr {
    transition: background-color 0.2s ease;
}

.css-var-table tr:hover {
    background: var(--color-info-bg);
}

/* Dark mode style guide enhancements */
[data-theme="dark"] .color-swatch {
    background: var(--color-bg-card);
}

[data-theme="dark"] .color-info {
    background: var(--color-bg-card);
}

[data-theme="dark"] .typography-sample {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}

[data-theme="dark"] .icon-item {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}

[data-theme="dark"] .resource-card {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}

[data-theme="dark"] .code-block {
    background: #0F172A;
}

[data-theme="dark"] .toc-link:hover {
    background: var(--color-info-bg);
}

[data-theme="dark"] .code-label {
    background: var(--color-bg-page);
    color: var(--color-text-secondary);
}

/* Add some visual breathing room */
.style-section {
    scroll-margin-top: 80px;
}

/* Staggered animation for grid items */
.color-grid .color-swatch:nth-child(1) { animation-delay: 0.1s; }
.color-grid .color-swatch:nth-child(2) { animation-delay: 0.15s; }
.color-grid .color-swatch:nth-child(3) { animation-delay: 0.2s; }
.color-grid .color-swatch:nth-child(4) { animation-delay: 0.25s; }

.icon-grid .icon-item:nth-child(1) { animation-delay: 0.05s; }
.icon-grid .icon-item:nth-child(2) { animation-delay: 0.1s; }
.icon-grid .icon-item:nth-child(3) { animation-delay: 0.15s; }
.icon-grid .icon-item:nth-child(4) { animation-delay: 0.2s; }
.icon-grid .icon-item:nth-child(5) { animation-delay: 0.25s; }
.icon-grid .icon-item:nth-child(6) { animation-delay: 0.3s; }

/* Smooth page load transition */
.main-content {
    animation: pageLoad 0.4s ease-out;
}

@keyframes pageLoad {
    from {
        opacity: 0.8;
    }
    to {
        opacity: 1;
    }
}

/* Enhanced focus states for accessibility */
*:focus-visible {
    outline: 2px solid var(--color-navy-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-red-primary);
    outline-offset: 2px;
}
