/**
 * Habit Make Design System
 * ========================
 * A distinctive, commercial-grade design system.
 * Built for clarity, sophistication, and conversion.
 *
 * Color Philosophy: Deep teal primary with warm coral accents
 * Typography: Outfit (body) + Sora (headings) - distinctive, modern
 */

:root {
    /* ============================================
     * BRAND COLORS
     * Ocean Teal + Coral - warm, motivating, distinctive
     * ============================================ */

    /* Primary Teal - Main brand color, depth and trust */
    --color-primary: #0d7377;
    --color-primary-light: #14919b;
    --color-primary-dark: #065a5c;
    --color-primary-subtle: #e6f4f5;

    /* Secondary Coral - Energy, warmth, CTAs */
    --color-secondary: #e07a5f;
    --color-secondary-light: #f4a261;
    --color-secondary-dark: #c45c40;
    --color-secondary-subtle: #fef3ef;

    /* Brand Gradients - Distinctive, not generic */
    --gradient-brand: linear-gradient(135deg, #0d7377 0%, #14919b 50%, #0d7377 100%);
    --gradient-brand-hover: linear-gradient(135deg, #065a5c 0%, #0d7377 100%);
    --gradient-brand-soft: linear-gradient(135deg, #e6f4f5 0%, #d0ebec 100%);

    /* Marketing Gradient - For non-auth/landing pages */
    --gradient-marketing: linear-gradient(135deg, #0d7377 0%, #14919b 40%, #40916c 100%);
    --gradient-marketing-warm: linear-gradient(135deg, #e07a5f 0%, #f4a261 100%);

    /* Accent Gradient - Special emphasis */
    --gradient-accent: linear-gradient(135deg, #e07a5f 0%, #f4a261 100%);
    --gradient-accent-hover: linear-gradient(135deg, #c45c40 0%, #e07a5f 100%);

    /* Social Brand Colors */
    --brand-google: #4285F4;
    --brand-google-green: #34A853;
    --brand-google-yellow: #FBBC05;
    --brand-google-red: #EA4335;
    --brand-facebook: #1877F2;
    --brand-apple: #000000;

    /* ============================================
     * SEMANTIC COLORS
     * Clear visual meaning
     * ============================================ */

    /* Success - Sage green, natural and calming */
    --color-success: #40916c;
    --color-success-light: #52b788;
    --color-success-dark: #2d6a4f;
    --color-success-bg: #ecf8f1;
    --color-success-border: #b7e4c7;

    /* Warning - Rich amber, attention without alarm */
    --color-warning: #f4a261;
    --color-warning-light: #f7bc85;
    --color-warning-dark: #e07a3d;
    --color-warning-bg: #fef6eb;
    --color-warning-border: #fcd9b6;
    --color-warning-100: #fef6eb;

    /* Error - Warm terracotta, firm but not aggressive */
    --color-error: #e76f51;
    --color-error-light: #f08c6f;
    --color-error-dark: #c44536;
    --color-error-bg: #fef0ed;
    --color-error-border: #f9c4b8;

    /* Info - Calm slate blue */
    --color-info: #457b9d;
    --color-info-light: #6096b4;
    --color-info-dark: #2c5f7c;
    --color-info-bg: #edf4f8;
    --color-info-border: #bdd6e6;

    /* Action - Distinct from primary, for interactive elements */
    --color-action: #14919b;
    --color-action-light: #2fb4bf;
    --color-action-dark: #0d7377;

    /* ============================================
     * NEUTRAL COLORS
     * Sophisticated, warm neutrals
     * ============================================ */

    /* Text Colors - Warm undertones */
    --color-text-primary: #1a2b3c;
    --color-text-secondary: #3d5468;
    --color-text-muted: #6b8299;
    --color-text-disabled: #a3b5c7;
    --color-text-inverse: #ffffff;
    --color-code: #b84e44;

    /* Background Colors - Subtle warmth */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f7f9fa;
    --color-bg-tertiary: #eef2f5;
    --color-bg-dark: #1a2b3c;
    --color-bg-overlay: rgba(26, 43, 60, 0.7);

    /* White opacity variants */
    --white-05: rgba(255, 255, 255, 0.05);
    --white-15: rgba(255, 255, 255, 0.15);
    --white-18: rgba(255, 255, 255, 0.18);
    --white-20: rgba(255, 255, 255, 0.2);
    --white-25: rgba(255, 255, 255, 0.25);
    --white-30: rgba(255, 255, 255, 0.3);
    --white-40: rgba(255, 255, 255, 0.4);
    --white-50: rgba(255, 255, 255, 0.5);
    --white-60: rgba(255, 255, 255, 0.6);
    --white-90: rgba(255, 255, 255, 0.9);
    --white-95: rgba(255, 255, 255, 0.95);

    /* Border Colors */
    --color-border-light: #e2e8ed;
    --color-border-default: #c9d4de;
    --color-border-dark: #9fb0bf;

    /* ============================================
     * SHADOWS
     * Soft, sophisticated depth
     * ============================================ */

    --shadow-sm: 0 1px 3px rgba(26, 43, 60, 0.06);
    --shadow-md: 0 4px 12px rgba(26, 43, 60, 0.08);
    --shadow-lg: 0 8px 24px rgba(26, 43, 60, 0.1);
    --shadow-xl: 0 16px 48px rgba(26, 43, 60, 0.12);
    --shadow-glow: 0 0 24px rgba(13, 115, 119, 0.2);
    --shadow-glow-coral: 0 0 24px rgba(224, 122, 95, 0.25);
    --shadow-action: 0 4px 14px rgba(13, 115, 119, 0.25);
    --shadow-action-subtle-sm: 0 4px 12px rgba(13, 115, 119, 0.1);
    --shadow-action-subtle: 0 8px 24px rgba(13, 115, 119, 0.12);
    --shadow-success: 0 8px 24px rgba(64, 145, 108, 0.2);
    --shadow-warning: 0 0 8px rgba(244, 162, 97, 0.25);
    --shadow-error: 0 8px 24px rgba(231, 111, 81, 0.2);
    --shadow-focus: 0 0 0 3px rgba(13, 115, 119, 0.25);
    --shadow-focus-coral: 0 0 0 3px rgba(224, 122, 95, 0.25);
    --ring-success: 0 0 0 2px rgba(64, 145, 108, 0.25);
    --shadow-card: 0 2px 8px rgba(26, 43, 60, 0.06);
    --shadow-card-hover: 0 8px 32px rgba(26, 43, 60, 0.12);
    --text-shadow-lg: 0 2px 20px rgba(26, 43, 60, 0.2);

    /* ============================================
     * SPACING
     * Consistent spacing scale
     * ============================================ */

    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */

    /* ============================================
     * BORDER RADIUS
     * Modern, slightly rounded aesthetic
     * ============================================ */

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* ============================================
     * TYPOGRAPHY
     * Outfit (body) + Sora (headings)
     * ============================================ */

    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-family-heading: 'Sora', var(--font-family);
    --font-family-mono: 'JetBrains Mono', 'SF Mono', Monaco, 'Courier New', monospace;

    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-md: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 2rem;      /* 32px */

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.02em;

    /* ============================================
     * TRANSITIONS
     * Smooth, intentional motion
     * ============================================ */

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ============================================
     * Z-INDEX SCALE
     * ============================================ */

    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 1000;
    --z-modal: 1001;
    --z-toast: 2000;
    --z-tooltip: 3000;

    /* ============================================
     * PAGE LAYOUT
     * ============================================ */

    --navbar-height: 64px;

    --page-max-width: 1200px;
    --page-max-width-wide: 1440px;

    --page-padding-mobile: 1rem;
    --page-padding-tablet: 1.5rem;
    --page-padding-desktop: 2.5rem;

    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;

    --base-font-size: 16px;
    --line-height-body: 1.65;
    --line-height-heading: 1.25;

    --type-scale-h1: 2.5rem;  /* 40px */
    --type-scale-h2: 1.875rem; /* 30px */
    --type-scale-h3: 1.5rem;  /* 24px */
    --type-scale-h4: 1.25rem; /* 20px */
    --type-scale-h5: 1rem;    /* 16px */
    --type-scale-h6: 0.875rem;/* 14px */

    /* ============================================
     * ACCENT COLORS
     * Additional palette for visual richness
     * ============================================ */

    --color-accent-warm: #e07a5f;
    --color-accent-cool: #14919b;
    --color-accent-gold: #f4a261;
    --color-accent-sage: #40916c;
    --color-accent-slate: #457b9d;

    /* ============================================
     * GLASSMORPHISM VARIABLES
     * ============================================ */

    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-bg-dark: rgba(26, 43, 60, 0.8);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(16px);

    /* Soft Card Gradients */
    --gradient-card-warm: linear-gradient(135deg, #fef6eb 0%, #fef0ed 100%);
    --gradient-card-cool: linear-gradient(135deg, #e6f4f5 0%, #edf4f8 100%);
    --gradient-card-sage: linear-gradient(135deg, #ecf8f1 0%, #e6f4f5 100%);
    --gradient-card-neutral: linear-gradient(135deg, #f7f9fa 0%, #eef2f5 100%);

    /* Semantic gradients for reports */
    --gradient-warning: linear-gradient(135deg, #fef6eb 0%, #fcd9b6 100%);
    --gradient-success: linear-gradient(135deg, #ecf8f1 0%, #b7e4c7 100%);
    --gradient-danger: linear-gradient(90deg, var(--color-error-light) 0%, var(--color-error) 100%);

    /* ============================================
     * ANIMATION TIMING
     * ============================================ */

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============================================
 * DARK THEME
 * Applied via data-theme="dark" on html element
 * ============================================ */

[data-theme="dark"] {
    /* Brand Colors - Luminous teal for dark surfaces */
    --color-primary: #1ab5b9;
    --color-primary-light: #3fd4d8;
    --color-primary-dark: #0e8285;
    --color-primary-subtle: #122b2d;

    --color-secondary: #f0a07a;
    --color-secondary-light: #f5be9e;
    --color-secondary-dark: #d4785a;
    --color-secondary-subtle: #2e2018;

    /* Brand Gradients */
    --gradient-brand: linear-gradient(135deg, #0e8285 0%, #1ab5b9 50%, #0e8285 100%);
    --gradient-brand-hover: linear-gradient(135deg, #1ab5b9 0%, #3fd4d8 100%);
    --gradient-brand-soft: linear-gradient(135deg, #122b2d 0%, #1a3638 100%);

    /* Semantic Colors - Vibrant on dark, not washed out */
    --color-success: #5ec49a;
    --color-success-light: #7dd4b0;
    --color-success-dark: #3a9d72;
    --color-success-bg: #132921;
    --color-success-border: #2a6b4e;

    --color-warning: #f0a06a;
    --color-warning-light: #f5be9e;
    --color-warning-dark: #d4855a;
    --color-warning-bg: #2a2018;
    --color-warning-border: #b87040;
    --color-warning-100: #2a2018;

    --color-error: #f0887a;
    --color-error-light: #f5a99e;
    --color-error-dark: #d46858;
    --color-error-bg: #2d1b18;
    --color-error-border: #a8483a;

    --color-info: #6aa8cc;
    --color-info-light: #8bc0dd;
    --color-info-dark: #4a8baa;
    --color-info-bg: #15232e;
    --color-info-border: #3d6f8a;

    /* Text Colors - Warm-tinted for readability */
    --color-text-primary: #e8edf2;
    --color-text-secondary: #a8b8c8;
    --color-text-muted: #758a9e;
    --color-text-disabled: #4a5d6e;
    --color-text-inverse: #111b20;
    --color-code: #f0a07a;

    /* Background Colors - Deep ocean with teal undertone */
    --color-bg-primary: #0e1619;
    --color-bg-secondary: #141f24;
    --color-bg-tertiary: #1a2b32;
    --color-bg-dark: #090f12;
    --color-bg-overlay: rgba(0, 0, 0, 0.75);

    /* Border Colors - Teal-tinted for cohesion */
    --color-border-light: #1e3038;
    --color-border-default: #2a4250;
    --color-border-dark: #385668;

    /* Shadows - Subtle teal glow on dark surfaces */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 24px rgba(26, 181, 185, 0.25);
    --shadow-glow-coral: 0 0 24px rgba(240, 160, 122, 0.25);
    --shadow-action: 0 4px 14px rgba(26, 181, 185, 0.3);
    --shadow-action-subtle-sm: 0 4px 12px rgba(26, 181, 185, 0.12);
    --shadow-action-subtle: 0 8px 24px rgba(26, 181, 185, 0.18);
    --shadow-success: 0 8px 24px rgba(94, 196, 154, 0.2);
    --shadow-warning: 0 0 8px rgba(240, 160, 106, 0.25);
    --shadow-error: 0 8px 24px rgba(240, 136, 122, 0.2);
    --shadow-focus: 0 0 0 3px rgba(26, 181, 185, 0.35);
    --shadow-focus-coral: 0 0 0 3px rgba(240, 160, 122, 0.35);
    --ring-success: 0 0 0 2px rgba(94, 196, 154, 0.35);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Gradients - Rich dark variants */
    --gradient-warning: linear-gradient(135deg, #2a2018 0%, #382c20 100%);
    --gradient-success: linear-gradient(135deg, #132921 0%, #1e3d2e 100%);
    --gradient-danger: linear-gradient(90deg, #f0887a 0%, #d46858 100%);

    /* Card Gradients - Dark surface variants */
    --gradient-card-warm: linear-gradient(135deg, #221a14 0%, #261e18 100%);
    --gradient-card-cool: linear-gradient(135deg, #111f26 0%, #15262e 100%);
    --gradient-card-sage: linear-gradient(135deg, #112420 0%, #111f26 100%);
    --gradient-card-neutral: linear-gradient(135deg, #141f24 0%, #1a2b32 100%);

    /* Glassmorphism - Dark variant */
    --glass-bg: rgba(14, 22, 25, 0.85);
    --glass-bg-dark: rgba(9, 15, 18, 0.9);
    --glass-border: rgba(26, 181, 185, 0.12);
}

/* Dark mode auth state overrides */
[data-theme="dark"][data-auth-state="guest"] {
    --gradient-hero: linear-gradient(135deg, #0e8285 0%, #1ab5b9 30%, #3a9d72 70%, #0e8285 100%);
    --color-bg-hero: #090f12;
}

[data-theme="dark"][data-auth-state="authenticated"] {
    --gradient-hero: linear-gradient(135deg, #141f24 0%, #1a2b32 100%);
    --color-bg-hero: var(--color-bg-secondary);
}

/* Smooth theme transition */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

html[data-theme="dark"] {
    background-color: var(--color-bg-primary);
    color-scheme: dark;
}

/* Dark theme overrides for Bootstrap modal components */
[data-theme="dark"] .modal-content {
    background-color: var(--color-bg-primary);
    border-color: var(--color-border-default);
    color: var(--color-text-primary);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--color-border-light);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--color-border-light);
}

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

[data-theme="dark"] .modal-body {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dark theme overrides for native form inputs */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border-color: var(--color-border-default);
}

/* ============================================
 * AUTH STATE VARIANTS
 * Different aesthetics for auth/non-auth
 * ============================================ */

/* Non-authenticated (marketing/landing) - More dramatic */
[data-auth-state="guest"] {
    --gradient-hero: linear-gradient(135deg, #0d7377 0%, #14919b 30%, #40916c 70%, #0d7377 100%);
    --color-bg-hero: #0d7377;
}

/* Authenticated (dashboard) - Clean, focused */
[data-auth-state="authenticated"] {
    --gradient-hero: linear-gradient(135deg, #f7f9fa 0%, #eef2f5 100%);
    --color-bg-hero: var(--color-bg-secondary);
}

/* ============================================
 * BUTTON SYSTEM
 * Refined, distinctive buttons
 * ============================================ */

/* Base Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.625rem 1.25rem;
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    line-height: 1.5;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary Button - Teal gradient, distinctive */
.btn-primary {
    color: var(--color-text-inverse);
    background: var(--gradient-brand);
    border-color: transparent;
    box-shadow: var(--shadow-action-subtle-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--gradient-brand-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-action);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Accent Button - Coral, for high-impact CTAs */
.btn-accent {
    color: var(--color-text-inverse);
    background: var(--gradient-accent);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(224, 122, 95, 0.3);
}

.btn-accent:hover:not(:disabled) {
    background: var(--gradient-accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-coral);
}

.btn-accent:focus {
    box-shadow: var(--shadow-focus-coral);
}

/* Secondary Button */
.btn-secondary {
    color: var(--color-text-secondary);
    background: var(--color-bg-primary);
    border-color: var(--color-border-default);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-dark);
    transform: translateY(-1px);
}

/* Success Button */
.btn-success {
    color: var(--color-text-inverse);
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-light) 100%);
    border-color: transparent;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-success-dark) 0%, var(--color-success) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-success);
}

/* Danger Button */
.btn-danger {
    color: var(--color-text-inverse);
    background: linear-gradient(135deg, var(--color-error) 0%, var(--color-error-light) 100%);
    border-color: transparent;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-error-dark) 0%, var(--color-error) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-error);
}

/* Outline Variants */
.btn-outline-primary {
    color: var(--color-primary);
    background: transparent;
    border-color: var(--color-primary);
}

.btn-outline-primary:hover:not(:disabled) {
    color: var(--color-text-inverse);
    background: var(--color-primary);
    border-color: var(--color-primary);
}

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

.btn-outline-secondary:hover:not(:disabled) {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-dark);
}

.btn-outline-accent {
    color: var(--color-secondary);
    background: transparent;
    border-color: var(--color-secondary);
}

.btn-outline-accent:hover:not(:disabled) {
    color: var(--color-text-inverse);
    background: var(--color-secondary);
    border-color: var(--color-secondary);
}

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

.btn-ghost:hover:not(:disabled) {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

/* Link Button */
.btn-link {
    color: var(--color-action);
    background: transparent;
    border-color: transparent;
    padding: 0;
    font-weight: var(--font-weight-medium);
}

.btn-link:hover:not(:disabled) {
    color: var(--color-action-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: var(--font-size-lg);
    border-radius: var(--radius-lg);
}

.btn-xl {
    padding: 1rem 2.25rem;
    font-size: var(--font-size-xl);
    border-radius: var(--radius-lg);
}

/* Icon Button */
.btn-icon {
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    padding: var(--spacing-xs);
}

.btn-icon.btn-lg {
    padding: var(--spacing-md);
}

/* Full Width */
.btn-block {
    width: 100%;
}

/* Pill Shape */
.btn-pill {
    border-radius: var(--radius-full);
}

/* ============================================
 * STATUS BADGES
 * ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.25rem 0.625rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.badge-success {
    color: var(--color-success-dark);
    background: var(--color-success-bg);
}

.badge-warning {
    color: var(--color-warning-dark);
    background: var(--color-warning-bg);
}

.badge-error {
    color: var(--color-error-dark);
    background: var(--color-error-bg);
}

.badge-info {
    color: var(--color-info-dark);
    background: var(--color-info-bg);
}

.badge-neutral {
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
}

.badge-primary {
    color: var(--color-primary-dark);
    background: var(--color-primary-subtle);
}

.badge-accent {
    color: var(--color-secondary-dark);
    background: var(--color-secondary-subtle);
}

/* ============================================
 * FORM ELEMENTS
 * Clean, refined inputs
 * ============================================ */

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--color-border-default);
}

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

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: var(--color-bg-tertiary);
    color: var(--color-text-disabled);
    cursor: not-allowed;
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
    border-color: var(--color-error);
}

.form-input.is-error:focus,
.form-select.is-error:focus,
.form-textarea.is-error:focus {
    box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.2);
}

.form-input.is-success,
.form-select.is-success,
.form-textarea.is-success {
    border-color: var(--color-success);
}

/* Form Label */
.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    letter-spacing: var(--letter-spacing-wide);
}

/* Form Help Text */
.form-help {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.form-error {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-error);
}

/* ============================================
 * CARDS
 * Elevated, sophisticated containers
 * ============================================ */

.card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-light);
    background: var(--gradient-card-neutral);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg-secondary);
}

/* Card variants */
.card-elevated {
    border: none;
    box-shadow: var(--shadow-lg);
}

.card-interactive {
    cursor: pointer;
}

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

/* ============================================
 * ALERTS
 * Clear, informative notifications
 * ============================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-body);
}

.alert-success {
    color: var(--color-success-dark);
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
}

.alert-warning {
    color: var(--color-warning-dark);
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
}

.alert-error {
    color: var(--color-error-dark);
    background: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
}

.alert-info {
    color: var(--color-info-dark);
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
}

/* ============================================
 * UTILITY CLASSES
 * ============================================ */

/* Text Colors */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-brand { color: var(--color-primary); }
.text-accent { color: var(--color-secondary); }

/* Background Colors */
.bg-primary { background: var(--color-bg-primary); }
.bg-secondary { background: var(--color-bg-secondary); }
.bg-tertiary { background: var(--color-bg-tertiary); }
.bg-brand { background: var(--color-primary); }

/* ============================================
 * MODERN EFFECTS
 * Distinctive visual treatments
 * ============================================ */

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

.glass-dark {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-warm {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated Border */
.gradient-border {
    position: relative;
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-brand);
    border-radius: calc(var(--radius-xl) + 2px);
    z-index: -1;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s var(--ease-out-expo);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

.hover-glow-coral:hover {
    box-shadow: var(--shadow-glow-coral);
}

/* Icon Bounce */
.icon-bounce:hover {
    animation: iconBounce 0.5s var(--ease-spring);
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Pulse Effect */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================
 * SCROLL ANIMATIONS
 * ============================================ */

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modern scroll-driven animations */
@supports (animation-timeline: view()) {
    .animate-on-scroll {
        animation: fadeInUp linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 30%;
    }

    .animate-scale-on-scroll {
        animation: fadeInScale linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 40%;
    }

    .animate-slide-left {
        animation: slideInLeft linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 30%;
    }

    .animate-slide-right {
        animation: slideInRight linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 30%;
    }
}

/* Fallback for JS-based animation */
.animate-on-scroll:not(.visible),
.animate-scale-on-scroll:not(.visible),
.animate-slide-left:not(.visible),
.animate-slide-right:not(.visible) {
    opacity: 0;
    transform: translateY(24px);
}

.animate-on-scroll.visible,
.animate-scale-on-scroll.visible,
.animate-slide-left.visible,
.animate-slide-right.visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

/* Stagger Delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* ============================================
 * SKELETON LOADING
 * ============================================ */

.skeleton {
    background: linear-gradient(90deg,
        var(--color-bg-secondary) 25%,
        var(--color-bg-tertiary) 50%,
        var(--color-bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
 * MEDIA PLACEHOLDERS
 * ============================================ */

.media-placeholder {
    position: relative;
    overflow: hidden;
    background: var(--gradient-card-cool);
    border-radius: var(--radius-xl);
}

.media-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(255,255,255,0.15) 0%,
        transparent 50%,
        rgba(255,255,255,0.08) 100%);
}

.media-placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.media-placeholder-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

/* ============================================
 * DIVIDERS
 * ============================================ */

.divider {
    height: 1px;
    background: var(--color-border-light);
    margin: var(--spacing-lg) 0;
}

.divider-gradient {
    height: 2px;
    background: var(--gradient-brand);
    margin: var(--spacing-lg) 0;
    border-radius: var(--radius-full);
}

/* ============================================
 * FOCUS VISIBLE
 * Keyboard navigation styling
 * ============================================ */

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

button:focus-visible,
.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* ============================================
 * MOBILE CONTENT DENSITY RULES
 * Design rule: maximize screen space on mobile
 * ============================================
 *
 * Rule 1 — No double gutters
 *   Inner page wrappers (.page-main) must have zero horizontal padding
 *   on mobile. The layout's .content-container already provides the
 *   outer gutters (12px each side).
 *
 * Rule 2 — Compact vertical rhythm
 *   Section top padding on mobile: ≤ 16px.
 *   Card internal padding on mobile: 12–16px.
 *   Avoid 32px+ vertical padding on full-height page sections.
 *
 * Rule 3 — Tab bars
 *   On mobile, tab selectors must be horizontal scrollable pill rows,
 *   not vertical stacks. Use overflow-x: auto + flex-wrap: nowrap.
 *   Tab pills: padding 6px 14px, border-radius: var(--radius-full).
 */
