/* 
 * Cabinet Infirmier Corné - Système de Design Premium
 * Design System moderne avec glassmorphism et animations subtiles
 */

:root {
  /* Couleurs brand santé rassurante */
  --brand-700: #155e92;
  --brand-600: #1b6aa5;
  --brand-500: #2a7dbd;
  --brand-400: #4a94d1;
  --brand-300: #6aa8e0;
  
  /* Accents verts santé */
  --accent-500: #2fb1a3;
  --accent-400: #4fc2b6;
  --accent-300: #9fe3d9;
  --accent-200: #c7f0ea;
  
  /* Backgrounds */
  --bg: #ffffff;
  --bg-alt: #f6f9fc;
  --bg-soft: #fafbfc;
  --glass: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  
  /* Textes */
  --text-900: #0f172a;
  --text-800: #1e293b;
  --text-700: #334155;
  --text-600: #475569;
  --text-500: #64748b;
  --text-400: #94a3b8;
  --text-300: #cbd5e1;
  
  /* Bordures et surfaces */
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  
  /* Géométrie */
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  
  /* Ombres premium */
  --shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(2, 6, 23, 0.12);
  --shadow-xl: 0 25px 50px rgba(2, 6, 23, 0.15);
  
  /* 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;
  --space-16: 64px;
  --space-20: 80px;
  
  /* Container */
  --container: 1200px;
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  
  /* Effets visuels */
  --blur: 14px;
  --blur-sm: 8px;
  --blur-lg: 20px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-elastic: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Reset moderne et base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-900);
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbff 60%, #f3fbf8 100%);
  min-height: 100vh;
}

/* Layout helpers */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }

.grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.flex {
  display: flex;
}

.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Cards premium avec glassmorphism */
.card {
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.92) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-6);
  transform: translateZ(0);
  transition: transform var(--transition-bounce), 
              box-shadow var(--transition-bounce),
              border-color var(--transition-smooth);
  backdrop-filter: saturate(140%) blur(6px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(42, 125, 189, 0.15);
}

.card:hover::before {
  opacity: 1;
}

/* Glass effect */
.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

/* Boutons modernes avec micro-interactions */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  border-radius: var(--radius-full);
  padding: 12px 18px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--transition-fast), 
              border-color var(--transition-smooth),
              filter var(--transition-smooth);
  cursor: pointer;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(90deg, var(--brand-600), var(--accent-500));
  color: #fff;
  box-shadow: 0 10px 20px rgba(26, 114, 169, 0.25);
}

.btn-primary:hover {
  filter: saturate(1.05) brightness(1.02);
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(26, 114, 169, 0.35);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--brand-600);
}

.btn-ghost:hover {
  background: rgba(42, 125, 189, 0.06);
  border-color: var(--brand-400);
}

.btn-glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur-sm));
  border-color: var(--glass-border);
  color: var(--text-700);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Effet ripple sur les boutons */
.btn::before {
  content: '';
  position: absolute;
  inset: 50% 50%;
  width: 0;
  height: 0;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%);
  z-index: -1;
  transition: width 0.45s ease, height 0.45s ease, opacity 0.6s ease;
  opacity: 0;
}

.btn:hover::before {
  width: 220px;
  height: 220px;
  opacity: 1;
}

.btn-primary::before {
  background: rgba(255, 255, 255, 0.2);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: rgba(47, 177, 163, 0.12);
  color: var(--accent-500);
  border: 1px solid rgba(47, 177, 163, 0.22);
}

.badge-primary {
  background: rgba(42, 125, 189, 0.12);
  color: var(--brand-600);
  border-color: rgba(42, 125, 189, 0.22);
}

/* Navigation avec underline animée */
.nav-underline {
  display: flex;
  gap: var(--space-2);
}

.nav-underline a {
  position: relative;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-700);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-smooth);
}

.nav-underline a::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-600), var(--accent-500));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
  border-radius: 2px;
}

.nav-underline a:hover {
  color: var(--brand-600);
}

.nav-underline a:hover::after,
.nav-underline a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-underline a[aria-current="page"] {
  color: var(--brand-600);
}

/* Hero section premium */
.hero {
  position: relative;
  padding: var(--space-20) 0;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: 
    radial-gradient(1200px 400px at 10% -20%, #e9f4ff, transparent 70%),
    radial-gradient(900px 400px at 90% -10%, #e6fff8, transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 70%);
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-900), var(--brand-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-700);
  max-width: 64ch;
  font-size: 18px;
  margin-bottom: var(--space-6);
}

/* Blobs fluides pour arrière-plan */
.blob {
  position: absolute;
  filter: blur(24px);
  opacity: 0.5;
  pointer-events: none;
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.blob.b1 {
  top: -60px;
  left: -40px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle at 30% 30%, #bfe1ff, transparent 60%);
  animation-delay: -2s;
}

.blob.b2 {
  top: -40px;
  right: -60px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at 70% 30%, #bff3ea, transparent 60%);
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-10px) scale(1.02); }
}

/* Animations on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Tilt effect pour cartes */
.card-tilt {
  transform-style: preserve-3d;
  transition: transform var(--transition-bounce);
}

.card-tilt .tilt-lift {
  transition: transform var(--transition-bounce);
  transform-style: preserve-3d;
}

.card-tilt:hover .tilt-lift {
  transform: translateZ(12px);
}

/* Parallaxe container */
.parallax {
  position: relative;
  perspective: 800px;
}

.parallax .layer {
  position: absolute;
  inset: 0;
  will-change: transform;
  pointer-events: none;
}

/* Typography améliorée */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

/* Focus states accessibles */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header sticky premium */
.header-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: backdrop-filter var(--transition-smooth),
              background var(--transition-smooth),
              border-color var(--transition-smooth);
}

.header-sticky.scrolled {
  backdrop-filter: blur(var(--blur)) saturate(140%);
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsive design */
@media (max-width: 768px) {
  .hero {
    padding: var(--space-16) 0;
    text-align: center;
  }
  
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 var(--space-4);
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* Respect prefers-reduced-motion */
@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;
  }
  
  .blob {
    animation: none;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Print styles */
@media print {
  .blob,
  .parallax .layer {
    display: none;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid var(--border);
  }
}

