/* ════════════════════════════════════════════════════════════════
   AHCE — Couche d'animations & finition graphique premium
   Complète ui-polish.css. Léger, accessible, respect reduced-motion.
   ════════════════════════════════════════════════════════════════ */

/* ─── KEYFRAMES ─────────────────────────────────────────────── */
@keyframes ahceFadeUp{
  from{opacity:0;transform:translateY(18px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes ahceFadeIn{
  from{opacity:0}
  to{opacity:1}
}
@keyframes ahcePop{
  0%{opacity:0;transform:scale(.85)}
  60%{opacity:1;transform:scale(1.04)}
  100%{transform:scale(1)}
}
@keyframes ahceShimmer{
  0%{background-position:-180% 0}
  100%{background-position:280% 0}
}
@keyframes ahcePulseSoft{
  0%,100%{box-shadow:0 0 0 0 rgba(30,96,182,.45)}
  50%{box-shadow:0 0 0 12px rgba(30,96,182,0)}
}
@keyframes ahceGoldPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(196,144,80,.55)}
  50%{box-shadow:0 0 0 14px rgba(196,144,80,0)}
}
@keyframes ahceGradientShift{
  0%{background-position:0% 50%}
  50%{background-position:100% 50%}
  100%{background-position:0% 50%}
}
@keyframes ahceFloat3d{
  0%,100%{transform:translateY(0) rotateZ(0)}
  50%{transform:translateY(-8px) rotateZ(.6deg)}
}
@keyframes ahceCountUp{
  from{opacity:0;transform:translateY(8px) scale(.94)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes ahceConfettiFall{
  0%{transform:translateY(-12vh) rotate(0);opacity:0}
  10%{opacity:1}
  100%{transform:translateY(110vh) rotate(720deg);opacity:0}
}
@keyframes ahceCheckPop{
  0%{transform:scale(0);opacity:0}
  60%{transform:scale(1.18);opacity:1}
  100%{transform:scale(1)}
}
@keyframes ahceRipple{
  0%{transform:scale(0);opacity:.55}
  100%{transform:scale(2.4);opacity:0}
}
@keyframes ahceShineSweep{
  0%{left:-80%}
  100%{left:120%}
}
@keyframes ahceGlowOrb{
  0%,100%{transform:translate(0,0) scale(1);opacity:.55}
  33%{transform:translate(40px,-30px) scale(1.15);opacity:.75}
  66%{transform:translate(-30px,20px) scale(.92);opacity:.45}
}

/* ─── CLASSES UTILITAIRES ───────────────────────────────────── */
.ahce-anim-fade-up{opacity:0;animation:ahceFadeUp .65s cubic-bezier(.22,.61,.36,1) forwards}
.ahce-anim-fade-in{opacity:0;animation:ahceFadeIn .55s ease forwards}
.ahce-anim-pop{opacity:0;animation:ahcePop .55s cubic-bezier(.34,1.56,.64,1) forwards}
.ahce-anim-float{animation:ahceFloat3d 5s ease-in-out infinite}
.ahce-anim-pulse{animation:ahcePulseSoft 2.2s ease-in-out infinite}
.ahce-anim-pulse-gold{animation:ahceGoldPulse 2.2s ease-in-out infinite}
.ahce-anim-count{animation:ahceCountUp .55s cubic-bezier(.34,1.56,.64,1)}

/* Stagger : enfants apparaissent l'un après l'autre */
.ahce-stagger > *{opacity:0;animation:ahceFadeUp .55s cubic-bezier(.22,.61,.36,1) forwards}
.ahce-stagger > *:nth-child(1){animation-delay:.05s}
.ahce-stagger > *:nth-child(2){animation-delay:.13s}
.ahce-stagger > *:nth-child(3){animation-delay:.21s}
.ahce-stagger > *:nth-child(4){animation-delay:.29s}
.ahce-stagger > *:nth-child(5){animation-delay:.37s}
.ahce-stagger > *:nth-child(6){animation-delay:.45s}
.ahce-stagger > *:nth-child(7){animation-delay:.53s}
.ahce-stagger > *:nth-child(8){animation-delay:.61s}

/* ─── HOVER PREMIUM — cartes & blocs ───────────────────────── */
@media (hover:hover) and (min-width:681px){
  .glass{transition:transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease}
  .glass:hover{transform:translateY(-3px);box-shadow:0 22px 50px rgba(30,96,182,.22) !important}
  .shadow-lg,.shadow-2xl{transition:transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease}
  .shadow-lg:hover{transform:translateY(-2px);box-shadow:0 18px 44px rgba(15,23,42,.16) !important}
  .shadow-2xl:hover{transform:translateY(-3px);box-shadow:0 28px 70px rgba(30,96,182,.32) !important}
}

/* Bouton arrondi : halo doré sur hover, shine balayé sur hover */
.btn-shine{position:relative;overflow:hidden;isolation:isolate}
.btn-shine::after{
  content:"";position:absolute;top:0;left:-80%;width:60%;height:100%;
  background:linear-gradient(120deg,transparent,rgba(255,255,255,.32),transparent);
  transform:skewX(-22deg);pointer-events:none;z-index:1;
}
@media (hover:hover){
  .btn-shine:hover::after{animation:ahceShineSweep .85s ease}
}

/* ─── RIPPLE — ajouté par JS ───────────────────────────────── */
.ahce-ripple-host{position:relative;overflow:hidden;isolation:isolate}
.ahce-ripple-dot{
  position:absolute;border-radius:50%;background:rgba(255,255,255,.45);
  width:8px;height:8px;pointer-events:none;
  animation:ahceRipple .65s cubic-bezier(.4,0,.2,1) forwards;
  z-index:0;
}

/* ─── HERO BACKGROUND ANIMÉ ─────────────────────────────────── */
.ahce-hero-bg{
  background:linear-gradient(125deg,#0f2c5f 0%,#1e60b6 35%,#2a7ed8 60%,#c49050 100%);
  background-size:280% 280%;
  animation:ahceGradientShift 18s ease-in-out infinite;
}

/* Orbes lumineux flottants (3 div décoratives à injecter via JS) */
.ahce-orb{
  position:absolute;border-radius:50%;
  filter:blur(60px);pointer-events:none;mix-blend-mode:screen;
  animation:ahceGlowOrb 14s ease-in-out infinite;
}
.ahce-orb.o1{width:280px;height:280px;background:rgba(30,96,182,.6);top:-60px;left:-60px;animation-delay:0s}
.ahce-orb.o2{width:220px;height:220px;background:rgba(196,144,80,.55);bottom:-40px;right:-40px;animation-delay:-4s}
.ahce-orb.o3{width:340px;height:340px;background:rgba(67,184,234,.5);top:45%;left:40%;animation-delay:-8s}

/* ─── SHIMMER LOADER ───────────────────────────────────────── */
.ahce-skel{
  background:linear-gradient(90deg,#eef2f8 0%,#f7fafc 30%,#eef2f8 60%);
  background-size:280% 100%;
  animation:ahceShimmer 1.4s linear infinite;
  border-radius:8px;
}

/* ─── CHECK ANIMÉ (succès inscription / check-in) ──────────── */
.ahce-check{
  display:inline-block;width:88px;height:88px;border-radius:50%;
  background:linear-gradient(135deg,#16a34a,#0f7a37);
  color:#fff;font-size:46px;font-weight:900;line-height:88px;text-align:center;
  box-shadow:0 14px 38px rgba(22,163,74,.45);
  animation:ahceCheckPop .65s cubic-bezier(.34,1.56,.64,1);
}

/* ─── CONFETTI (inscription validée) ───────────────────────── */
.ahce-confetti{
  position:fixed;inset:0;pointer-events:none;z-index:9999;overflow:hidden;
}
.ahce-confetti span{
  position:absolute;top:-20px;width:10px;height:14px;border-radius:2px;
  animation:ahceConfettiFall 3.2s cubic-bezier(.55,.085,.68,.53) forwards;
}

/* ─── BADGES COLORÉS PULSE (statut visiteurs) ──────────────── */
.ahce-badge-live{
  display:inline-flex;align-items:center;gap:6px;
  padding:4px 11px;border-radius:999px;font-weight:800;font-size:11px;
  color:#fff;background:linear-gradient(135deg,#dc2626,#9a1c1c);
  animation:ahcePulseSoft 2s ease-in-out infinite;
}
.ahce-badge-live::before{
  content:"";width:7px;height:7px;border-radius:50%;background:#fff;
  box-shadow:0 0 8px rgba(255,255,255,.9);
}

/* ─── INPUT MODERNES — placeholder & focus poussés ─────────── */
input,select,textarea{transition:border-color .18s ease, box-shadow .25s ease, background-color .2s ease}
input:focus,select:focus,textarea:focus{background-color:#fff !important}
input::placeholder,textarea::placeholder{transition:color .2s ease, opacity .2s ease}
input:focus::placeholder,textarea:focus::placeholder{opacity:.45}

/* ─── BOUTONS CTA PRIMAIRE — éclat doré ────────────────────── */
.ahce-cta-glow{
  position:relative;
  background:linear-gradient(135deg,#c49050,#a3733a) !important;
  color:#fff !important;
  box-shadow:0 14px 32px rgba(196,144,80,.42), inset 0 -3px 0 rgba(0,0,0,.12) !important;
  animation:ahceGoldPulse 2.4s ease-in-out infinite;
}

/* ─── NAV / ONGLETS — barre indicateur fluide ──────────────── */
.ahce-tab-indicator{
  position:absolute;bottom:0;height:3px;border-radius:3px 3px 0 0;
  background:linear-gradient(90deg,#1e60b6,#c49050);
  transition:left .35s cubic-bezier(.22,.61,.36,1), width .35s cubic-bezier(.22,.61,.36,1);
}

/* ─── SCROLL — révèle les éléments quand visibles ─────────── */
.ahce-reveal{opacity:0;transform:translateY(20px);transition:opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1)}
.ahce-reveal.is-visible{opacity:1;transform:translateY(0)}

/* ─── TOAST PREMIUM ─────────────────────────────────────────── */
.ahce-toast{
  position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(80px);
  background:#fff;color:#0f172a;font-weight:700;
  padding:13px 22px;border-radius:13px;font-size:14px;
  box-shadow:0 16px 40px rgba(15,23,42,.22);
  border-left:4px solid #1e60b6;
  z-index:99999;opacity:0;
  transition:transform .35s cubic-bezier(.34,1.56,.64,1), opacity .35s ease;
  display:flex;align-items:center;gap:10px;max-width:min(420px,90vw);
}
.ahce-toast.is-show{opacity:1;transform:translateX(-50%) translateY(0)}
.ahce-toast.ok{border-left-color:#16a34a;color:#0f7a37}
.ahce-toast.err{border-left-color:#dc2626;color:#9a1c1c}
.ahce-toast.warn{border-left-color:#c49050;color:#7a5b29}

/* ─── REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important;animation-iteration-count:1 !important;
    transition-duration:.01ms !important;scroll-behavior:auto !important;
  }
  .ahce-orb,.ahce-anim-float,.ahce-anim-pulse,.ahce-anim-pulse-gold,
  .ahce-cta-glow,.ahce-badge-live,.ahce-hero-bg{animation:none !important}
}

/* ─── MOBILE — animations plus simples pour préserver perf ── */
@media (max-width:680px){
  .ahce-orb{display:none}
  .ahce-hero-bg{animation-duration:30s}
  .ahce-anim-pulse,.ahce-anim-pulse-gold,.ahce-cta-glow{animation-duration:3s}
  .btn-shine::after{display:none}
}
