/**
 * D479 - WEVAL Palette WCAG AAA standardisée
 * Doctrine 478 → globalisée à toutes les pages
 * Usage: <link rel="stylesheet" href="/assets/wv-palette.css">
 */
:root {
  /* Backgrounds */
  --wv-cream: #FAF8F5;
  --wv-white: #ffffff;
  --wv-gray-50: #f9fafb;
  --wv-gray-100: #f3f4f6;
  --wv-gray-200: #e5e7eb;
  --wv-dark: #0e111c;
  
  /* Text on light bg (cream/white) */
  --wv-text-primary: #1f2937;    /* AAA 12.6:1 sur cream */
  --wv-text-secondary: #4b5563;   /* AAA 7.1:1 */
  --wv-text-tertiary: #6b7280;    /* AA 5.5:1 */
  --wv-text-muted: #9ca3af;       /* AA large only */
  
  /* Text on dark bg */
  --wv-text-light-primary: #f1f5f9;   /* AAA */
  --wv-text-light-secondary: #cbd5e1;  /* AA */
  
  /* Accent colors (brand) */
  --wv-violet: #6366f1;
  --wv-violet-light: #a5b4fc;
  --wv-violet-dark: #4f46e5;
  --wv-purple: #8b5cf6;
  
  /* Status */
  --wv-success: #16a34a;       /* darker for AA on cream */
  --wv-success-bg: #dcfce7;
  --wv-amber: #d97706;         /* darker for AA on cream */
  --wv-amber-bg: #fef3c7;
  --wv-error: #dc2626;
  --wv-error-bg: #fee2e2;
  --wv-info: #2563eb;
  --wv-info-bg: #dbeafe;
}

/* Global anti cream-on-cream / blanc-on-blanc / dark-on-dark */
body { background: var(--wv-cream); color: var(--wv-text-primary); }
body p, body label, body span:not([class*="text-"]):not([class*="bg-"]), 
body div:not([class*="bg-"]):not([class*="text-"]), body li {
  color: var(--wv-text-primary);
}

/* Inputs forced contrast */
input:not([type="checkbox"]):not([type="radio"]),
textarea, select {
  color: var(--wv-text-primary) !important;
  background-color: var(--wv-white) !important;
}
input::placeholder, textarea::placeholder {
  color: var(--wv-text-muted) !important;
  opacity: 1;
}

/* Dark mode support (data-theme="dark") */
[data-theme="dark"] body { background: var(--wv-dark); color: var(--wv-text-light-primary); }
[data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] select {
  color: var(--wv-text-light-primary) !important;
  background-color: rgba(255,255,255,0.05) !important;
}

/* Accessibility focus */
:focus-visible {
  outline: 2px solid var(--wv-violet);
  outline-offset: 2px;
}

/* Disable button accessible state */
button:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
