/* ========================================
   LE COQ NUMERIQUE - SYSTEME DE DESIGN
   ======================================== */

/* ----- POLICES AUTO-HÉBERGÉES -----
   Variable fonts : un seul fichier woff2 couvre toutes les graisses.
   font-display: optional → le navigateur n'attend jamais la police,
   pas de layout shift, pas de flash de texte non stylé.
*/
@font-face {
    font-family: 'Sora';
    src: url('/assets/fonts/sora-latin-wght-normal.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Fraunces';
    src: url('/assets/fonts/fraunces-latin-opsz-wght-normal.woff2') format('woff2');
    font-weight: 300 900;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Fraunces';
    src: url('/assets/fonts/fraunces-latin-opsz-wght-italic.woff2') format('woff2');
    font-weight: 300 900;
    font-style: italic;
    font-display: optional;
}

/* ----- POLICES DE SUBSTITUTION (anti-CLS) -----
   Ajuste les métriques de la police système pour qu'elle ressemble
   à Sora/Fraunces pendant le bref instant de chargement.
*/
@font-face {
    font-family: 'Sora Fallback';
    src: local('Arial'), local('Helvetica Neue');
    size-adjust: 97%;
    ascent-override: 95%;
    descent-override: 22%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Fraunces Fallback';
    src: local('Georgia'), local('Times New Roman');
    size-adjust: 105%;
    ascent-override: 90%;
    descent-override: 20%;
    line-gap-override: 0%;
}

/* ----- VARIABLES CSS ----- */
:root {
  /* Couleurs Primaires */
  --color-bleu-900: #1e3a8a;
  --color-bleu-800: #1e40af;
  --color-bleu-700: #1d4ed8;
  --color-bleu-600: #2563eb;
  --color-bleu-500: #3b82f6;
  --color-bleu-100: #dbeafe;
  --color-bleu-50: #eff6ff;

  /* Couleurs Accent */
  --color-rouge-600: #dc2626;
  --color-rouge-500: #ef4444;
  --color-rouge-100: #fee2e2;
  --color-rouge-50: #fef2f2;

  /* Couleurs Semantiques */
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;

  /* Neutres */
  --color-slate-900: #0f172a;
  --color-slate-700: #334155;
  --color-slate-500: #64748b;
  --color-slate-300: #cbd5e1;
  --color-slate-100: #f1f5f9;

  /* Espacements */
  --space-section: 5rem;
  --space-section-lg: 7rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;

  /* Ombres */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow-blue: 0 0 30px rgba(37, 99, 235, 0.3);
  --shadow-glow-red: 0 0 30px rgba(239, 68, 68, 0.3);

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* UI Theme Tokens */
  --ui-bg: #f8fafc;
  --ui-bg-strong: #eef2ff;
  --ui-surface: #ffffff;
  --ui-surface-2: #f1f5f9;
  --ui-border: #e2e8f0;
  --ui-text: #0f172a;
  --ui-muted: #475569;
  --ui-accent: #1d4ed8;
  --ui-accent-strong: #0b3aa5;
  --ui-accent-soft: #dbeafe;
  --ui-danger: #b91c1c;
  --ui-success: #15803d;
  --ui-focus: #f59e0b;
}


/* ----- ANIMATIONS KEYFRAMES ----- */

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide In Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Pulse Glow */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }
}

/* Float */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Counter */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- CLASSES D'ANIMATION ----- */

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease-out forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.5s ease-out forwards;
}

.animate-slide-right {
  animation: slideInRight 0.5s ease-out forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Initial state for scroll animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-animate-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-animate-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ----- BASE UI ----- */
.app-shell {
  background: radial-gradient(1200px 500px at 10% -10%, rgba(29, 78, 216, 0.14), transparent),
              radial-gradient(900px 400px at 90% -20%, rgba(220, 38, 38, 0.12), transparent),
              var(--ui-bg);
  color: var(--ui-text);
  min-height: 100vh;
}

body {
  font-family: "Sora", "Sora Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6,
.heading-display {
  font-family: "Fraunces", "Fraunces Fallback", "Sora", serif;
  letter-spacing: 0.005em;
}

.section {
  padding: 4.5rem 0;
}

.section-lg {
  padding: 6rem 0;
}

.section-alt {
  padding: 4.5rem 0;
  background: var(--ui-surface-2);
}

.section-hero {
  padding: 5.5rem 0;
}

.card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
}

.card-soft {
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
  border-radius: 1rem;
}

.card-elevated {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-xl);
}

.card-inline {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 0.75rem;
}

.chip {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  border-radius: 9999px;
  padding: 0.35rem 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--ui-accent);
  color: #fff;
  border-radius: 9999px;
  padding: 0.85rem 1.6rem;
  font-weight: 700;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--ui-accent-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-primary-light {
  background: #ffffff;
  color: #0f172a;
}

.btn-primary-light:hover {
  background: #e2e8f0;
}

.btn-secondary {
  border: 1px solid color-mix(in srgb, var(--ui-text) 20%, transparent);
  color: var(--ui-text);
  border-radius: 9999px;
  padding: 0.85rem 1.6rem;
  font-weight: 600;
  background: transparent;
  transition: background 150ms ease, color 150ms ease, border 150ms ease;
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--ui-text) 8%, transparent);
}

.btn-ghost-light {
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  border-radius: 9999px;
  padding: 0.85rem 1.6rem;
  font-weight: 600;
  background: transparent;
  transition: background 150ms ease, border 150ms ease;
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ui-muted {
  color: var(--ui-muted);
}


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


.scroll-animate-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scroll-animate-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ----- COMPOSANTS BOUTONS ----- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-bleu-600), var(--color-bleu-700));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-bleu-700), var(--color-bleu-800));
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-rouge-500), var(--color-rouge-600));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--color-rouge-600), #b91c1c);
  box-shadow: var(--shadow-lg), var(--shadow-glow-red);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid currentColor;
  color: var(--color-bleu-600);
}

.btn-outline:hover {
  background: var(--color-bleu-50);
  transform: translateY(-2px);
}

.btn-outline-white {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--color-bleu-700);
}

.btn-ghost:hover {
  background: var(--color-bleu-50);
}

/* ----- COMPOSANTS CARDS ----- */

.card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card-elevated {
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-slate-100);
}

.card-elevated:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-8px);
}

.card-glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.card-alert {
  border-left: 4px solid var(--color-rouge-500);
  background: var(--color-rouge-50);
}

.card-success {
  border-left: 4px solid var(--color-success);
  background: var(--color-success-light);
}

.card-info {
  border-left: 4px solid var(--color-bleu-500);
  background: var(--color-bleu-50);
}

/* ----- COMPOSANTS BADGES ----- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-primary {
  background: var(--color-bleu-100);
  color: var(--color-bleu-800);
}

.badge-danger {
  background: var(--color-rouge-100);
  color: var(--color-rouge-600);
}

.badge-success {
  background: var(--color-success-light);
  color: #065f46;
}

.badge-warning {
  background: var(--color-warning-light);
  color: #92400e;
}

.badge-dark {
  background: var(--color-slate-900);
  color: white;
}

.badge-popular {
  background: linear-gradient(135deg, var(--color-rouge-500), #f97316);
  color: white;
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ----- COMPOSANTS INPUTS ----- */

.input-group {
  position: relative;
}

.input-floating {
  width: 100%;
  padding: 1.25rem 1rem 0.5rem;
  border: 2px solid var(--color-slate-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all var(--transition-fast);
  background: white;
}

.input-floating:focus {
  outline: none;
  border-color: var(--color-bleu-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-floating:focus + .input-label,
.input-floating:not(:placeholder-shown) + .input-label {
  top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-bleu-600);
}

.input-label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-size: 1rem;
  color: var(--color-slate-500);
  pointer-events: none;
  transition: all var(--transition-fast);
}

/* ----- SECTIONS ----- */

.section {
  padding: var(--space-section) 0;
}

.section-lg {
  padding: var(--space-section-lg) 0;
}

.section-dark {
  background: linear-gradient(135deg, var(--color-bleu-900), var(--color-bleu-800));
  color: white;
}

.section-light {
  background: linear-gradient(180deg, white, var(--color-bleu-50));
}

.section-pattern {
  position: relative;
}

.section-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* ----- TEXTE GRADIENT ----- */

.text-gradient {
  background: linear-gradient(135deg, var(--color-bleu-600), var(--color-rouge-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-light {
  background: linear-gradient(135deg, white, var(--color-bleu-200));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ----- EFFETS SPECIAUX ----- */

.glow-blue {
  box-shadow: var(--shadow-glow-blue);
}

.glow-red {
  box-shadow: var(--shadow-glow-red);
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Ligne decorative */
.divider-gradient {
  height: 4px;
  background: linear-gradient(90deg, var(--color-bleu-600), var(--color-rouge-500), var(--color-bleu-600));
  border-radius: var(--radius-full);
}

/* ----- ICONES ----- */

.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 2rem; height: 2rem; }
.icon-xl { width: 3rem; height: 3rem; }

.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.icon-circle-sm { width: 2.5rem; height: 2.5rem; }
.icon-circle-md { width: 3.5rem; height: 3.5rem; }
.icon-circle-lg { width: 4.5rem; height: 4.5rem; }

/* ----- PROGRESS BAR ----- */

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--color-slate-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-bleu-500), var(--color-bleu-600));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ----- TOOLTIPS ----- */

.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.5rem 0.75rem;
  background: var(--color-slate-900);
  color: white;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ----- RESPONSIVE ----- */

@media (max-width: 768px) {
  :root {
    --space-section: 3rem;
    --space-section-lg: 4rem;
  }

  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

/* ----- ACCESSIBILITE ----- */

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

*:focus-visible {
  outline: 2px solid var(--color-bleu-500);
  outline-offset: 2px;
}

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