/* ═══════════════════════════════════════════════════════════════════════
   GAS INSTITUT — ANIMATIONS COMPLÈTES PAGE D'ACCUEIL
   Couvre : Navbar · Hero · Présentation · Pourquoi Choisir · Formations
            Témoignages · CTA · Footer
═══════════════════════════════════════════════════════════════════════ */

/* ─── VARIABLES ─── */
:root {
  --ease-out-expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out:     cubic-bezier(0.45, 0, 0.55, 1);
  --dur-fast:        0.45s;
  --dur-med:         0.7s;
  --dur-slow:        1.0s;
  --pink:            #e91e63;
  --purple:          #673ab7;
  --gold:            #ffd700;
}

/* ═══════════════════════════════════════════════════════════════════════
   0. UTILITAIRES REVEAL (IntersectionObserver driven)
═══════════════════════════════════════════════════════════════════════ */
[data-reveal] {
  opacity: 0;
  will-change: transform, opacity;
}
[data-reveal="up"]     { transform: translateY(48px); }
[data-reveal="down"]   { transform: translateY(-32px); }
[data-reveal="left"]   { transform: translateX(-52px); }
[data-reveal="right"]  { transform: translateX(52px); }
[data-reveal="scale"]  { transform: scale(0.85); }
[data-reveal="rotate"] { transform: rotate(-8deg) scale(0.9); }
[data-reveal="flip"]   { transform: perspective(600px) rotateX(25deg) translateY(30px); }

[data-reveal].revealed {
  opacity: 1;
  transform: none;
  transition:
    opacity  var(--dur-med) var(--ease-out-expo),
    transform var(--dur-med) var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0s);
}

/* ═══════════════════════════════════════════════════════════════════════
   1. NAVBAR
═══════════════════════════════════════════════════════════════════════ */

/* Apparition initiale */
.navbar {
  animation: navbarDrop 0.7s var(--ease-out-expo) both;
}
@keyframes navbarDrop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* Logo : glisse depuis la gauche */
.nav-logo {
  animation: logoSlide 0.8s var(--ease-spring) 0.2s both;
}
@keyframes logoSlide {
  from { opacity: 0; transform: translateX(-25px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Logo img : rotation subtile au hover */
.logo-img {
  transition: transform 0.5s var(--ease-spring), box-shadow 0.4s ease;
}
.logo-img:hover {
  transform: rotate(-4deg) scale(1.08);
  box-shadow: 0 8px 24px rgba(233,30,99,0.35);
}

/* Items nav : entrée en cascade */
.nav-menu li {
  animation: navItemIn 0.6s var(--ease-out-expo) both;
}
.nav-menu li:nth-child(1) { animation-delay: 0.25s; }
.nav-menu li:nth-child(2) { animation-delay: 0.32s; }
.nav-menu li:nth-child(3) { animation-delay: 0.39s; }
.nav-menu li:nth-child(4) { animation-delay: 0.46s; }
.nav-menu li:nth-child(5) { animation-delay: 0.53s; }
.nav-menu li:nth-child(6) { animation-delay: 0.60s; }
.nav-menu li:nth-child(7) { animation-delay: 0.67s; }

@keyframes navItemIn {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bouton S'inscrire : apparition avec rebond */
.nav-cta {
  animation: ctaBounce 0.7s var(--ease-spring) 0.75s both;
}
@keyframes ctaBounce {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* Navbar scroll : ombre progressive */
.navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
  padding: 8px 0;
  transition: box-shadow 0.4s ease, padding 0.4s ease;
}

/* Soulignement nav : morphing au hover */
.nav-link {
  transition: color 0.3s ease;
}
.nav-link::after {
  transition: width 0.4s var(--ease-out-expo), opacity 0.3s ease !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   2. SECTION PRÉSENTATION
═══════════════════════════════════════════════════════════════════════ */

/* Fond animé */
.presentation {
  position: relative;
  overflow: hidden;
}
.presentation::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 50%, rgba(233,30,99,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 90% 20%, rgba(103,58,183,0.04) 0%, transparent 60%);
  pointer-events: none;
  animation: pressBgPulse 10s ease-in-out infinite alternate;
}
@keyframes pressBgPulse {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* Ligne déco sous le titre */
.presentation-header h2::after {
  transition: width 1.1s var(--ease-out-expo) 0.4s !important;
}
.presentation-header.revealed h2::after {
  width: 100px !important;
}

/* Feature items */
.feature-item {
  transition: transform 0.35s var(--ease-spring),
              box-shadow 0.35s ease,
              background 0.35s ease !important;
}
.feature-item:hover {
  transform: translateX(8px) scale(1.02) !important;
  background: linear-gradient(135deg, rgba(233,30,99,0.08), rgba(255,64,129,0.08)) !important;
  box-shadow: 0 12px 32px rgba(233,30,99,0.1) !important;
}

/* Icône feature : rotation au hover */
.feature-icon {
  transition: transform 0.45s var(--ease-spring), box-shadow 0.3s ease;
}
.feature-item:hover .feature-icon {
  transform: rotate(10deg) scale(1.12);
  box-shadow: 0 8px 24px rgba(233,30,99,0.3);
}

/* Visual main : réveil clip-path */
.presentation-visual .visual-main {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s var(--ease-out-expo) 0.15s;
}
.presentation-visual.revealed .visual-main {
  clip-path: inset(0 0% 0 0);
}

/* Accent flottant */
.visual-accent {
  transition: transform 0.5s var(--ease-spring), opacity 0.5s ease;
  animation: accentFloat 4s ease-in-out infinite;
}
@keyframes accentFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-10px) rotate(5deg); }
}

/* ═══════════════════════════════════════════════════════════════════════
   3. SECTION POURQUOI CHOISIR GAS INSTITUT
═══════════════════════════════════════════════════════════════════════ */

/* Fond décoratif animé */
.why-choose-gas {
  position: relative;
  overflow: hidden;
}
.why-choose-gas::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233,30,99,0.05) 0%, transparent 70%);
  top: -200px; right: -200px;
  animation: whyOrb 14s ease-in-out infinite alternate;
  pointer-events: none;
}
.why-choose-gas::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(103,58,183,0.05) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  animation: whyOrb 18s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}
@keyframes whyOrb {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.15); }
}

/* Cards avantages */
.advantage-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.4s var(--ease-spring),
    box-shadow 0.4s ease !important;
  cursor: default;
}

/* Fond dégradé animé au hover */
.advantage-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(233,30,99,0.0), rgba(103,58,183,0.0));
  transition: background 0.5s ease;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
}
.advantage-card:hover::before {
  background: linear-gradient(135deg, rgba(233,30,99,0.04), rgba(103,58,183,0.06));
}

/* Barre gauche : scaleY au hover */
.advantage-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, var(--pink), var(--purple));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.45s var(--ease-out-expo);
  border-radius: 0 3px 3px 0;
}
.advantage-card:hover::after {
  transform: scaleY(1);
}

/* Contenu au dessus du pseudo-element */
.advantage-card > * {
  position: relative;
  z-index: 1;
}

/* Icône : morphing au hover */
.advantage-icon {
  display: inline-block;
  transition: transform 0.45s var(--ease-spring);
}
.advantage-card:hover .advantage-icon {
  transform: scale(1.25) rotate(-5deg);
  animation: iconWiggle 0.4s var(--ease-spring);
}
@keyframes iconWiggle {
  0%  { transform: scale(1.25) rotate(-5deg); }
  30% { transform: scale(1.3)  rotate(6deg); }
  60% { transform: scale(1.22) rotate(-3deg); }
  100%{ transform: scale(1.25) rotate(-5deg); }
}

/* Titre card : underline qui se révèle */
.advantage-text h3 {
  position: relative;
  display: inline-block;
}
.advantage-text h3::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  transition: width 0.4s var(--ease-out-expo);
  border-radius: 1px;
}
.advantage-card:hover .advantage-text h3::after {
  width: 100%;
}

/* Hover 3D tilt (géré aussi en JS) */
.advantage-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 25px 55px rgba(233,30,99,0.15) !important;
}

/* Badge campus */
.campus-badge {
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease;
  cursor: default;
}
.campus-badge:hover {
  transform: scale(1.06) translateY(-4px) !important;
  box-shadow: 0 20px 50px rgba(233,30,99,0.4) !important;
}

/* Texte campus : letter-spacing animé */
.campus-badge span:last-child {
  display: inline-block;
  transition: letter-spacing 0.4s ease;
}
.campus-badge:hover span:last-child {
  letter-spacing: 3px;
}

/* ═══════════════════════════════════════════════════════════════════════
   4. SECTION FORMATIONS
═══════════════════════════════════════════════════════════════════════ */

/* Fond subtil */
.formations-preview {
  position: relative;
}
.formations-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    rgba(233,30,99,0.012) 40px,
    rgba(233,30,99,0.012) 41px
  );
  pointer-events: none;
}

/* Cards formation */
.formation-card {
  transition:
    transform 0.45s var(--ease-spring),
    box-shadow 0.4s ease !important;
  overflow: hidden;
}

/* Shimmer image au hover */
.card-image {
  overflow: hidden;
  position: relative;
}
.card-image::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-18deg);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
.formation-card:hover .card-image::before {
  animation: formShimmer 0.65s ease forwards;
}
@keyframes formShimmer {
  from { left: -80%; opacity: 1; }
  to   { left: 130%; opacity: 0.6; }
}

/* Zoom image au hover */
.card-image {
  transition: transform 0.6s var(--ease-out-expo);
}
.formation-card:hover .card-image {
  transform: scale(1.04);
}

/* Icône card : rebond */
.card-icon {
  transition: transform 0.5s var(--ease-spring), box-shadow 0.3s ease;
}
.formation-card:hover .card-icon {
  transform: scale(1.15) rotate(-6deg);
  box-shadow: 0 10px 30px rgba(233,30,99,0.35);
}

/* Badge featured : pulse */
.badge {
  animation: badgePulse 3s ease-in-out infinite;
}
@keyframes badgePulse {
  0%,100% { box-shadow: 0 4px 12px rgba(255,215,0,0.3); }
  50%     { box-shadow: 0 4px 20px rgba(255,215,0,0.6); }
}

/* Items liste : hover accent */
.card-content li {
  transition: transform 0.3s var(--ease-spring), color 0.3s ease;
}
.card-content li:hover {
  transform: translateX(6px);
  color: var(--pink) !important;
}

/* Boutons dans les cards */
.card-footer .btn-outline,
.card-footer .btn-primary {
  transition: transform 0.35s var(--ease-spring),
              box-shadow 0.35s ease,
              background 0.35s ease !important;
}
.card-footer .btn-outline:hover,
.card-footer .btn-primary:hover {
  transform: translateY(-3px) scale(1.04);
}

/* ═══════════════════════════════════════════════════════════════════════
   5. SECTION TÉMOIGNAGES
═══════════════════════════════════════════════════════════════════════ */

/* Fond ondulé décoratif */
.temoignages {
  position: relative;
  overflow: hidden;
}
.temoignages::before {
  content: '';
  position: absolute;
  top: 0; left: -10%;
  width: 120%; height: 100%;
  background: linear-gradient(
    160deg,
    rgba(233,30,99,0.03) 0%,
    transparent 40%,
    rgba(103,58,183,0.03) 100%
  );
  pointer-events: none;
}

/* Guillemets décoratifs : animation flottante */
.temoignage-card::before {
  animation: quoteFloat 5s ease-in-out infinite;
  transform-origin: left bottom;
}
@keyframes quoteFloat {
  0%,100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
  50%     { transform: translateY(-6px) rotate(-4deg); opacity: 0.5; }
}

/* Cards témoignages */
.temoignage-card {
  transition:
    transform 0.45s var(--ease-spring),
    box-shadow 0.4s ease,
    border-color 0.4s ease !important;
  position: relative;
}
.temoignage-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid transparent;
  background: linear-gradient(135deg, var(--pink), var(--purple)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.temoignage-card:hover::after {
  opacity: 1;
}
.temoignage-card:hover {
  transform: translateY(-12px) !important;
  box-shadow: 0 28px 60px rgba(233,30,99,0.15) !important;
}

/* Avatar : rotation au hover */
.author-avatar {
  transition: transform 0.5s var(--ease-spring), box-shadow 0.4s ease;
}
.temoignage-card:hover .author-avatar {
  transform: scale(1.12) rotate(-5deg);
  box-shadow: 0 8px 24px rgba(233,30,99,0.4);
}

/* Texte témoignage : reveal progressif */
.temoignage-text {
  position: relative;
}
.temoignage-text::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--pink), transparent);
  transition: width 0.6s var(--ease-out-expo);
  border-radius: 1px;
}
.temoignage-card:hover .temoignage-text::after {
  width: 80%;
}

/* Carrousel automatique léger : highlight des cards */
@keyframes cardHighlight {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.92; }
}

/* ═══════════════════════════════════════════════════════════════════════
   6. SECTION CTA
═══════════════════════════════════════════════════════════════════════ */

/* Fond parallaxe (JS driven) */
.cta-section {
  overflow: hidden;
  position: relative;
}

/* Particules décoratives */
.cta-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,64,129,0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(103,58,183,0.12) 0%, transparent 40%);
  animation: ctaBgPulse 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes ctaBgPulse {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.05); }
}

/* Titre CTA : text-shadow animé */
.cta-content h2 {
  animation: ctaTitleGlow 4s ease-in-out infinite alternate;
}
@keyframes ctaTitleGlow {
  from { text-shadow: 0 4px 20px rgba(0,0,0,0.3); }
  to   { text-shadow: 0 4px 40px rgba(233,30,99,0.25), 0 0 80px rgba(233,30,99,0.1); }
}

/* Boutons CTA */
.cta-buttons .btn-primary {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease !important;
}
.cta-buttons .btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: skewX(-20deg);
  animation: ctaBtnShimmer 3.5s ease-in-out infinite 1s;
}
@keyframes ctaBtnShimmer {
  0%,100% { left: -100%; opacity: 0; }
  10%     { opacity: 1; }
  50%     { left: 160%; opacity: 0.7; }
  51%,99% { left: 160%; opacity: 0; }
}
.cta-buttons .btn-primary:hover {
  transform: translateY(-6px) scale(1.06) !important;
  box-shadow: 0 20px 50px rgba(233,30,99,0.4) !important;
}
.cta-buttons .btn-outline {
  transition: transform 0.4s var(--ease-spring),
              background 0.4s ease,
              color 0.4s ease !important;
}
.cta-buttons .btn-outline:hover {
  transform: translateY(-4px) scale(1.04) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   7. FOOTER
═══════════════════════════════════════════════════════════════════════ */

/* Barre déco top : animation arc-en-ciel */
.footer::before {
  background-size: 200% 100% !important;
  animation: footerBarFlow 4s linear infinite !important;
}
@keyframes footerBarFlow {
  from { background-position: 0% 0%; }
  to   { background-position: 200% 0%; }
}

/* Logo footer */
.footer-logo-text h3 {
  transition: filter 0.4s ease;
}
.footer-logo:hover .footer-logo-text h3 {
  filter: brightness(1.2);
}

/* Liens footer */
.footer-section ul li a {
  position: relative;
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}
.footer-section ul li a::before {
  content: '→';
  position: absolute;
  left: -18px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  color: var(--pink);
  font-size: 0.85em;
}
.footer-section ul li a:hover {
  color: var(--pink) !important;
  transform: translateX(6px);
}
.footer-section ul li a:hover::before {
  opacity: 1;
  transform: translateX(0);
}

/* Contact info : hover glow */
.footer-contact p {
  transition: color 0.3s ease;
}
.footer-contact p:hover {
  color: rgba(255,255,255,0.95) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   8. MICRO-INTERACTIONS GLOBALES
═══════════════════════════════════════════════════════════════════════ */

/* Curseur personnalisé */
.custom-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: white;
  position: fixed;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, width 0.3s ease, height 0.3s ease;
  pointer-events: none;
}
.cursor-ring {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  position: fixed;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
  pointer-events: none;
}
body.cursor-hover .cursor-ring {
  width: 56px; height: 56px;
  border-color: var(--pink);
}
body.cursor-hover .cursor-dot {
  width: 4px; height: 4px;
}

/* Boutons primaires : onde au clic */
.btn-primary,
.btn-outline {
  position: relative;
  overflow: hidden;
}
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleOut 0.6s linear;
  pointer-events: none;
}
@keyframes rippleOut {
  to { transform: scale(4); opacity: 0; }
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--gold));
  z-index: 9999;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.05s linear;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 5rem;
  left: 2rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 100;
  opacity: 0;
  transform: scale(0) rotate(-180deg);
  transition: opacity 0.4s ease, transform 0.5s var(--ease-spring);
  border: none;
  box-shadow: 0 6px 20px rgba(233,30,99,0.4);
  text-decoration: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.back-to-top:hover {
  transform: scale(1.12) translateY(-4px) !important;
  box-shadow: 0 12px 32px rgba(233,30,99,0.55) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   9. TRANSITIONS DE SECTION
═══════════════════════════════════════════════════════════════════════ */

/* Séparateurs de sections */
section {
  position: relative;
}
.section-divider {
  position: absolute;
  bottom: -1px; left: 0;
  width: 100%; overflow: hidden;
  line-height: 0;
  z-index: 10;
}
.section-divider svg {
  display: block;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════
   10. RESPONSIVE
═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .custom-cursor,
  .cursor-dot,
  .cursor-ring { display: none; }

  .back-to-top { left: 1rem; bottom: 4rem; }

  .advantage-card:hover,
  .formation-card:hover,
  .temoignage-card:hover {
    transform: translateY(-4px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .presentation-visual .visual-main { clip-path: none !important; }
}
