/* ===================================================================
   Design System - Variables, Thèmes & Reset (WCAG 2.1 AAA)
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Thème Sombre High-Contrast (Défaut) */
  --bg-main: #0b1120;
  --bg-card: #151e32;
  --bg-card-hover: #1e2942;
  --bg-sidebar: #111827;
  --bg-header: rgba(11, 17, 32, 0.95);
  --border-color: #27354e;
  --border-color-hover: #3b82f6;

  /* Contrastes Élevés (WCAG AAA) */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #cbd5e1;

  /* Palette dynamique (Bleu Roi & Cyan Émeraude) */
  --accent-primary: #3b82f6;
  --accent-secondary: #06b6d4;
  --accent-blue-dark: #1d4ed8;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
  --accent-glow: rgba(59, 130, 246, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.5);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(248, 250, 252, 0.95);
  --border-color: #cbd5e1;
  --border-color-hover: #1d4ed8;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;

  --accent-primary: #1d4ed8;
  --accent-secondary: #0284c7;
  --accent-blue-dark: #1e40af;
  --accent-gradient: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
  --accent-glow: rgba(29, 78, 216, 0.2);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.12);
}

/* Accessibility: Visually Hidden Helper (Screen Readers) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent-primary);
  color: #ffffff !important;
  padding: 12px 24px;
  z-index: 10000;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 20px;
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* Reduced Motion (WCAG 2.1) */
@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;
  }
}

/* Reset & Élément de base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  background-image:
    radial-gradient(at 10% 10%, rgba(37, 99, 235, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(2, 132, 199, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Focus Visible au clavier (a11y) */
:focus-visible {
  outline: 3px solid var(--accent-primary) !important;
  outline-offset: 3px !important;
  border-radius: var(--radius-sm);
}

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

a:hover,
a:focus-visible {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* Container Principal Layout */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 96px 24px 40px;
  width: 100%;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}
