/* =================================================================
   Movaisy — main.css
   Design system : tokens, base, composants partagés.
   Référence : voir COMPONENTS.md
   ================================================================= */

/* -----------------------------------------------------------------
   1. TOKENS (variables CSS)
   ----------------------------------------------------------------- */
:root {
  /* Couleurs marque */
  --color-blue: #1a56db;
  --color-blue-dark: #0f3a8a;
  --color-gold: #d4a853;
  --color-gold-light: #f0d090;
  --color-black: #0a0a0a;

  /* Couleurs neutres (gris) */
  --color-gray-50: #f9fafb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Aliases legacy (anciennes variables — à éviter dans le nouveau code) */
  --blue: var(--color-blue);
  --blue-dark: var(--color-blue-dark);
  --gold: var(--color-gold);
  --gold-light: var(--color-gold-light);
  --black: var(--color-black);

  /* Échelle d'espacements (8-point scale) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  /* Typographie : 1 seule police (Poppins, voir BRAND.md) */
  --font-family-base: 'Poppins', system-ui, -apple-system, sans-serif;

  --font-size-xs: 0.75rem;    /* 12 */
  --font-size-sm: 0.875rem;   /* 14 */
  --font-size-base: 1rem;     /* 16 */
  --font-size-lg: 1.125rem;   /* 18 */
  --font-size-xl: 1.25rem;    /* 20 */
  --font-size-2xl: 1.5rem;    /* 24 */
  --font-size-3xl: 1.875rem;  /* 30 */
  --font-size-4xl: 2.25rem;   /* 36 */
  --font-size-5xl: 3rem;      /* 48 */
  --font-size-6xl: 3.75rem;   /* 60 */
  --font-size-7xl: 4.5rem;    /* 72 */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Rayons */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease-out;
  --transition-slower: 0.8s ease-out;
}

/* -----------------------------------------------------------------
   2. BASE
   ----------------------------------------------------------------- */
* { font-family: var(--font-family-base); }

html { scroll-behavior: smooth; }
html, body { width: 100%; overflow-x: hidden; margin: 0; padding: 0; }

/* -----------------------------------------------------------------
   3. UTILITAIRES — couleurs (rétrocompatibles avec Tailwind)
   ----------------------------------------------------------------- */
.gradient-gold { background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%); }
.gradient-blue { background: linear-gradient(135deg, var(--color-blue-dark) 0%, var(--color-blue) 100%); }
.text-gold { color: var(--color-gold); }
.bg-gold { background-color: var(--color-gold); }

/* -----------------------------------------------------------------
   4. LOGO RECTANGLE (composant partagé)
   ----------------------------------------------------------------- */
.brand-logo-wrap {
  width: 180px;
  height: 54px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-black);
  border: 1px solid rgba(212, 168, 83, 0.55);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 55px rgba(212, 168, 83, 0.22);
  position: relative;
  flex: 0 0 auto;
  transform: translateZ(0);
}
.brand-logo-wrap::after {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(240, 208, 144, 0.55), rgba(26, 86, 219, 0.25));
  filter: blur(14px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--color-black);
  position: relative;
  z-index: 1;
  padding: 6px 10px;
}

/* -----------------------------------------------------------------
   5. ANIMATIONS — scroll reveal (utilisées avec Intersection Observer)
   ----------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--transition-slower);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all var(--transition-slower);
}
.slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all var(--transition-slower);
}
.slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--transition-slow);
}
.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* -----------------------------------------------------------------
   6. COMPOSANTS — Boutons
   ----------------------------------------------------------------- */
.btn-gold {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  transition: all var(--transition-base);
}
.btn-gold:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 40px rgba(212, 168, 83, 0.4);
}
.btn-blue {
  background: linear-gradient(135deg, var(--color-blue-dark) 0%, var(--color-blue) 100%);
  transition: all var(--transition-base);
}
.btn-blue:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 40px rgba(26, 86, 219, 0.4);
}

/* -----------------------------------------------------------------
   7. COMPOSANTS — Navigation (lien souligné au hover)
   ----------------------------------------------------------------- */
.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width var(--transition-base);
}
.nav-link:hover::after { width: 100%; }

/* -----------------------------------------------------------------
   7.b NAVBAR canonique (MOV-014)
   Logo nu sans pilule au repos. Au scroll, le conteneur interne
   devient un bandeau sombre arrondi flottant avec marge sur les
   côtés.
   ----------------------------------------------------------------- */
#navbar {
  transition: padding 0.4s ease;
}
#navbar > div {
  transition: all 0.4s ease;
}
#navbar.scrolled {
  padding-top: 12px;
}
#navbar.scrolled > div:not(#mobileMenu) {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  padding-top: 10px;
  padding-bottom: 10px;
  margin-left: 16px;
  margin-right: 16px;
  max-width: calc(100% - 32px);
}
@media (min-width: 768px) {
  #navbar.scrolled > div:not(#mobileMenu) {
    margin-left: 32px;
    margin-right: 32px;
    max-width: calc(100% - 64px);
  }
}

/* Logo nu dans la navbar (sans pilule)
   Le footer conserve .brand-logo-wrap. */
.navbar-logo {
  height: 44px;
  width: auto;
  display: block;
  border-radius: 8px;
}
#navbar.scrolled .navbar-logo {
  height: 36px;
}
@media (max-width: 767px) {
  .navbar-logo {
    height: 38px;
  }
  #navbar.scrolled .navbar-logo {
    height: 32px;
  }
}

/* -----------------------------------------------------------------
   7.c MENU MOBILE (drawer plein écran responsive)
   Override de la version Tailwind (hidden + md:hidden) pour avoir
   un vrai drawer animé avec close button et lock du scroll body.
   ----------------------------------------------------------------- */
#mobileMenu {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100;
  background: rgba(10, 10, 10, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex !important;
  flex-direction: column;
  padding: 88px 28px 32px;
  overflow-y: auto;
  /* Garde-fous contre l'héritage navbar.scrolled (pill arrondi) */
  margin: 0 !important;
  max-width: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  /* Animation drawer */
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease-out;
}
#mobileMenu.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 768px) {
  #mobileMenu {
    display: none !important;
  }
}

/* Override des classes Tailwind héritées du markup
   (px-6 py-4 flex flex-col gap-4) pour la version drawer. */
#mobileMenu > div {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  width: 100%;
}

/* Liens du drawer — gros tap targets, séparateur léger */
#mobileMenu a {
  font-size: 1.375rem !important; /* 22px */
  font-weight: 600 !important;
  padding: 18px 4px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: block;
}
#mobileMenu a:hover,
#mobileMenu a:active {
  color: var(--color-gold);
  padding-left: 8px !important;
}

/* CTA gold dans le drawer — séparé du reste, en bas, plus prominent */
#mobileMenu a.btn-gold {
  margin-top: 32px !important;
  padding: 18px 28px !important;
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  text-align: center;
  border-radius: 9999px !important;
  border-bottom: none;
  color: #000 !important;
}
#mobileMenu a.btn-gold:hover {
  padding-left: 28px !important;
}

/* Bouton fermer en haut à droite — tap target 44x44 (a11y) */
.mobile-drawer-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  color: var(--color-gold);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1;
}
.mobile-drawer-close:hover,
.mobile-drawer-close:focus-visible {
  background: rgba(212, 168, 83, 0.15);
  border-color: var(--color-gold);
  outline: none;
}

/* Lock du scroll de la page quand le drawer est ouvert */
body.menu-open {
  overflow: hidden;
}

/* Boutons du burger eux-mêmes — tap target 44x44 */
#menuBtn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -----------------------------------------------------------------
   7.d ADAPTATIONS RESPONSIVE GLOBALES (mobile-first cleanup)
   Compresse les paddings de section et les tailles de cards
   sur petits écrans pour éviter le scroll fatigue.
   ----------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Padding vertical des sections — compresse les grands py-* */
  section[class*="py-32"] {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  section[class*="py-24"] {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  section[class*="py-20"] {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  section[class*="py-16"] {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  /* Cards avec gros padding — réduit sur mobile */
  [class*="p-12"]:not(button):not(a) {
    padding: 1.75rem !important;
  }
  [class*="p-10"]:not(button):not(a) {
    padding: 1.5rem !important;
  }
  [class*="p-8"]:not(button):not(a) {
    padding: 1.25rem !important;
  }

  /* Gaps trop grands sur mobile */
  [class*="gap-12"] { gap: 2rem !important; }
  [class*="gap-16"] { gap: 2.5rem !important; }

  /* Buttons CTA — empêche les boutons à px-10 d'être trop larges */
  a[class*="px-10"],
  button[class*="px-10"] {
    padding-left: 1.75rem !important;
    padding-right: 1.75rem !important;
    font-size: 1rem !important;
  }

  /* Tailles hero très grandes — limite sur petits écrans */
  h1[class*="text-7xl"] { font-size: 2.5rem !important; line-height: 1.1 !important; }
  h1[class*="text-6xl"] { font-size: 2.25rem !important; line-height: 1.1 !important; }
  h1[class*="text-5xl"] { font-size: 2rem !important; line-height: 1.15 !important; }
  h2[class*="text-5xl"] { font-size: 1.875rem !important; line-height: 1.15 !important; }
  h2[class*="text-4xl"] { font-size: 1.625rem !important; line-height: 1.2 !important; }

  /* Grands chiffres (stats) — limite */
  [class*="text-6xl"]:not(h1):not(h2) {
    font-size: 2.5rem !important;
  }
  [class*="text-7xl"]:not(h1):not(h2) {
    font-size: 2.75rem !important;
  }
}

/* -----------------------------------------------------------------
   8. COMPOSANTS — Lueurs (utilitaires)
   ----------------------------------------------------------------- */
.glow-gold { box-shadow: 0 0 60px rgba(212, 168, 83, 0.3); }
.glow-blue { box-shadow: 0 0 60px rgba(26, 86, 219, 0.3); }

/* -----------------------------------------------------------------
   8.b BOUTONS — états complets (MOV-032)
   Hover (existant) + focus visible (anneau d'accessibilité) +
   active (effet enfoncé) + disabled (grisé non-cliquable).
   ----------------------------------------------------------------- */
.btn-gold:focus-visible,
.btn-blue:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(212, 168, 83, 0.45),
    0 10px 40px rgba(212, 168, 83, 0.4);
}
.btn-gold:active,
.btn-blue:active {
  transform: scale(0.97);
}
.btn-gold:disabled,
.btn-blue:disabled,
.btn-gold[aria-disabled="true"],
.btn-blue[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
  filter: grayscale(20%);
}

/* Bouton tertiaire (ghost / text-only) — pour les actions secondaires
   discrètes (« Lire la suite », liens contextuels). */
.btn-ghost {
  background: transparent;
  color: var(--color-gold);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover {
  background: rgba(212, 168, 83, 0.1);
}
.btn-ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.3);
}
.btn-ghost:active {
  transform: scale(0.97);
}
.btn-ghost:disabled,
.btn-ghost[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* -----------------------------------------------------------------
   10. CARTES — modèle unique décliné (MOV-032)
   .card = base ; .card-hoverable = effet d'élévation au hover ;
   .card-bordered = bordure or marquée.
   ----------------------------------------------------------------- */
.card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all var(--transition-base);
}
.card-hoverable:hover {
  border-color: var(--color-gold);
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(212, 168, 83, 0.15);
}
.card-bordered {
  border-color: rgba(212, 168, 83, 0.45);
}
.card:focus-within {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.2);
}

/* -----------------------------------------------------------------
   11. BADGES — pastilles d'étiquette (MOV-032)
   Une seule structure .badge + variantes de couleur sémantiques.
   ----------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.badge-gold    { background: rgba(212, 168, 83, 0.20); color: var(--color-gold); }
.badge-blue    { background: rgba(26, 86, 219, 0.20);  color: #93c5fd; }
.badge-success { background: rgba(34, 197, 94, 0.20);  color: #6ee7b7; }
.badge-warning { background: rgba(245, 158, 11, 0.20); color: #fcd34d; }
.badge-danger  { background: rgba(239, 68, 68, 0.20);  color: #fca5a5; }
.badge-neutral { background: rgba(255, 255, 255, 0.10); color: #d1d5db; }

/* -----------------------------------------------------------------
   12. CHAMPS DE FORMULAIRE — design system MOV-032
   .input = base ; états :focus, :disabled, .has-error.
   Cohabite avec l'ancien .form-input des pages legacy.
   ----------------------------------------------------------------- */
.input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #fff;
  width: 100%;
  font-size: var(--font-size-base);
  transition: all var(--transition-base);
}
.input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.input:focus,
.input:focus-visible {
  outline: none;
  border-color: var(--color-gold);
  background: rgba(212, 168, 83, 0.05);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}
.input:disabled,
.input[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
}
.input.has-error {
  border-color: rgba(239, 68, 68, 0.6);
}
.input.has-error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.20);
}

.input-help {
  display: block;
  margin-top: 6px;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.6);
}
.input-error {
  display: block;
  margin-top: 6px;
  font-size: var(--font-size-xs);
  color: #fca5a5;
}

/* -----------------------------------------------------------------
   13. ICÔNES — dimensionnement (MOV-032 + MOV-033)
   Le site utilise Font Awesome (vectoriel, identique cross-OS).
   Ces classes alignent les tailles sur l'échelle du design system.
   ----------------------------------------------------------------- */
.icon       { font-size: 1rem;     line-height: 1; }
.icon-sm    { font-size: 0.875rem; line-height: 1; }
.icon-md    { font-size: 1.25rem;  line-height: 1; }
.icon-lg    { font-size: 1.5rem;   line-height: 1; }
.icon-xl    { font-size: 2rem;     line-height: 1; }
.icon-2xl   { font-size: 2.5rem;   line-height: 1; }

/* Encart circulaire pour mettre une icône en valeur (cartes, sections) */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(212, 168, 83, 0.15);
  color: var(--color-gold);
  flex-shrink: 0;
}
.icon-circle-sm { width: 32px; height: 32px; font-size: 0.875rem; }
.icon-circle-md { width: 44px; height: 44px; font-size: 1.125rem; }
.icon-circle-lg { width: 56px; height: 56px; font-size: 1.5rem; }

/* -----------------------------------------------------------------
   14. INFO-BULLES (MOV-032)
   Tooltip purement CSS — ajouter data-tooltip="..." sur l'élément
   parent (avec .tooltip-wrap). S'affiche au :hover ou :focus-within.
   ----------------------------------------------------------------- */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}
.tooltip-wrap::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 100;
}
.tooltip-wrap:hover::after,
.tooltip-wrap:focus-within::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -----------------------------------------------------------------
   15. ACCESSIBILITÉ — respect de prefers-reduced-motion (MOV-032)
   ----------------------------------------------------------------- */
@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;
  }
}

/* -----------------------------------------------------------------
   9. COMPOSANTS — Cookies (modal + bouton "Gérer les cookies")
   ----------------------------------------------------------------- */
.cookies-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 1rem;
}
.cookies-modal.open { display: flex; }

.cookies-manage-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--color-gray-800);
  color: var(--color-gold);
  border: 1px solid rgba(212, 168, 83, 0.4);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  z-index: 55;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: all var(--transition-base);
}
.cookies-manage-btn:hover {
  background: var(--color-gold);
  color: var(--color-black);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
