/**
 * WebAlchimie Design System v1.0
 * Design system complet pour agence IA/web PME
 * Date: 2026-03-19
 * WCAG AA compliant
 */

/* ========================================
   1. PALETTE COULEURS
   ======================================== */

:root {
  /* Primaire - Bleu tech moderne */
  --color-primary-50: #e6f0ff;
  --color-primary-100: #b3d9ff;
  --color-primary-200: #80c2ff;
  --color-primary-300: #4dabff;
  --color-primary-400: #1a94ff;
  --color-primary-500: #0077e6; /* Principal */
  --color-primary-600: #005db3;
  --color-primary-700: #004380;
  --color-primary-800: #002952;
  --color-primary-900: #001426;

  /* Secondaire - Violet IA/Innovation */
  --color-secondary-50: #f3e5ff;
  --color-secondary-100: #dab3ff;
  --color-secondary-200: #c180ff;
  --color-secondary-300: #a84dff;
  --color-secondary-400: #8f1aff;
  --color-secondary-500: #7600e6; /* Principal */
  --color-secondary-600: #5d00b3;
  --color-secondary-700: #430080;
  --color-secondary-800: #2a0052;
  --color-secondary-900: #140026;

  /* Accents */
  --color-accent-success: #10b981; /* Vert succès */
  --color-accent-warning: #f59e0b; /* Orange attention */
  --color-accent-error: #ef4444; /* Rouge erreur */
  --color-accent-info: #3b82f6; /* Bleu info */

  /* Neutres */
  --color-neutral-0: #ffffff;
  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2937;
  --color-neutral-900: #111827;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-700) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--color-secondary-500) 0%, var(--color-secondary-700) 100%);
  --gradient-hero: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-secondary-600) 100%);
  --gradient-subtle: linear-gradient(180deg, var(--color-neutral-0) 0%, var(--color-neutral-50) 100%);

  /* ========================================
     2. TYPOGRAPHIE
     ======================================== */

  /* Familles de polices */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;

  /* Tailles de police - Scale modulaire (1.250 - Major Third) */
  --font-size-xs: 0.64rem;    /* 10.24px */
  --font-size-sm: 0.8rem;     /* 12.8px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.25rem;    /* 20px */
  --font-size-xl: 1.563rem;   /* 25px */
  --font-size-2xl: 1.953rem;  /* 31.25px */
  --font-size-3xl: 2.441rem;  /* 39px */
  --font-size-4xl: 3.052rem;  /* 48.8px */
  --font-size-5xl: 3.815rem;  /* 61px */

  /* Poids de police */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Line heights */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  /* ========================================
     3. SPACING SCALE (Base 8px)
     ======================================== */

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

  /* ========================================
     4. BORDER RADIUS
     ======================================== */

  --radius-none: 0;
  --radius-sm: 0.25rem;   /* 4px - inputs, small buttons */
  --radius-base: 0.5rem;  /* 8px - buttons, cards */
  --radius-md: 0.75rem;   /* 12px - larger cards */
  --radius-lg: 1rem;      /* 16px - modals */
  --radius-xl: 1.5rem;    /* 24px - hero sections */
  --radius-full: 9999px;  /* Pills, avatars */

  /* ========================================
     5. SHADOWS (Depth)
     ======================================== */

  --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-base: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(0, 119, 230, 0.3);

  /* ========================================
     6. ANIMATIONS & TRANSITIONS
     ======================================== */

  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

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

/* ========================================
   7. TYPOGRAPHIE - HEADINGS
   ======================================== */

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

h1, .h1 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: -0.025em;
}

h2, .h2 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

h3, .h3 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

h4, .h4 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
}

h5, .h5 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

h6, .h6 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}

/* ========================================
   8. TYPOGRAPHIE - BODY
   ======================================== */

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  color: var(--color-neutral-700);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.lead {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-relaxed);
  color: var(--color-neutral-600);
}

.small {
  font-size: var(--font-size-sm);
}

.text-muted {
  color: var(--color-neutral-500);
}

/* ========================================
   9. BUTTONS & INTERACTIVE ELEMENTS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--color-neutral-0);
}

.btn-primary:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: var(--color-neutral-0);
}

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

.btn-outline:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary-600);
}

/* ========================================
   10. ACCESSIBILITÉ WCAG AA
   ======================================== */

/* Focus states - keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-4) var(--space-6);
  background: var(--color-primary-600);
  color: var(--color-neutral-0);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-base);
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: var(--space-4);
}

/* Ensure minimum contrast ratios (WCAG AA: 4.5:1) */
.bg-primary { background: var(--color-primary-600); color: var(--color-neutral-0); }
.bg-secondary { background: var(--color-secondary-600); color: var(--color-neutral-0); }
.bg-dark { background: var(--color-neutral-900); color: var(--color-neutral-0); }
.bg-light { background: var(--color-neutral-50); color: var(--color-neutral-900); }

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-primary-500: #0055b3;
    --color-secondary-500: #5500b3;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

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

/* ========================================
   11. CARDS & CONTAINERS
   ======================================== */

.card {
  background: var(--color-neutral-0);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-base);
  transition: all var(--transition-base);
}

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

/* ========================================
   12. ANIMATIONS
   ======================================== */

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

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

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

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

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

.animate-pulse {
  animation: pulse 2s var(--ease-in-out) infinite;
}

/* ========================================
   13. UTILITIES
   ======================================== */

.container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

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