/* ==========================================================================
   Styles personnalisés DIVALPO
   - Gardé séparé de Tailwind compilé pour rester lisible
   - Chargé APRÈS assets/tailwind.css pour surcharger certaines classes (ex: delay-100)
   ========================================================================== */

/* Défilement: éviter que les ancres soient cachées par le header fixe */
html {
  scroll-padding-top: 8rem;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Scrollbar (look premium) */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.font-heavy {
  font-family: "Montserrat", sans-serif;
}

.text-glow {
  text-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
}

/* =========================================================
   Animations: fade-up / fade-in (IntersectionObserver)
   ========================================================= */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
  opacity: 1;
}

/* Cas spécial: containers fade-up avec glass -> garder le glass rendu hors-écran */
.fade-up.has-glass:not(.visible) {
  opacity: 1;
}

.fade-up.has-glass:not(.visible) .glass-panel {
  opacity: 1 !important;
}

.fade-up.has-glass:not(.visible) .glass-panel > * {
  opacity: 0;
  transform: translateY(30px);
}

.fade-up.has-glass.visible .glass-panel > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Quand on est dans un fade-up, faire bouger le glass avec son container */
.fade-up.has-glass .glass-panel {
  opacity: 1 !important;
  visibility: visible !important;
  transition: transform 0.5s ease-out;
}

.fade-up.has-glass:not(.visible) .glass-panel {
  transform: translate3d(0, 30px, 0);
  -webkit-transform: translate3d(0, 30px, 0);
}

.fade-up.has-glass.visible .glass-panel {
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

/* Délais custom (on garde ces valeurs, même si Tailwind fournit déjà delay-100 etc.) */
.delay-100 {
  transition-delay: 0.15s;
}

.delay-200 {
  transition-delay: 0.3s;
}

.delay-300 {
  transition-delay: 0.45s;
}

/* =========================================================
   Effet "glass"
   ========================================================= */
.glass-panel {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);

  /* Garantir le rendu du backdrop-filter même quand le parent anime l'opacité */
  opacity: 1 !important;
  visibility: visible !important;
  will-change: backdrop-filter, opacity;

  /* Aides GPU / pipeline de rendu */
  contain: layout style paint;
  isolation: isolate;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

.glass-input {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Bordure + glow (utilitaire réutilisé dans plusieurs sections) */
.gradient-border {
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
    inset 1px 0 0 0 rgba(255, 255, 255, 0.7),
    inset -1px 0 0 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.2),
    0 0 20px rgba(56, 189, 248, 0.3), 0 0 40px rgba(56, 189, 248, 0.15);
}

/* =========================================================
   Hero
   ========================================================= */
#hero-title {
  text-shadow: 0 4px 100px rgba(0, 0, 0, 1), 0 2px 50px rgba(0, 0, 0, 0.5);
}

#accueil p.fade-up {
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), 0 1px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 767px) {
  #hero-title {
    font-size: calc(2.5rem - 1pt);
    letter-spacing: -0.02em;
    text-align: center;
  }

  /* Garder "L'EXCELLENCE EN" sur une ligne sur mobile */
  #hero-title br {
    display: none;
  }

  #hero-title .whitespace-nowrap {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0 auto;
  }
}

/* =========================================================
   Animations glow bordures (formulaire)
   ========================================================= */
@keyframes breathe {
  0% {
    opacity: 0.3;
    filter: drop-shadow(0 0 25px rgba(56, 189, 248, 0.8))
      drop-shadow(0 0 50px rgba(56, 189, 248, 0.4));
  }
  25% {
    opacity: 0.7;
    filter: drop-shadow(0 0 40px rgba(56, 189, 248, 1))
      drop-shadow(0 0 80px rgba(56, 189, 248, 0.6));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 60px rgba(56, 189, 248, 1))
      drop-shadow(0 0 120px rgba(56, 189, 248, 0.8));
  }
  75% {
    opacity: 0.7;
    filter: drop-shadow(0 0 40px rgba(56, 189, 248, 1))
      drop-shadow(0 0 80px rgba(56, 189, 248, 0.6));
  }
  100% {
    opacity: 0.3;
    filter: drop-shadow(0 0 25px rgba(56, 189, 248, 0.8))
      drop-shadow(0 0 50px rgba(56, 189, 248, 0.4));
  }
}

.border-glow-breathe {
  animation: breathe 3s ease-in-out infinite;
}

/* Sur mobile: réduire le glow pour éviter le clipping */
@media (max-width: 768px) {
  @keyframes breathe {
    0% {
      opacity: 0.3;
      filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.8));
    }
    25% {
      opacity: 0.7;
      filter: drop-shadow(0 0 25px rgba(56, 189, 248, 1));
    }
    50% {
      opacity: 1;
      filter: drop-shadow(0 0 35px rgba(56, 189, 248, 1));
    }
    75% {
      opacity: 0.7;
      filter: drop-shadow(0 0 25px rgba(56, 189, 248, 1));
    }
    100% {
      opacity: 0.3;
      filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.8));
    }
  }
}

/* =========================================================
   Slider Avant/Après: animation "wiggle"
   ========================================================= */
@keyframes wiggle {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

#slider-handle.wiggle {
  animation: wiggle 0.5s ease-in-out;
}


