/**
 * Vitalytics Design System
 * A unified styling framework for consistent brand presentation
 * 
 * Design Philosophy: Professional, Modern, Trustworthy
 * - Clean geometric aesthetics
 * - Teal-forward color palette conveying technology & reliability
 * - Generous whitespace for clarity
 * - Subtle depth through shadows and layering
 */

/* ============================================
   FONTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* === Typography === */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Font Sizes - Fluid Typography Scale */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.925rem + 0.375vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.375rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.625rem);
    --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2.25rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 3rem);
    --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 4rem);
    
    /* Font Weights */
    --weight-light: 300;
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;
    
    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* === Color Palette === */
    
    /* Primary - Teal (Brand Color) */
    --primary-50: #f0fdfa;
    --primary-100: #ccfbf1;
    --primary-200: #99f6e4;
    --primary-300: #5eead4;
    --primary-400: #2dd4bf;
    --primary-500: #14b8a6;
    --primary-600: #0d9488;
    --primary-700: #0f766e;
    --primary-800: #115e59;
    --primary-900: #134e4a;
    --primary-950: #042f2e;
    
    /* Secondary - Slate (Text & Backgrounds) */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
    
    /* Accent - Emerald (Success/CTA) */
    --accent-400: #34d399;
    --accent-500: #10b981;
    --accent-600: #059669;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* === Light Theme (Default) === */
    --bg-primary: #ffffff;
    --bg-secondary: var(--slate-50);
    --bg-tertiary: var(--slate-100);
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(15, 23, 42, 0.5);
    
    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-600);
    --text-tertiary: var(--slate-400);
    --text-inverse: #ffffff;
    --text-link: var(--primary-600);
    --text-link-hover: var(--primary-700);
    
    --border-default: var(--slate-200);
    --border-strong: var(--slate-300);
    --border-focus: var(--primary-500);
    
    /* === Spacing Scale === */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    
    /* === Border Radius === */
    --radius-none: 0;
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;
    
    /* === Shadows === */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 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);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.3);
    
    /* === Transitions === */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-slower: 500ms ease;
    
    /* === Z-Index Scale === */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    
    /* === Layout === */
    --container-max: 1200px;
    --header-height: 70px;
}

/* ============================================
   DARK THEME
   ============================================ */
:root[data-theme="dark"],
[data-theme="dark"] {
    --bg-primary: var(--slate-900);
    --bg-secondary: var(--slate-800);
    --bg-tertiary: var(--slate-700);
    --bg-elevated: var(--slate-800);
    --bg-overlay: rgba(0, 0, 0, 0.7);
    
    --text-primary: var(--slate-50);
    --text-secondary: var(--slate-300);
    --text-tertiary: var(--slate-400);
    --text-inverse: var(--slate-900);
    --text-link: var(--primary-400);
    --text-link-hover: var(--primary-300);
    
    --border-default: var(--slate-700);
    --border-strong: var(--slate-600);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-slow), color var(--transition-slow);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Account for fixed header */
body {
    padding-top: var(--header-height);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); font-weight: var(--weight-bold); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: var(--weight-semibold); }

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

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

a:hover {
    color: var(--text-link-hover);
}

strong, b {
    font-weight: var(--weight-semibold);
}

small {
    font-size: var(--text-sm);
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.main-wrapper {
    flex: 1 0 auto;
}

.section {
    padding: var(--space-16) 0;
}

.section--tight {
    padding: var(--space-10) 0;
}

.section--loose {
    padding: var(--space-24) 0;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background-color: var(--slate-800);
    color: var(--text-inverse);
    padding: var(--space-4);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
    background-color: rgba(30, 41, 59, 0.95);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.nav-brand h1 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    letter-spacing: -0.03em;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: var(--space-2);
}

.nav-item {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background-color: var(--primary-600);
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    position: relative;
    transition: all var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: white;
    transition: all var(--transition-fast);
}

.hamburger::before { top: -6px; }
.hamburger::after { bottom: -6px; }

@media (max-width: 960px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--slate-800);
        flex-direction: column;
        padding: var(--space-4);
        gap: var(--space-2);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        text-align: center;
        padding: var(--space-3) var(--space-4);
    }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    line-height: var(--leading-none);
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

/* Primary Button */
.btn--primary,
.button {
    background-color: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
}

.btn--primary:hover,
.button:hover {
    background-color: var(--primary-700);
    border-color: var(--primary-700);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* Secondary Button */
.btn--secondary {
    background-color: transparent;
    color: var(--primary-600);
    border-color: var(--primary-600);
}

.btn--secondary:hover {
    background-color: var(--primary-600);
    color: white;
}

/* Ghost Button */
.btn--ghost {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn--ghost:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-strong);
}

/* Button Sizes */
.btn--sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.btn--lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

/* Legacy .button class support */
.button {
    display: inline-block;
    padding: var(--space-3) var(--space-6);
    background-color: var(--primary-600);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: var(--weight-medium);
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background-color: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-default);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card--flat {
    box-shadow: none;
    border: 1px solid var(--border-default);
}

.card--elevated {
    box-shadow: var(--shadow-lg);
}

/* Service Card - Legacy Support */
.service-card {
    background-color: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-default);
    text-align: center;
    transition: all var(--transition-base);
}

.service-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-200);
}

.service-card h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.service-card p {
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--weight-medium);
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--slate-800) 0%, var(--primary-900) 100%);
    color: white;
    padding: var(--space-20) var(--space-6);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(13, 148, 136, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(13, 148, 136, 0.1) 0%, transparent 50%);
    z-index: 1;
}

.hero > * {
    position: relative;
    z-index: 2;
}

.hero h1 {
    color: white;
    margin-bottom: var(--space-4);
}

.hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-lg);
    max-width: 600px;
    margin: 0 auto var(--space-6);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 100%);
    color: white;
    padding: var(--space-16) var(--space-6);
    text-align: center;
}

.cta h2 {
    color: white;
    margin-bottom: var(--space-4);
}

.cta p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-6);
}

.cta .button {
    background-color: white;
    color: var(--primary-700);
}

.cta .button:hover {
    background-color: var(--slate-100);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    flex-shrink: 0;
    background-color: var(--slate-800);
    color: white;
    padding: var(--space-12) var(--space-6);
}

footer a {
    color: rgba(255, 255, 255, 0.7);
}

footer a:hover {
    color: white;
}

/* ============================================
   COOKIE CONSENT
   ============================================ */
.cookie-consent {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(8px);
    color: white;
    padding: var(--space-6);
    text-align: center;
    z-index: var(--z-modal);
    transition: bottom var(--transition-slow);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.cookie-consent.active {
    bottom: 0;
}

.cookie-consent p {
    color: rgba(255, 255, 255, 0.9);
    margin: var(--space-2) 0;
}

.cookie-consent a {
    color: var(--primary-400);
}

.cookie-buttons {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.cookie-btn {
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    transition: all var(--transition-fast);
}

.accept-cookies {
    background: var(--primary-600);
    color: white;
}

.accept-cookies:hover {
    background: var(--primary-500);
}

.reject-cookies {
    background: var(--error);
    color: white;
}

.reject-cookies:hover {
    background: #dc2626;
}

.cookie-settings {
    background: var(--slate-600);
    color: white;
}

.cookie-settings:hover {
    background: var(--slate-500);
}

/* ============================================
   SERVICES GRID
   ============================================ */
.services {
    max-width: var(--container-max);
    margin: var(--space-12) auto;
    padding: 0 var(--space-6);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
}

/* Service Section - Detail Pages */
.service-section {
    background-color: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-default);
}

.service-section h2 {
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.features-list {
    list-style: none;
    margin: var(--space-4) 0;
}

.features-list li {
    margin: var(--space-3) 0;
    padding-left: var(--space-6);
    position: relative;
    color: var(--text-secondary);
}

.features-list li::before {
    content: "✓";
    color: var(--primary-500);
    font-weight: var(--weight-bold);
    position: absolute;
    left: 0;
}

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-container {
    max-width: var(--container-max);
    margin: var(--space-8) auto;
    padding: 0 var(--space-6);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
}

.contact-form {
    background-color: var(--bg-secondary);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.contact-form h2 {
    margin-bottom: var(--space-6);
}

.contact-info h2 {
    margin-bottom: var(--space-6);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.info-item i {
    color: var(--primary-500);
    font-size: var(--text-xl);
    width: 24px;
}

.info-item h3 {
    color: var(--text-primary);
    font-size: var(--text-base);
    margin-bottom: var(--space-1);
}

.info-item p {
    color: var(--text-secondary);
    margin: 0;
}

.info-item a {
    color: var(--text-link);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }
    
    .hero {
        padding: var(--space-12) var(--space-4);
    }
    
    .services {
        padding: 0 var(--space-4);
        grid-template-columns: 1fr;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        padding: 0 var(--space-4);
    }
    
    .contact-form,
    .contact-info {
        padding: var(--space-6);
    }
    
    .button {
        width: 100%;
        max-width: 300px;
    }
    
    .cookie-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cookie-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-tertiary); }

.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }

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

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

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