/*
 * Nigerian Crypto Tax Calculator - Design System v2.0
 * World-Class UI/UX (Stripe/Linear/Vercel Standard)
 * Quality Bar: 9.5/10
 * Created: 2026-01-03
 *
 * Philosophy: "Financial Confidence Through Clarity"
 * Aesthetic: "If Big 4 Accounting Firm Designed Stripe"
 */

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

:root {
  /* ===== Colors: Nigeria Green (Trust, Money, Growth) ===== */
  --green-50: #F0FDF4;
  --green-100: #DCFCE7;
  --green-200: #BBF7D0;
  --green-300: #86EFAC;
  --green-400: #4ADE80;
  --green-500: #22C55E;
  --green-600: #16A34A;
  --green-700: #15803D;
  --green-800: #166534;
  --green-900: #14532D;
  --green-950: #052E16;

  /* ===== Colors: Navy Blue (Authority, Stability, Intelligence) ===== */
  --navy-50: #F8FAFC;
  --navy-100: #F1F5F9;
  --navy-200: #E2E8F0;
  --navy-300: #CBD5E1;
  --navy-400: #94A3B8;
  --navy-500: #64748B;
  --navy-600: #475569;
  --navy-700: #334155;
  --navy-800: #1E293B;
  --navy-900: #0F172A;
  --navy-950: #020617;

  /* ===== Colors: Purple (Innovation, Premium, Crypto) ===== */
  --purple-50: #FAF5FF;
  --purple-100: #F3E8FF;
  --purple-200: #E9D5FF;
  --purple-300: #D8B4FE;
  --purple-400: #C084FC;
  --purple-500: #A855F7;
  --purple-600: #9333EA;
  --purple-700: #7E22CE;
  --purple-800: #6B21A8;
  --purple-900: #581C87;

  /* ===== Colors: Semantic (Actions & States) ===== */
  --success: var(--green-600);
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;

  /* ===== Typography: Font Families ===== */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  --font-display: 'Cal Sans', 'Satoshi', 'Inter', sans-serif;

  /* ===== Typography: Font Sizes (Fluid, Responsive) ===== */
  --text-xs: clamp(11px, 0.75rem, 12px);
  --text-sm: clamp(13px, 0.875rem, 14px);
  --text-base: clamp(15px, 1rem, 16px);
  --text-lg: clamp(17px, 1.125rem, 18px);
  --text-xl: clamp(19px, 1.25rem, 20px);
  --text-2xl: clamp(22px, 1.5rem, 24px);
  --text-3xl: clamp(28px, 1.875rem, 30px);
  --text-4xl: clamp(34px, 2.25rem, 36px);
  --text-5xl: clamp(44px, 3rem, 48px);
  --text-6xl: clamp(52px, 3.5rem, 56px);

  /* ===== Typography: Line Heights ===== */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

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

  /* ===== Typography: Letter Spacing ===== */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0em;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* ===== Spacing (8px Base Unit - Fibonacci-inspired) ===== */
  --space-0: 0;
  --space-px: 1px;
  --space-0-5: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* ===== Border Radius (Friendly but Professional) ===== */
  --radius-none: 0;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ===== Shadows (Depth & Elevation) ===== */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

  /* ===== Colored Shadows (For Brand Elements) ===== */
  --shadow-green: 0 4px 16px rgba(22, 163, 74, 0.3);
  --shadow-green-lg: 0 10px 30px rgba(22, 163, 74, 0.2);
  --shadow-purple: 0 4px 16px rgba(168, 85, 247, 0.3);
  --shadow-purple-lg: 0 8px 24px rgba(168, 85, 247, 0.4);
  --shadow-navy: 0 4px 12px rgba(15, 23, 42, 0.15);

  /* ===== Glassmorphism ===== */
  --glass-light: rgba(255, 255, 255, 0.9);
  --glass-medium: rgba(255, 255, 255, 0.75);
  --glass-dark: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(12px);

  /* ===== Transitions & Timing ===== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ===== Z-index Layers (Systematic Stacking) ===== */
  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* ===== Gradients (Brand Signatures) ===== */
  --gradient-green: linear-gradient(135deg, var(--green-600) 0%, var(--green-800) 100%);
  --gradient-purple: linear-gradient(135deg, var(--purple-500) 0%, var(--purple-700) 100%);
  --gradient-rainbow: linear-gradient(135deg, var(--green-500) 0%, var(--purple-500) 100%);
  --gradient-navy: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-900) 100%);

  /* ===== Backdrop Filters ===== */
  --backdrop-blur-sm: blur(4px);
  --backdrop-blur-md: blur(8px);
  --backdrop-blur-lg: blur(12px);
  --backdrop-blur-xl: blur(16px);
}

/* ===== Dark Mode Support (Future-proofing) ===== */
@media (prefers-color-scheme: dark) {
  :root {
    /* Would define dark mode variables here */
    /* Not implementing yet, but ready for it */
  }
}

/* ============================================
   2. RESET & 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;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--navy-700);
  background-color: var(--navy-50);
  min-height: 100vh;
}

/* Better text selection */
::selection {
  background-color: var(--purple-200);
  color: var(--navy-900);
}

::-moz-selection {
  background-color: var(--purple-200);
  color: var(--navy-900);
}

/* ============================================
   3. TYPOGRAPHY SYSTEM
   ============================================ */

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

h1 { font-size: var(--text-6xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-4xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
h6 { font-size: var(--text-lg); font-weight: var(--weight-semibold); }

p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
  color: var(--navy-600);
}

a {
  color: var(--green-600);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--green-700);
}

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

/* Text utilities */
.display {
  font-size: var(--text-6xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-none);
  letter-spacing: var(--tracking-tighter);
  color: var(--navy-900);
}

.heading-1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--navy-900);
}

.heading-2 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  color: var(--navy-900);
}

.heading-3 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--navy-800);
}

.body-lg {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--navy-600);
}

.body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--navy-600);
}

.body-sm {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--navy-500);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.money-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.result-number {
  font-family: var(--font-mono);
  font-size: var(--text-5xl);
  font-weight: var(--weight-extrabold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tighter);
}

/* ============================================
   4. BUTTON SYSTEM (Hierarchy & States)
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-none);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--purple-500);
  outline-offset: 2px;
}

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

/* Primary CTA (Purple Gradient - Premium) */
.btn-primary {
  background: var(--gradient-purple);
  color: white;
  box-shadow: var(--shadow-purple);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-purple-lg);
}

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

/* Secondary (Green - Brand Action) */
.btn-secondary {
  background: var(--gradient-green);
  color: white;
  box-shadow: var(--shadow-green);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-green-lg);
}

/* Outline (Professional) */
.btn-outline {
  background: white;
  color: var(--navy-700);
  border: 1.5px solid var(--navy-300);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover:not(:disabled) {
  background: var(--navy-50);
  border-color: var(--navy-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Ghost (Subtle) */
.btn-ghost {
  background: transparent;
  color: var(--green-700);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--green-50);
}

/* Size Variants */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: var(--space-6) var(--space-12);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
  min-height: 56px;
}

.btn-xl {
  padding: var(--space-8) var(--space-16);
  font-size: var(--text-xl);
  border-radius: var(--radius-xl);
  min-height: 64px;
}

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

/* Icon buttons */
.btn-icon {
  padding: var(--space-3);
  aspect-ratio: 1;
}

/* Loading state */
.btn-loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

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

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

/* ============================================
   5. INPUT SYSTEM (Feedback & States)
   ============================================ */

.input-group {
  position: relative;
  width: 100%;
}

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

.input {
  width: 100%;
  padding: var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--navy-900);
  background-color: white;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  outline: none;
}

.input::placeholder {
  color: var(--navy-400);
}

.input:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
  transform: scale(1.01);
}

.input:disabled {
  background-color: var(--navy-100);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Input with prefix (₦) */
.input-with-prefix {
  padding-left: var(--space-12);
}

.input-prefix {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-weight: var(--weight-semibold);
  color: var(--navy-600);
  pointer-events: none;
}

/* Input states */
.input-success {
  border-color: var(--success);
}

.input-success:focus {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.input-error {
  border-color: var(--error);
}

.input-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-warning {
  border-color: var(--warning);
}

.input-warning:focus {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Input helper text */
.input-hint {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--navy-500);
}

.input-error-msg {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--error);
  font-weight: var(--weight-medium);
}

.input-error-msg::before {
  content: '⚠';
  font-size: var(--text-base);
}

/* Monospace input for numbers */
.input-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
}

/* Size variants */
.input-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.input-lg {
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

/* ============================================
   6. CARD SYSTEM (Glassmorphism & Depth)
   ============================================ */

.card {
  background-color: white;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--transition-base);
}

/* Elevated card (subtle shadow) */
.card-elevated {
  box-shadow: var(--shadow-md);
}

/* Outlined card */
.card-outlined {
  border: 1px solid var(--navy-200);
}

/* Glassmorphism card */
.card-glass {
  background: var(--glass-light);
  backdrop-filter: var(--backdrop-blur-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-xl);
}

/* Interactive card (hover effect) */
.card-hover {
  cursor: pointer;
  user-select: none;
}

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

/* Highlighted card (with accent border) */
.card-highlighted {
  border-left: 4px solid var(--green-600);
  background: linear-gradient(135deg, var(--green-50) 0%, white 100%);
}

.card-highlighted-purple {
  border-left: 4px solid var(--purple-600);
  background: linear-gradient(135deg, var(--purple-50) 0%, white 100%);
}

/* Card with gradient background */
.card-gradient-green {
  background: var(--gradient-green);
  color: white;
}

.card-gradient-purple {
  background: var(--gradient-purple);
  color: white;
}

.card-gradient-navy {
  background: var(--gradient-navy);
  color: white;
}

/* Card header */
.card-header {
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--navy-200);
  margin-bottom: var(--space-6);
}

.card-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--navy-900);
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--navy-500);
}

/* Card footer */
.card-footer {
  padding-top: var(--space-6);
  border-top: 1px solid var(--navy-200);
  margin-top: var(--space-6);
}

/* ============================================
   7. BADGE SYSTEM
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1-5) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  white-space: nowrap;
}

.badge-success {
  background-color: var(--green-100);
  color: var(--green-800);
  border: 1px solid var(--green-300);
}

.badge-info {
  background-color: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.badge-warning {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.badge-error {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.badge-purple {
  background-color: var(--purple-100);
  color: var(--purple-800);
  border: 1px solid var(--purple-300);
}

.badge-navy {
  background-color: var(--navy-100);
  color: var(--navy-800);
  border: 1px solid var(--navy-300);
}

/* Dot badge (with pulsing indicator) */
.badge-dot {
  position: relative;
  padding-left: var(--space-6);
}

.badge-dot::before {
  content: '';
  position: absolute;
  left: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-dot-pulse::before {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Large badge */
.badge-lg {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

/* ============================================
   8. PROGRESS & WIZARDS
   ============================================ */

/* Progress bar */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: var(--navy-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-rainbow);
  border-radius: var(--radius-full);
  transition: width 600ms var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Shimmer effect on progress */
.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Wizard steps */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.wizard-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--navy-200);
  color: var(--navy-600);
  font-weight: var(--weight-semibold);
  transition: all var(--transition-base);
}

.wizard-step.active .wizard-step-number {
  background: var(--gradient-purple);
  color: white;
  box-shadow: var(--shadow-purple);
  transform: scale(1.1);
}

.wizard-step.completed .wizard-step-number {
  background: var(--green-600);
  color: white;
}

.wizard-step.completed .wizard-step-number::before {
  content: '✓';
}

.wizard-step-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--navy-600);
}

.wizard-step.active .wizard-step-label {
  color: var(--navy-900);
  font-weight: var(--weight-semibold);
}

.wizard-divider {
  flex: 1;
  height: 2px;
  background-color: var(--navy-200);
  transition: background-color var(--transition-base);
}

.wizard-step.completed ~ .wizard-divider {
  background-color: var(--green-600);
}

/* Continue to next comment for more... */
/* ============================================
   9. ANIMATIONS & MICRO-INTERACTIONS
   ============================================ */

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

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

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

/* Scale animations */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Number count-up (for results) */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Slide animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Bounce (for celebrations) */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Shake (for errors) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* Utility animation classes */
.fade-in {
  animation: fadeIn 0.4s var(--ease-out);
}

.fade-in-up {
  animation: fadeInUp 0.5s var(--ease-out);
}

.scale-in {
  animation: scaleIn 0.3s var(--ease-out);
}

.count-up {
  animation: countUp 0.6s var(--ease-out);
}

.slide-in-left {
  animation: slideInLeft 0.4s var(--ease-out);
}

.slide-in-right {
  animation: slideInRight 0.4s var(--ease-out);
}

.bounce {
  animation: bounce 1s ease-in-out infinite;
}

.shake {
  animation: shake 0.4s var(--ease-in-out);
}

/* Stagger delays (for lists) */
.stagger-1 { animation-delay: 100ms; }
.stagger-2 { animation-delay: 200ms; }
.stagger-3 { animation-delay: 300ms; }
.stagger-4 { animation-delay: 400ms; }
.stagger-5 { animation-delay: 500ms; }

/* Hover lift effect */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

/* Hover glow effect */
.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* Focus ring (accessibility) */
.focus-ring:focus-visible {
  outline: 2px solid var(--purple-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   10. TOOLTIP SYSTEM
   ============================================ */

.tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--navy-300);
  color: var(--navy-700);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: help;
  transition: all var(--transition-fast);
}

.tooltip-trigger:hover {
  background-color: var(--purple-600);
  color: white;
  transform: scale(1.1);
}

.tooltip-content {
  position: absolute;
  z-index: var(--z-tooltip);
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 320px;
  padding: var(--space-4);
  background-color: white;
  border: 1px solid var(--navy-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  pointer-events: none;
}

.tooltip-trigger:hover .tooltip-content,
.tooltip-trigger:focus .tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

.tooltip-header {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--navy-900);
  margin-bottom: var(--space-2);
}

.tooltip-body {
  font-size: var(--text-sm);
  color: var(--navy-600);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-2);
}

.tooltip-example {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--navy-700);
  background-color: var(--navy-50);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}

/* Tooltip arrow */
.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: white;
}

/* ============================================
   11. EMPTY STATES
   ============================================ */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  max-width: 500px;
  margin: 0 auto;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: var(--space-6);
  opacity: 0.5;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

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

.empty-state-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--navy-900);
  margin-bottom: var(--space-3);
}

.empty-state-text {
  font-size: var(--text-base);
  color: var(--navy-600);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.empty-state-action {
  margin-top: var(--space-6);
}

/* ============================================
   12. LOADING STATES
   ============================================ */

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--navy-200);
  border-top-color: var(--purple-600);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--navy-200) 0%,
    var(--navy-100) 50%,
    var(--navy-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; }
}

.skeleton-text {
  height: 16px;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 28px;
  width: 60%;
  margin-bottom: var(--space-4);
}

.skeleton-card {
  height: 200px;
}

/* Calculating indicator */
.calculating {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.calculating::after {
  content: '';
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--purple-600);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================
   13. NOTIFICATION SYSTEM
   ============================================ */

.notification {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  max-width: 400px;
  padding: var(--space-4);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  z-index: var(--z-modal);
  animation: slideInRight 0.3s var(--ease-out);
}

.notification-success {
  border-left: 4px solid var(--success);
}

.notification-error {
  border-left: 4px solid var(--error);
}

.notification-warning {
  border-left: 4px solid var(--warning);
}

.notification-info {
  border-left: 4px solid var(--info);
}

.notification-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--navy-900);
  margin-bottom: var(--space-2);
}

.notification-message {
  font-size: var(--text-sm);
  color: var(--navy-600);
  line-height: var(--leading-relaxed);
}

.notification-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  font-size: var(--text-xl);
  color: var(--navy-400);
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
  transition: color var(--transition-fast);
}

.notification-close:hover {
  color: var(--navy-700);
}

/* ============================================
   14. ACCORDION SYSTEM
   ============================================ */

.accordion-item {
  margin-bottom: var(--space-3);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--navy-900);
  background-color: white;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
}

.accordion-header:hover {
  border-color: var(--purple-300);
  background-color: var(--purple-50);
}

.accordion-header[aria-expanded="true"] {
  border-color: var(--purple-500);
  background-color: var(--purple-50);
}

.accordion-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-base);
}

.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow) var(--ease-out);
}

.accordion-content[aria-hidden="false"] {
  max-height: 2000px;
  padding-top: var(--space-4);
}

.accordion-body {
  padding: var(--space-4);
  background-color: var(--navy-50);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
}

/* ============================================
   15. UTILITY CLASSES
   ============================================ */

/* Spacing utilities */
.m-0 { margin: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

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

.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-16 { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.py-24 { padding-top: var(--space-24); padding-bottom: var(--space-24); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }

/* Gap utilities */
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Display utilities */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

/* Flexbox utilities */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }

/* Grid utilities */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text transform */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* Font weight */
.font-normal { font-weight: var(--weight-normal); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

/* Width utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }

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

@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

/* Color utilities */
.text-navy-700 { color: var(--navy-700); }
.text-navy-900 { color: var(--navy-900); }
.text-green-600 { color: var(--green-600); }
.text-purple-600 { color: var(--purple-600); }
.text-white { color: white; }

.bg-white { background-color: white; }
.bg-navy-50 { background-color: var(--navy-50); }
.bg-green-50 { background-color: var(--green-50); }
.bg-purple-50 { background-color: var(--purple-50); }

/* ============================================
   16. RESPONSIVE UTILITIES
   ============================================ */

/* Mobile-only */
@media (max-width: 639px) {
  .mobile-hidden { display: none; }
  .mobile-text-center { text-align: center; }
}

/* Tablet and up */
@media (min-width: 640px) {
  .tablet-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tablet-flex-row { flex-direction: row; }
}

/* Desktop and up */
@media (min-width: 768px) {
  .desktop-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desktop-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================
   17. ACCESSIBILITY
   ============================================ */

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

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--purple-500);
  outline-offset: 2px;
}

/* Skip to main content */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--purple-600);
  color: white;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: var(--z-modal);
}

.skip-to-main:focus {
  top: var(--space-2);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   18. PRINT STYLES
   ============================================ */

@media print {
  body {
    background-color: white;
    color: black;
  }

  .no-print {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  a {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: smaller;
  }

  button {
    display: none;
  }
}

/* ============================================
   19. DARK MODE (Future-ready)
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Placeholder for dark mode styles */
  /* Not implementing now, but structure is ready */
}

/* ============================================
   END OF DESIGN SYSTEM V2
   ============================================ */
