/* ================================================================
   AutoBénin Connect — Premium Upgrade CSS
   À inclure APRÈS style.css. Aucune modification de l'existant.

   Ce fichier applique :
   ① Haikei-style  — blobs SVG, vagues de séparation, grille pointillée
   ② Glassmorphisme — badges & pastilles hero premium
   ③ Typographie  — Syne + Plus Jakarta Sans via @import
   ④ Motion ready — variables et keyframes pour animations JS
   ================================================================ */


/* ── 0. POLICES PREMIUM ────────────────────────────────────────── */
/* Auto-hébergées via fonts.css (chargé en premier dans entete.php) —
   plus d'@import Google Fonts : une police tierce non chargée qui
   retombe sur la police système est exactement ce qui rendait le hero
   "basique" quand le CDN externe était lent/inaccessible. */

:root{
  --font-head: 'Poppins', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Nouveaux tokens visuels */
  --blob-or:    rgba(232,163,23,.22);
  --blob-bleu:  rgba(21,72,154,.18);
  --glass-bg:   rgba(255,255,255,.10);
  --glass-bord: rgba(255,255,255,.22);

  /* Durées d'animation standard (Motion Primitives) */
  --dur-fast:   150ms;
  --dur-mid:    280ms;
  --dur-slow:   480ms;
  --ease-out:   cubic-bezier(.22,1,.36,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);
}

body{ font-family: var(--font-body); }
h1,h2,h3,.logo,.titre-page,.fiche-prix,.hero h1,
.hero-pro h1,.section-tete h2,.tb-entete h1{
  font-family: var(--font-head);
}


/* ── 1. HERO — BLOB SVG BACKGROUND (Haikei style) ─────────────── */
/*
  Blob 1 : en haut à droite (lumière chaude, dorée)
  Blob 2 : en bas à gauche (lumière froide, bleue)
  Grille pointillée par-dessus pour la profondeur
*/
.hero-pro,
.hero{
  position: relative;
  overflow: hidden;
}

/* Blob doré — haut droite */
.hero-pro::before,
.hero::before{
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    /* blob doré */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 600'%3E%3Cellipse cx='720' cy='80' rx='340' ry='260' fill='rgba(232,163,23,.16)'/%3E%3C/svg%3E"),
    /* blob bleu */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 600'%3E%3Cellipse cx='80' cy='520' rx='280' ry='200' fill='rgba(21,72,154,.14)'/%3E%3C/svg%3E"),
    /* grille pointillée */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='14' cy='14' r='1.2' fill='rgba(255,255,255,.08)'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: 640px 420px, 480px 320px, 28px 28px;
  background-position: right -80px top -60px, left -60px bottom -40px, 0 0;
}

/* S'assurer que le contenu passe au-dessus des blobs */
.hero-pro .conteneur,
.hero .conteneur{ position: relative; z-index: 2; }

/* Le ::after existant ne doit plus masquer nos blobs */
.hero::after{ z-index: 1; }


/* ── 2. BLOB DE SECTION — vague organique au-dessus de section foncée ─ */
/*
  Usage : <div class="vague-blob vague-blob--bas"> avant une section navy
  OU     <div class="vague-blob vague-blob--haut"> après une section navy
*/
.vague-blob{
  display: block;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
}
.vague-blob svg{ display: block; width: 100%; height: auto; }

/* Vague claire vers foncée (bottom de section claire) */
.vague-blob--bas  svg path{ fill: var(--bleu-fonce, #0e3470); }
/* Vague foncée vers claire (bottom de section foncée) */
.vague-blob--haut svg path{ fill: var(--bg, #f4f7fc); }


/* ── 3. DIVISEUR WAVE POUR LES SECTIONS ───────────────────────── */
.section-wave{
  position: relative;
  margin-top: -2px;
}
.section-wave::before{
  content: '';
  display: block;
  width: 100%;
  height: 64px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cpath d='M0,32 C240,64 480,0 720,32 C960,64 1200,0 1440,32 L1440,64 L0,64 Z' fill='%23f4f7fc'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.bande-foncee .section-wave::before,
.section-wave.wave-fonce::before{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cpath d='M0,32 C240,64 480,0 720,32 C960,64 1200,0 1440,32 L1440,64 L0,64 Z' fill='%230e3470'/%3E%3C/svg%3E");
}


/* ── 4. GLASSMORPHISME — hero-pastille & badges ────────────────── */
.hero-pastille{
  background: var(--glass-bg);
  border: 1px solid var(--glass-bord);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.badge-hero{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 999px;
}
.badge-hero .pic{
  background: rgba(232,163,23,.22);
  border: 1px solid rgba(232,163,23,.35);
}


/* ── 5. BARRE DE RECHERCHE HERO — effet verre premium ─────────── */
.hero-recherche{
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 20px 60px rgba(14,52,112,.22), 0 2px 8px rgba(0,0,0,.08);
}


/* ── 6. CARTES — hover premium avec rayon lumineux ────────────── */
.vcarte, .service-carte, .module-carte, .conseil-carte{
  position: relative;
  overflow: hidden;
}

/* Rayon lumineux au survol (effet premium Watermelon) */
.vcarte::before,
.service-carte::before,
.module-carte::before{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(21,72,154,.06), transparent 40%);
  opacity: 0;
  transition: opacity var(--dur-mid) ease;
  pointer-events: none;
  z-index: 0;
}
.vcarte:hover::before,
.service-carte:hover::before,
.module-carte:hover::before{ opacity: 1; }


/* ── 7. SURTITRE ANIMÉ — gradient qui se déplace ──────────────── */
.surtitre{
  background: linear-gradient(90deg,
    var(--bleu) 0%, var(--or) 40%, var(--bleu) 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-slide 3.5s linear infinite;
  display: inline-block;
}
@keyframes gradient-slide{
  0%  { background-position: 0% center; }
  100%{ background-position: 200% center; }
}

/* Version statique si prefers-reduced-motion */
@media(prefers-reduced-motion: reduce){
  .surtitre{
    background: none;
    -webkit-text-fill-color: var(--bleu);
    color: var(--bleu);
    animation: none;
  }
}


/* ── 8. SECTION STATS — fond organique ────────────────────────── */
.stats-pro,
.stats{
  position: relative;
}
.stats-pro::before{
  content: '';
  position: absolute;
  inset: -60px -40px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400'%3E%3Cellipse cx='650' cy='80' rx='260' ry='180' fill='rgba(232,163,23,.08)'/%3E%3Cellipse cx='120' cy='320' rx='200' ry='160' fill='rgba(21,72,154,.07)'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 0;
}
.stats-pro > *{ position: relative; z-index: 1; }


/* ── 9. CTA FINAL — fond blob doré ────────────────────────────── */
.cta-final{
  position: relative;
  overflow: hidden;
}
.cta-final::before{
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 65%);
  pointer-events: none;
}
.cta-final::after{
  content: '';
  position: absolute;
  left: -60px;
  bottom: -60px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 65%);
  pointer-events: none;
}
.cta-final > *{ position: relative; z-index: 1; }


/* ── 10. LISIÈRE BÉNIN — épaissie et animée ───────────────────── */
.lisere-benin, .liseré-benin{
  height: 5px;
  background: linear-gradient(90deg,
    var(--vert-benin) 0 33.33%,
    var(--jaune-benin) 33.33% 66.66%,
    var(--rouge-benin) 66.66% 100%);
  position: relative;
  overflow: hidden;
}
.lisere-benin::after, .liseré-benin::after{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%, rgba(255,255,255,.4) 50%, transparent 100%);
  animation: shine-benin 2.4s ease-in-out infinite;
}
@keyframes shine-benin{
  0%  { transform: translateX(-100%); }
  100%{ transform: translateX(200%); }
}
@media(prefers-reduced-motion: reduce){
  .lisere-benin::after, .liseré-benin::after{ animation: none; }
}


/* ── 11. MOTION — classes d'état (gérées par premium-animations.js) ── */
/*
  Ajoutez data-reveal="fade-up" | "blur-in" | "slide-left" | "stagger"
  sur n'importe quel élément. JS ajoute .is-visible quand il entre
  dans le viewport.
*/

/* État initial : invisible + décalé */
[data-reveal]{
  opacity: 0;
  will-change: opacity, transform, filter;
  transition-property: opacity, transform, filter;
  transition-timing-function: var(--ease-out);
  transition-duration: var(--dur-slow);
}
[data-reveal].is-visible{
  opacity: 1;
  transform: none !important;
  filter: none !important;
}

/* fade-up : monte de 24px */
[data-reveal="fade-up"]   { transform: translateY(24px); }

/* blur-in : flou → net (Motion Primitives blur effect) */
[data-reveal="blur-in"]   { transform: translateY(16px); filter: blur(8px); }

/* slide-left */
[data-reveal="slide-left"]{ transform: translateX(-32px); }

/* scale-in : légère mise à l'échelle */
[data-reveal="scale-in"]  { transform: scale(.95); }

/* Délais pour stagger (ajoutez data-delay="1" à "6") */
[data-delay="1"]{ transition-delay:  80ms; }
[data-delay="2"]{ transition-delay: 160ms; }
[data-delay="3"]{ transition-delay: 240ms; }
[data-delay="4"]{ transition-delay: 320ms; }
[data-delay="5"]{ transition-delay: 400ms; }
[data-delay="6"]{ transition-delay: 480ms; }

/* Respect prefers-reduced-motion */
@media(prefers-reduced-motion: reduce){
  [data-reveal]{
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}


/* ── 12. TEXT REVEAL (Motion Primitives style) ─────────────────── */
/*
  Ajoutez data-text-reveal sur un <h1> ou <h2>.
  JS wrap chaque mot dans .word > .word-inner.
*/
.word{ overflow: hidden; display: inline-block; }
.word-inner{
  display: inline-block;
  transform: translateY(110%);
  transition: transform var(--dur-slow) var(--ease-out);
}
[data-text-reveal].is-visible .word-inner{ transform: translateY(0); }
[data-text-reveal] .word:nth-child(1) .word-inner{ transition-delay:  0ms; }
[data-text-reveal] .word:nth-child(2) .word-inner{ transition-delay: 70ms; }
[data-text-reveal] .word:nth-child(3) .word-inner{ transition-delay:140ms; }
[data-text-reveal] .word:nth-child(4) .word-inner{ transition-delay:210ms; }
[data-text-reveal] .word:nth-child(5) .word-inner{ transition-delay:280ms; }
[data-text-reveal] .word:nth-child(6) .word-inner{ transition-delay:350ms; }
[data-text-reveal] .word:nth-child(7) .word-inner{ transition-delay:420ms; }
[data-text-reveal] .word:nth-child(8) .word-inner{ transition-delay:490ms; }
@media(prefers-reduced-motion: reduce){
  .word-inner{ transform: none !important; transition: none !important; }
}


/* ── 13. COMPTEUR ANIMÉ ────────────────────────────────────────── */
/* Ajoutez data-count="247" sur un élément avec .compteur ou .stat .n */
[data-count]{ display: inline-block; }


/* ── 14. CHATBOT — amélioration visuelle ──────────────────────── */
#chatbot-toggle{
  background: linear-gradient(135deg, var(--or), var(--or-fonce));
  box-shadow: 0 8px 24px rgba(201,135,12,.38);
  transition: transform var(--dur-mid) var(--ease-spring),
              box-shadow var(--dur-mid) ease;
}
#chatbot-toggle:hover{
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(201,135,12,.46);
}
#chatbot-fenetre{
  border: 1px solid rgba(14,52,112,.12);
  box-shadow: 0 24px 60px rgba(14,52,112,.22);
}


/* ── 15. SCROLL INDICATOR HERO ─────────────────────────────────── */
.scroll-indicator{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 32px;
  cursor: pointer;
  text-decoration: none;
}
.scroll-indicator:hover{ color: rgba(255,255,255,.85); text-decoration: none; }
.scroll-indicator .chevron{
  width: 28px;
  height: 28px;
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounce-down 2s ease-in-out infinite;
}
@keyframes bounce-down{
  0%,100%{ transform: translateY(0); }
  50%     { transform: translateY(6px); }
}
@media(prefers-reduced-motion: reduce){
  .scroll-indicator .chevron{ animation: none; }
}


/* ── 16. NOMBRE STAT — tabular nums ────────────────────────────── */
.compteur, .stat .n, .stat-pro .compteur,
.fiche-prix, .lignes-prix b, .cout-total b,
.sim-total strong, .plan-prix{
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}


/* ── 17. FOCUS VISIBLE GLOBAL (accessibilité) ──────────────────── */
:focus-visible{
  outline: 2px solid var(--or);
  outline-offset: 2px;
  border-radius: 4px;
}
