/* ==========================================================================
   GNOSIA FORMATIONS — couche premium
   Chargée APRÈS style.css. Ajoute les effets visuels sans rien écraser.
   ========================================================================== */

:root {
  --prem-or: #f0c46a;
  --prem-or-clair: #ffd98e;
  --prem-violet: #7a4fd0;
  --prem-turquoise: #3fd6c4;
  --prem-magenta: #e053a0;
  --prem-nuit: #0d0a1a;
  --prem-halo: 0 10px 40px -12px rgba(122, 79, 208, 0.55);
}

/* ---------- 1. Halos lumineux d'arrière-plan ---------- */
.aurora::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 18% 12%, rgba(122, 79, 208, 0.30), transparent 70%),
    radial-gradient(closest-side at 82% 18%, rgba(63, 214, 196, 0.16), transparent 70%),
    radial-gradient(closest-side at 50% 88%, rgba(224, 83, 160, 0.14), transparent 70%);
  filter: blur(10px);
  animation: prem-derive 26s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes prem-derive {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2%, 1.5%, 0) scale(1.04); }
  100% { transform: translate3d(2%, -1%, 0) scale(1.02); }
}

/* ---------- 2. Cartes de formation : relief au survol ---------- */
@media (hover: hover) and (pointer: fine) {
  .carte-formation {
    transition: transform .45s cubic-bezier(.2, .8, .2, 1),
                box-shadow .45s ease,
                border-color .45s ease;
    transform-style: preserve-3d;
  }

  .carte-formation:hover,
  .carte-formation:focus-within {
    transform: translateY(-8px) rotateX(2.2deg) rotateY(-1.6deg) scale(1.012);
    box-shadow: 0 26px 60px -24px rgba(122, 79, 208, .75),
                0 0 0 1px rgba(240, 196, 106, .35);
    border-color: rgba(240, 196, 106, .45);
  }

  .carte-formation:hover .visuel img {
    transform: scale(1.06);
  }
}

.carte-formation .visuel {
  overflow: hidden;
}

.carte-formation .visuel img {
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
  height: 100%;
  object-fit: cover;
}

/* Reflet diagonal sur l'image au survol */
.carte-formation .visuel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .16) 50%, transparent 58%);
  transform: translateX(-120%);
  transition: transform .9s ease;
  pointer-events: none;
}

.carte-formation:hover .visuel::after {
  transform: translateX(120%);
}

/* ---------- 3. Cartes de catégorie : profondeur ---------- */
@media (hover: hover) and (pointer: fine) {
  .carte-categorie {
    transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease;
  }

  .carte-categorie:hover {
    transform: translateY(-6px) scale(1.008);
    box-shadow: 0 24px 55px -26px rgba(122, 79, 208, .8);
  }
}

/* ---------- 4. Boutons : halo doré au survol ---------- */
.btn {
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: translateY(-2px);
  }

  .btn-or:hover {
    box-shadow: 0 12px 30px -10px rgba(240, 196, 106, .75);
  }
}

.btn:active {
  transform: translateY(0);
}

/* ---------- 5. Accessibilité : focus clavier bien visible ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--prem-or);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Lien d'évitement pour la navigation clavier */
.prem-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--prem-or);
  color: #1a1030;
  padding: 12px 20px;
  font-weight: 600;
  border-radius: 0 0 10px 0;
}

.prem-skip:focus {
  left: 0;
}

/* ---------- 6. Images : jamais de débordement ---------- */
.visuel img,
.carte-categorie img,
.grille-galerie img {
  max-width: 100%;
  height: auto;
}

/* ---------- 7. Titres : léger halo doré ---------- */
.hero h1 em,
.hero h1 {
  text-shadow: 0 0 42px rgba(240, 196, 106, .28);
}

/* ---------- 8. Bandeau hero : accroche plus lisible ---------- */
.hero-texte {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  letter-spacing: .01em;
}

.hero-intro {
  max-width: 68ch;
  margin-inline: 0;
  line-height: 1.65;
}

/* ---------- 9. Bandeau CTA final : dégradé vivant ---------- */
.cta-bandeau {
  position: relative;
  overflow: hidden;
}

.cta-bandeau::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
    rgba(122, 79, 208, .35),
    rgba(63, 214, 196, .16),
    rgba(224, 83, 160, .22),
    rgba(122, 79, 208, .35));
  background-size: 320% 320%;
  animation: prem-degrade 18s ease infinite;
  pointer-events: none;
  z-index: 0;
}

.cta-bandeau > * {
  position: relative;
  z-index: 1;
}

@keyframes prem-degrade {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ---------- 10. Défilement fluide et respect des préférences ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .aurora::after,
  .cta-bandeau::before {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 11. Blocs éditoriaux (parcours, univers) ---------- */
.prem-anneau {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(240, 196, 106, .35);
  background: rgba(240, 196, 106, .07);
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--prem-or-clair);
}

/* ---------- 12. Mobile : tout respire, rien ne déborde ---------- */
@media (max-width: 767px) {
  .hero-chiffres {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .hero-boutons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .hero-boutons .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .grille-accueil,
  .grille-categories,
  .grille-reassurance,
  .etapes-grille,
  .avantages-grille,
  .footer-grille {
    grid-template-columns: 1fr !important;
  }

  .deux-colonnes {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }

  .grille-galerie {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 420px) {
  .grille-galerie {
    grid-template-columns: 1fr !important;
  }
}
