/**
 * ApplyOCR by Axcess Labs - Modern Design System
 * Version: 2.0
 * Last Updated: 2025
 *
 * A comprehensive design system featuring:
 * - Modern 2025 color palette
 * - Professional typography (Inter + Manrope)
 * - Dark mode support
 * - Smooth animations and microinteractions
 * - WCAG 2.2 Level AA compliant
 */

/* ========================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ======================================== */

:root {
  /* === COLORS === */

  /* Primary Brand Colors - Professional Deep Blue */
  --brand-primary-900: #0f2d4d;    /* Darkest - navigation/headers */
  --brand-primary-700: #1a4570;    /* Dark - primary elements */
  --brand-primary-500: #2563eb;    /* Medium - main CTAs */
  --brand-primary-300: #60a5fa;    /* Light - hover states */
  --brand-primary-100: #dbeafe;    /* Lightest - backgrounds */

  /* Secondary Brand - Professional Teal (differentiation) */
  --brand-secondary-700: #0f766e;  /* Dark teal */
  --brand-secondary-500: #14b8a6;  /* Medium teal - secondary actions */
  --brand-secondary-300: #5eead4;  /* Light teal */
  --brand-secondary-100: #ccfbf1;  /* Lightest teal */

  /* Accent - Strategic Orange (CTAs that demand action) */
  --accent-primary: #f97316;       /* Primary CTA accent */
  --accent-hover: #ea580c;         /* CTA hover state */
  --accent-cream: #fffbeb;         /* Soft cream for highlights (light mode) */

  /* Legacy Primary Colors (for gradual migration) */
  --primary-900: #0f2d4d;
  --primary-700: #1a4570;
  --primary-500: #2563eb;
  --primary-300: #60a5fa;
  --primary-100: #dbeafe;

  /* Semantic Colors - Enterprise Trust Palette */
  --success: #059669;              /* Professional green */
  --success-dark: #047857;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --error: #dc2626;
  --error-dark: #b91c1c;
  --info: #2563eb;
  --info-dark: #1d4ed8;

  /* Neutral Colors - Professional Grays */
  --white: #ffffff;
  --black: #000000;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #0a0f1a;

  /* === TYPOGRAPHY === */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Line Heights - Improved Readability */
  --leading-tight: 1.2;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* === SPACING === */
  --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 */

  /* === BORDERS === */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;

  --border-width: 1px;
  --border-color: var(--gray-200);

  /* === SHADOWS === */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.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);

  /* === TRANSITIONS === */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* === Z-INDEX === */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* === LAYOUT === */
  --max-width-sm: 640px;
  --max-width-md: 768px;
  --max-width-lg: 1024px;
  --max-width-xl: 1280px;
  --max-width-2xl: 1536px;

  /* Light Mode Theme (Default) */
  --bg-primary: var(--white);
  --bg-secondary: var(--gray-50);
  --bg-tertiary: var(--gray-100);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-500);
  --border-primary: var(--gray-200);
  --navbar-bg: var(--white);
  --navbar-text: var(--gray-900);
}

/* Dark Mode Theme */
[data-theme="dark"] {
  --bg-primary: var(--gray-900);
  --bg-secondary: var(--gray-800);
  --bg-tertiary: var(--gray-700);
  --text-primary: var(--gray-50);
  --text-secondary: var(--gray-300);
  --text-tertiary: var(--gray-400);
  --border-primary: var(--gray-700);
  --navbar-bg: var(--gray-950);
  --navbar-text: var(--gray-50);
  --accent-cream: #1e293b;         /* Dark mode: use slate instead of cream */
}

/* ========================================
   BASE STYLES
   ======================================== */

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

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

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

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

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

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

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

a:hover {
  color: var(--brand-secondary-500);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--brand-primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

code {
  background-color: rgba(168, 85, 247, 0.1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--brand-primary-700);
  border: 1px solid rgba(168, 85, 247, 0.2);
  font-weight: var(--font-medium);
}

[data-theme="dark"] code {
  background-color: rgba(168, 85, 247, 0.15);
  color: var(--brand-primary-300);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

pre {
  background-color: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

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

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

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background-color: var(--brand-primary-500);
  color: var(--white);
  padding: var(--space-3) var(--space-6);
  text-decoration: none;
  font-weight: var(--font-semibold);
  z-index: 9999;
  border-radius: 0 0 var(--radius-md) 0;
  /* Screen-reader-only techniques for proper hiding */
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  width: 1px;
  height: 1px;
}

.skip-link:focus {
  /* Fully visible on focus */
  top: 0;
  clip: auto;
  clip-path: none;
  overflow: visible;
  white-space: normal;
  width: auto;
  height: auto;
  outline: 3px solid var(--brand-primary-500);
  outline-offset: 2px;
}

/* Focus visible styles - enhanced for WCAG 2.2 */
*:focus-visible {
  outline: 2px solid var(--brand-primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove focus outline for mouse users, keep for keyboard */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border-width: 2px;
  }

  .card {
    border-width: 2px;
  }
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

.container {
  width: 100%;
  max-width: var(--max-width-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-sm { max-width: var(--max-width-sm); }
.container-md { max-width: var(--max-width-md); }
.container-lg { max-width: var(--max-width-lg); }

.content-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1 0 auto;
  /* Removed padding to prevent white gap above hero sections */
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar {
  background-color: var(--navbar-bg);
  color: var(--navbar-text);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  transition: background-color var(--transition-base);
}

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

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--navbar-text);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.navbar-brand:hover {
  opacity: 0.9;
  text-decoration: none;
}

.navbar-brand-icon {
  font-size: var(--text-2xl);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.navbar-menu a {
  color: var(--navbar-text);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar-menu a:hover {
  opacity: 0.8;
  text-decoration: none;
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--navbar-text);
  font-size: var(--text-2xl);
  cursor: pointer;
  padding: var(--space-2);
}

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

  .navbar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--navbar-bg);
    flex-direction: column;
    padding: var(--space-4);
    box-shadow: var(--shadow-lg);
    gap: var(--space-3);
  }

  .navbar-menu.active {
    display: flex;
  }
}

/* Navbar Button Color Override */
.navbar-menu .btn-primary {
  color: var(--white) !important;
}

.navbar-menu .btn-primary:hover {
  color: var(--white) !important;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 2px solid var(--navbar-text);
  color: var(--navbar-text);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background-color: var(--bg-primary);
  border: var(--border-width) solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: var(--border-width) solid var(--border-primary);
}

.card-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: var(--font-normal);
}

.card-body {
  color: var(--text-secondary);
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-width) solid var(--border-primary);
}

/* Card Variants */
.card-elevated {
  box-shadow: var(--shadow-xl);
}

.card-highlight {
  border: 2px solid var(--brand-primary-500);
  position: relative;
}

.card-highlight::before {
  content: attr(data-badge);
  position: absolute;
  top: -12px;
  right: var(--space-6);
  background-color: var(--accent-primary);
  color: var(--white);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  min-height: 44px; /* WCAG 2.2 minimum touch target */
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  font-family: var(--font-primary);
  line-height: 1;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.btn:focus-visible {
  outline: 3px solid var(--brand-primary-500);
  outline-offset: 3px;
}

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

/* Touch device enhancements */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 48px; /* Larger touch targets on mobile */
    padding: var(--space-4) var(--space-8);
  }
}

/* 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);
}

.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-xl);
}

/* Button Variants */
.btn-primary {
  background-color: var(--brand-primary-500);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: var(--brand-primary-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--brand-secondary-500);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  background-color: var(--brand-secondary-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

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

.btn-outline:hover {
  background-color: var(--brand-primary-500);
  color: var(--white);
  text-decoration: none;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}

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

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

.btn-danger:hover {
  background-color: var(--error-dark);
  text-decoration: none;
}

.btn-full {
  width: 100%;
}

/* Button Loading State */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
  margin-bottom: var(--space-5);
}

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

.form-label-required::after {
  content: '*';
  color: var(--error);
  margin-left: var(--space-1);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

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

.form-help {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

.form-error {
  display: block;
  font-size: var(--text-sm);
  color: var(--error);
  margin-top: var(--space-2);
}

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

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

/* Password Input with Toggle */
.form-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-group .form-input {
  padding-right: var(--space-12);
}

.form-input-toggle {
  position: absolute;
  right: var(--space-3);
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: var(--space-2);
  font-size: var(--text-lg);
  transition: color var(--transition-fast);
}

.form-input-toggle:hover {
  color: var(--text-primary);
}

/* Checkbox and Radio */
.form-checkbox,
.form-radio {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.form-checkbox input,
.form-radio input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Password Strength Meter */
.password-strength {
  margin-top: var(--space-2);
}

.password-strength-bar {
  height: 4px;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  transition: width var(--transition-base), background-color var(--transition-base);
  width: 0%;
}

.password-strength-fill.weak {
  width: 33%;
  background-color: var(--error);
}

.password-strength-fill.medium {
  width: 66%;
  background-color: var(--warning);
}

.password-strength-fill.strong {
  width: 100%;
  background-color: var(--success);
}

.password-requirements {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}

.password-requirement {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-tertiary);
  margin-bottom: var(--space-1);
}

.password-requirement.met {
  color: var(--success);
}

.password-requirement-icon {
  font-size: var(--text-base);
}

/* ========================================
   BADGES & PILLS
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--brand-secondary-100);
  color: var(--brand-secondary-700);
}

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

.badge-warning {
  background-color: var(--warning);
  color: var(--gray-900);
}

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

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

/* ========================================
   ALERTS
   ======================================== */

.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert-icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.alert-message {
  font-size: var(--text-sm);
}

.alert-success {
  background-color: rgba(52, 211, 153, 0.1);
  border-left-color: var(--success);
  color: var(--success-dark);
}

.alert-warning {
  background-color: rgba(251, 191, 36, 0.1);
  border-left-color: var(--warning);
  color: var(--warning-dark);
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border-left-color: var(--error);
  color: var(--error-dark);
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  border-left-color: var(--info);
  color: var(--info-dark);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  background-color: var(--brand-primary-900);
  color: var(--white);
  padding: var(--space-12) 0 var(--space-6);
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer-section h5 {
  color: var(--white);
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

.footer-links a {
  color: var(--gray-300);
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  text-align: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--gray-700);
  color: var(--gray-400);
  font-size: var(--text-sm);
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  padding: var(--space-20) 0;
  text-align: center;
  background: linear-gradient(135deg, var(--brand-primary-700) 0%, var(--brand-primary-900) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)" /></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width-lg);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
  font-weight: var(--font-extrabold);
  color: var(--white);
  margin-bottom: var(--space-6);
  line-height: 1.1;
}

.hero p {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.hero-features {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.9);
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ========================================
   FEATURES GRID
   ======================================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
  margin: var(--space-12) 0;
}

.feature-card {
  text-align: center;
  padding: var(--space-8);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  background: linear-gradient(135deg, var(--brand-primary-500), var(--brand-secondary-500));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-3xl);
  color: var(--white);
}

.feature-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
}

.feature-description {
  color: var(--text-secondary);
}

/* ========================================
   PRICING TABLE
   ======================================== */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
  margin: var(--space-12) 0;
}

.pricing-card {
  position: relative;
  padding: var(--space-8);
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pricing-card > .btn {
  margin-top: auto;
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-primary);
  color: var(--white);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.pricing-name {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-4);
}

.pricing-price {
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
  color: var(--brand-primary-500);
  margin-bottom: var(--space-2);
}

.pricing-period {
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: var(--space-8);
}

.pricing-features li {
  padding: var(--space-3) 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
}

.pricing-features li.unavailable {
  opacity: 0.5;
}

.pricing-features li.unavailable::before {
  content: '✗';
  color: var(--text-tertiary);
}

/* ========================================
   IMAGE OPTIMIZATION
   ======================================== */

/* Lazy Loading Images - Smooth Fade-In */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity var(--transition-base);
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src]) {
  opacity: 1;
}

/* Prevent layout shift - enforce aspect ratio */
img, picture {
  max-width: 100%;
  height: auto;
}

/* Blur-up effect for progressive image loading (optional) */
.lazy-blur {
  filter: blur(10px);
  transition: filter var(--transition-slow);
}

.lazy-blur.loaded {
  filter: blur(0);
}

/* Placeholder while image loads */
.img-placeholder {
  background: linear-gradient(90deg, var(--gray-200) 0%, var(--gray-300) 50%, var(--gray-200) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* Responsive images - maintain aspect ratio */
.img-responsive {
  width: 100%;
  height: auto;
  display: block;
}

/* Image container with aspect ratio preservation */
.img-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.img-container::before {
  content: '';
  display: block;
  padding-bottom: 56.25%; /* 16:9 aspect ratio - adjust as needed */
}

.img-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark mode image adjustments */
[data-theme="dark"] img {
  opacity: 0.9;
}

[data-theme="dark"] img:hover {
  opacity: 1;
}

/* Invert navbar logo colors in dark mode */
[data-theme="dark"] .navbar-brand-logo {
  filter: invert(1) brightness(1.1);
  opacity: 1;
}

/* ========================================
   UTILITIES
   ======================================== */

/* Spacing */
.mt-auto { margin-top: auto !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Colors */
.text-white { color: var(--white) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success) !important; }
.text-error { color: var(--error) !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* Flex utilities */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: var(--space-4); }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.animate-fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

.animate-slide-up {
  animation: slideUp var(--transition-base) ease-out;
}

/* Responsive */
@media (max-width: 640px) {
  .hero {
    padding: var(--space-12) 0;
  }

  .hero h1 {
    font-size: var(--text-3xl);
  }

  .hero p {
    font-size: var(--text-base);
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
