/* RetraiteFlow — Design Tokens */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root,
[data-theme="light"] {
  color-scheme: light;

  /* Couleurs principales */
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-glow: rgba(37, 99, 235, 0.15);

  --secondary: #f59e0b;
  --secondary-light: #fbbf24;

  /* Neutres & surfaces sémantiques */
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --light: #f8fafc;
  --light-soft: #f1f5f9;
  --white: #ffffff;
  --card: rgba(255, 255, 255, 0.97);

  --surface: rgba(255, 255, 255, 0.97);
  --surface-solid: #ffffff;
  --surface-muted: #f1f5f9;
  --surface-hover: #f8fafc;
  --surface-elevated: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --bg-base: #f8fafc;
  --bg-gradient:
    radial-gradient(ellipse 80% 50% at 0% -10%, var(--primary-glow), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(245, 158, 11, 0.06), transparent),
    linear-gradient(160deg, #f8fbff 0%, #eef4ff 40%, var(--light) 100%);

  --topbar-bg: rgba(255, 255, 255, 0.82);
  --topbar-border: rgba(148, 163, 184, 0.14);
  --modal-backdrop: rgba(15, 23, 42, 0.52);
  --header-gradient:
    linear-gradient(135deg, rgba(15, 23, 42, 0.78) 0%, rgba(37, 99, 235, 0.68) 50%, rgba(29, 78, 216, 0.82) 100%);

  /* Sémantiques */
  --success: #10b981;
  --success-light: #d1fae5;
  --success-dark: #047857;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --danger-dark: #b91c1c;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #0ea5e9;
  --info-light: #e0f2fe;
  --pink-light: #fce7f3;
  --pink: #ec4899;

  /* Bordures & ombres */
  --border: rgba(226, 232, 240, 0.9);
  --border-strong: #cbd5e1;
  --border-focus: rgba(37, 99, 235, 0.35);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);
  --shadow-xl: 0 20px 48px rgba(15, 23, 42, 0.14);
  --shadow-primary: 0 8px 24px rgba(37, 99, 235, 0.25);

  --input-bg: #ffffff;
  --input-disabled-bg: #f1f5f9;
  --table-row-hover: #eff6ff;
  --table-header-bg: #f8fafc;
  --table-border: #f1f5f9;
  --chart-panel-bg: linear-gradient(135deg, var(--primary-50) 0%, var(--light) 100%);
  --user-info-bg: linear-gradient(135deg, var(--primary-50) 0%, var(--light) 100%);

  --theme-color-meta: #2563eb;
  --icon-stroke: #2563eb;

  /* Rayons */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Typographie */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Espacements */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Layout */
  --content-max: 1280px;
  --sidebar-width: 260px;
  --topbar-height: 68px;

  /* Transitions & animations */
  --transition-fast: 0.15s ease;
  --transition: 0.2s ease;
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 1000;
  --z-toast: 10000;
}

[data-theme="dark"] {
  color-scheme: dark;

  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --primary-dark: #2563eb;
  --primary-50: rgba(59, 130, 246, 0.12);
  --primary-100: rgba(59, 130, 246, 0.2);
  --primary-glow: rgba(59, 130, 246, 0.22);

  --secondary: #fbbf24;
  --secondary-light: #fcd34d;

  --dark: #f1f5f9;
  --dark-soft: #e2e8f0;
  --muted: #94a3b8;
  --muted-light: #64748b;
  --light: #1e293b;
  --light-soft: #334155;
  --white: #0f172a;
  --card: rgba(30, 41, 59, 0.92);

  --surface: rgba(30, 41, 59, 0.92);
  --surface-solid: #1e293b;
  --surface-muted: #334155;
  --surface-hover: #273449;
  --surface-elevated: #243044;

  --text-primary: #f1f5f9;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --bg-base: #0b1120;
  --bg-gradient:
    radial-gradient(ellipse 80% 50% at 0% -10%, rgba(59, 130, 246, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(245, 158, 11, 0.08), transparent),
    linear-gradient(160deg, #0b1120 0%, #111827 40%, #0f172a 100%);

  --topbar-bg: rgba(15, 23, 42, 0.88);
  --topbar-border: rgba(148, 163, 184, 0.12);
  --modal-backdrop: rgba(0, 0, 0, 0.72);
  --header-gradient:
    linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(37, 99, 235, 0.55) 50%, rgba(29, 78, 216, 0.65) 100%);

  --success-light: rgba(16, 185, 129, 0.15);
  --success-dark: #34d399;
  --danger-light: rgba(239, 68, 68, 0.15);
  --danger-dark: #f87171;
  --warning-light: rgba(245, 158, 11, 0.15);
  --info-light: rgba(14, 165, 233, 0.15);
  --pink-light: rgba(236, 72, 153, 0.15);

  --border: rgba(51, 65, 85, 0.85);
  --border-strong: #475569;
  --border-focus: rgba(59, 130, 246, 0.45);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-primary: 0 8px 24px rgba(59, 130, 246, 0.3);

  --input-bg: #1e293b;
  --input-disabled-bg: #334155;
  --table-row-hover: rgba(59, 130, 246, 0.1);
  --table-header-bg: #273449;
  --table-border: #334155;
  --chart-panel-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(30, 41, 59, 0.8) 100%);
  --user-info-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(30, 41, 59, 0.9) 100%);

  --theme-color-meta: #1e293b;
  --icon-stroke: #60a5fa;
}

@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;
  }
}
