/**
 * D2U Ségur - Styles globaux
 * 
 * Charte graphique médicale professionnelle
 * Fond clair, haute lisibilité, couleurs institutionnelles
 * 
 * Couleurs principales :
 * - Primaire : #052538 (Bleu marine institutionnel)
 * - Secondaire : #055145 (Vert santé)
 * - Neutre : #8c9fa6 (Gris bleuté)
 */

/* ==========================================================================
   VARIABLES CSS - THÈME MÉDICAL CLAIR
   ========================================================================== */

:root {
  /* -- Couleurs principales D2U Ségur -- */
  --primary: #052538;                        /* Bleu marine institutionnel */
  --primary-rgb: 5, 37, 56;
  --primary-light: #0a3a52;
  --primary-dark: #031a28;
  --primary-foreground: #ffffff;
  
  --secondary: #055145;                      /* Vert santé */
  --secondary-rgb: 5, 81, 69;
  --secondary-light: #0a7a68;
  --secondary-dark: #033b32;
  --secondary-foreground: #ffffff;
  
  --accent: #055145;                         /* Vert santé (accent) */
  --accent-light: #0a7a68;
  --accent-dark: #033b32;
  --accent-foreground: #ffffff;
  --accent-soft: rgba(5, 81, 69, 0.08);
  
  --muted: #8c9fa6;                          /* Gris bleuté */
  --muted-foreground: #5a6b73;
  --muted-light: #b8c5cb;
  
  /* -- Backgrounds (thème clair médical) -- */
  --background: #ffffff;
  --background-alt: #f8fafb;
  --background-subtle: #f0f4f6;
  --foreground: #1a2a32;
  
  --card: #ffffff;
  --card-foreground: #1a2a32;
  --card-hover: #f8fafb;
  --card-border: #e5eaed;
  
  /* -- Bordures -- */
  --border: #e0e6e9;
  --border-light: #edf1f3;
  --border-hover: #c8d2d7;
  --input: #e0e6e9;
  --input-focus: #052538;
  --ring: #052538;
  
  /* -- États -- */
  --success: #055145;
  --success-light: #e8f5f2;
  --success-foreground: #ffffff;
  
  --warning: #b45309;
  --warning-light: #fef3c7;
  --warning-foreground: #ffffff;
  
  --error: #dc2626;
  --error-light: #fee2e2;
  --error-foreground: #ffffff;
  
  --info: #0284c7;
  --info-light: #e0f2fe;
  --info-foreground: #ffffff;
  
  /* -- Typographie -- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Georgia', 'Cambria', 'Times New Roman', serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  
  /* -- Espacements -- */
  --space-0: 0;
  --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 */
  
  /* -- Radius -- */
  --radius-sm: 0.25rem;    /* 4px */
  --radius: 0.5rem;        /* 8px */
  --radius-md: 0.75rem;    /* 12px */
  --radius-lg: 1rem;       /* 16px */
  --radius-xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;
  
  /* -- Ombres (subtiles pour thème clair) -- */
  --shadow-sm: 0 1px 2px rgba(5, 37, 56, 0.04);
  --shadow: 0 1px 3px rgba(5, 37, 56, 0.06), 0 1px 2px rgba(5, 37, 56, 0.04);
  --shadow-md: 0 4px 6px rgba(5, 37, 56, 0.06), 0 2px 4px rgba(5, 37, 56, 0.04);
  --shadow-lg: 0 10px 15px rgba(5, 37, 56, 0.08), 0 4px 6px rgba(5, 37, 56, 0.04);
  --shadow-xl: 0 20px 25px rgba(5, 37, 56, 0.10), 0 10px 10px rgba(5, 37, 56, 0.04);
  --shadow-card: 0 1px 3px rgba(5, 37, 56, 0.05), 0 1px 2px rgba(5, 37, 56, 0.03);
  --shadow-card-hover: 0 4px 12px rgba(5, 37, 56, 0.08);
  
  /* -- Transitions -- */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* -- Z-index -- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;
  
  /* -- Dégradés subtils -- */
  --gradient-primary: linear-gradient(135deg, #052538 0%, #0a3a52 100%);
  --gradient-secondary: linear-gradient(135deg, #055145 0%, #0a7a68 100%);
  --gradient-light: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
  --gradient-subtle: linear-gradient(180deg, #f8fafb 0%, #f0f4f6 100%);
}

/* ==========================================================================
   RESET CSS MODERNE
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--foreground);
  background-color: var(--background-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

a:hover {
  color: var(--primary-light);
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--primary);
}

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

p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   UTILITAIRES
   ========================================================================== */

/* -- Conteneurs -- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }
.container-xl { max-width: 1280px; }

/* -- Texte -- */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

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

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

/* -- Backgrounds -- */
.bg-white { background-color: #ffffff; }
.bg-primary { background-color: var(--primary); color: var(--primary-foreground); }
.bg-secondary { background-color: var(--secondary); color: var(--secondary-foreground); }
.bg-subtle { background-color: var(--background-subtle); }

/* -- Espacements -- */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.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); }

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

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

.py-2 { padding-block: var(--space-2); }
.py-4 { padding-block: var(--space-4); }
.py-6 { padding-block: var(--space-6); }
.py-8 { padding-block: var(--space-8); }

.px-2 { padding-inline: var(--space-2); }
.px-4 { padding-inline: var(--space-4); }
.px-6 { padding-inline: var(--space-6); }
.px-8 { padding-inline: var(--space-8); }

/* -- Flexbox -- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.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-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.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); }
.flex-1 { flex: 1; }

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

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

/* -- Position -- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* -- Visibilité -- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* -- Cards médicales -- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-hover);
}

/* -- Animations -- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

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

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease-out; }
.animate-slide-in-right { animation: slideInRight 0.3s ease-out; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

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

/* Focus visible pour accessibilité (conforme Ségur) */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:hidden { display: none; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:text-lg { font-size: var(--text-lg); }
}

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:text-xl { font-size: var(--text-xl); }
}

@media (min-width: 1024px) {
  .lg\:flex { display: flex; }
  .lg\:hidden { display: none; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:text-2xl { font-size: var(--text-2xl); }
}
