/* ==========================================================================
   Assets UI NIKITA : portage leger HTML/CSS/JS vanilla, zero dependance.
   Ameliorations progressives harmonisees avec la direction artistique V5e :
   1. Ambiance BG.IBELICK + Paper Shaders (trame fine et halo doux).
   2. Magic UI + React Bits (RefletCarte au survol, shimmer CTA, revelation
      echelonnee sous .js-anime, bandes defilantes adoucies).
   3. NumberFlow (rouleaux de chiffres tabular-nums au format fr-FR).
   4. SmoothUI / 01orbital (barre au defilement, accordeons details, liens
      tactiles et etats :focus-visible WCAG AA).
   Sans JS ou sous prefers-reduced-motion: reduce, tout reste visible et stable.
   ========================================================================== */

:root {
  --au-encre: #230b20;
  --au-nuit: #1a0a18;
  --au-magenta: #cc00cc;
  --au-magenta-vif: #e000cf;
  --au-magenta-clair: #ff80ff;
  --au-sable: #f1ece6;
  --au-courbe: cubic-bezier(0.22, 1, 0.36, 1);
  --au-ressort: cubic-bezier(0.34, 1.32, 0.64, 1);
}

html {
  scroll-padding-top: 96px;
}

/* --------------------------------------------------------------------------
   1. BG.IBELICK + Paper Shaders : trame fine et halo organique leger
   -------------------------------------------------------------------------- */

/* Hero Accueil V5e : trame architecturale discrete estompee sur les bords. */
.ac-hero-boite {
  isolation: isolate;
}

.ac-hero-boite::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(35, 11, 32, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(35, 11, 32, 0.045) 1px, transparent 1px),
    radial-gradient(rgba(204, 0, 204, 0.14) 1px, transparent 1.2px);
  background-size: 40px 40px, 40px 40px, 40px 40px;
  background-position: center top, center top, center top;
  -webkit-mask-image: radial-gradient(ellipse 74% 66% at 50% 34%, #000 18%, rgba(0, 0, 0, 0.35) 56%, transparent 86%);
  mask-image: radial-gradient(ellipse 74% 66% at 50% 34%, #000 18%, rgba(0, 0, 0, 0.35) 56%, transparent 86%);
}

.ac-hero-texte {
  z-index: 2;
}

/* Canvas Paper Shaders (injecte en JS sur les sections Hero adaptees). */
.au-shader {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.78;
  display: block;
}

/* Pages Offres (Formations, Consultants) : grille de points fine en tete. */
.offer-overview {
  isolation: isolate;
  overflow: clip;
}

.offer-overview::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(35, 11, 32, 0.095) 1px, transparent 1.4px),
    radial-gradient(ellipse 68% 58% at 50% 10%, rgba(204, 0, 204, 0.06), transparent 72%);
  background-size: 28px 28px, 100% 100%;
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 28%, #000 24%, transparent 86%);
  mask-image: radial-gradient(ellipse 78% 72% at 50% 28%, #000 24%, transparent 86%);
}

.offer-overview > .cadre {
  z-index: 2;
}

/* Pages Profils : halo doux et micro-grille dans la teinte du profil. */
.page-profile .profile-hero {
  position: relative;
  isolation: isolate;
}

.page-profile .profile-hero::before {
  content: "";
  position: absolute;
  inset: -40px -24px -12px;
  z-index: -1;
  pointer-events: none;
  border-radius: 36px;
  background-image:
    linear-gradient(to right, rgba(35, 11, 32, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(35, 11, 32, 0.035) 1px, transparent 1px),
    radial-gradient(ellipse 65% 60% at 24% 25%, var(--profile-tint, #f1ece6) 0%, transparent 72%);
  background-size: 36px 36px, 36px 36px, 100% 100%;
  -webkit-mask-image: radial-gradient(ellipse 84% 78% at 50% 45%, #000 32%, transparent 92%);
  mask-image: radial-gradient(ellipse 84% 78% at 50% 45%, #000 32%, transparent 92%);
}

/* Sections cles NIKISCORE / NIKIBOT / NIKIFILTRE (tarifs) : halo sobre. */
.nb-tarifs {
  isolation: isolate;
}

.nb-tarifs::before {
  content: "";
  position: absolute;
  inset: 40px 0 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 18%, rgba(204, 0, 204, 0.055), transparent 74%);
}

/* --------------------------------------------------------------------------
   2. Magic UI + React Bits : RefletCarte, Shimmer CTA, Revelation, Marquee
   -------------------------------------------------------------------------- */

/* RefletCarte : reflet lumineux radial suivant le pointeur sur les cartes. */
.au-reflet {
  position: relative;
  isolation: isolate;
}

.au-reflet::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--au-rx, 50%) var(--au-ry, 50%),
    rgba(204, 0, 204, 0.09),
    rgba(255, 255, 255, 0.14) 36%,
    transparent 70%
  );
  transition: opacity 0.28s ease;
}

.au-reflet-sombre::after {
  background: radial-gradient(
    440px circle at var(--au-rx, 50%) var(--au-ry, 50%),
    rgba(255, 130, 255, 0.18),
    rgba(255, 255, 255, 0.08) 40%,
    transparent 72%
  );
}

@media (hover: hover) and (pointer: fine) {
  .au-reflet:hover::after {
    opacity: 1;
  }

  .au-reflet:is(
    .ac-agents-carte,
    .ac-contact-carte,
    .ac-nf-exemple p,
    .nb-offre,
    .ns-plus li,
    .nb-dedie-options li,
    .offer-course,
    .metier-carte,
    .profile-usecase,
    .profile-product
  ) {
    transition:
      transform 0.34s var(--au-courbe),
      box-shadow 0.34s var(--au-courbe),
      border-color 0.28s ease;
  }

  .au-reflet:is(
    .ac-agents-carte,
    .ns-plus li,
    .offer-course,
    .metier-carte,
    .profile-usecase,
    .profile-product
  ):hover {
    transform: translateY(-4px);
    border-color: rgba(204, 0, 204, 0.24);
    box-shadow:
      0 1px 0 rgba(35, 11, 32, 0.04),
      0 20px 44px -22px rgba(35, 11, 32, 0.18);
  }
}

/* Shimmer discret sur les boutons CTA principaux. */
:is(
  .ac-btn-sombre,
  .nb-btn-sombre,
  .profile-primary,
  .offer-main-action .btn,
  .offer-bottom .btn,
  .ac-amia-btn-plein
) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

@media (prefers-reduced-motion: no-preference) {
  :is(
    .ac-btn-sombre,
    .nb-btn-sombre,
    .profile-primary,
    .offer-main-action .btn,
    .offer-bottom .btn
  )::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
      112deg,
      transparent 28%,
      rgba(255, 255, 255, 0.22) 48%,
      rgba(255, 150, 255, 0.16) 54%,
      transparent 72%
    );
    transform: translateX(-140%) skewX(-16deg);
    transition: transform 0.72s var(--au-courbe);
  }

  :is(
    .ac-btn-sombre,
    .nb-btn-sombre,
    .profile-primary,
    .offer-main-action .btn,
    .offer-bottom .btn
  ):hover::after,
  :is(
    .ac-btn-sombre,
    .nb-btn-sombre,
    .profile-primary,
    .offer-main-action .btn,
    .offer-bottom .btn
  ):focus-visible::after {
    transform: translateX(140%) skewX(-16deg);
  }

  .ac-amia-btn-plein::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
      112deg,
      transparent 30%,
      rgba(31, 31, 184, 0.12) 50%,
      transparent 70%
    );
    transform: translateX(-140%) skewX(-16deg);
    transition: transform 0.72s var(--au-courbe);
  }

  .ac-amia-btn-plein:hover::after,
  .ac-amia-btn-plein:focus-visible::after {
    transform: translateX(140%) skewX(-16deg);
  }
}

/* Revelation douce et echelonnee au scroll : uniquement sous .js-anime
   et hors prefers-reduced-motion. Sans JS, opacity reste toujours a 1.
   Utilise la propriete individuelle translate pour ne jamais bloquer transform. */
@media (prefers-reduced-motion: no-preference) {
  .js-anime [data-au-revele] {
    transition:
      opacity 0.62s var(--au-courbe) var(--au-delai, 0ms),
      translate 0.68s var(--au-courbe) var(--au-delai, 0ms);
  }

  .js-anime [data-au-revele]:not(.au-visible) {
    opacity: 0;
    translate: 0 18px;
  }
}

/* Bandes defilantes (logos partenaires et collectif) : fondu doux sur les
   bords, pause au survol et au focus clavier, arret sous mouvement reduit. */
.ac-preuves-defile:focus-within .ac-preuves-logos,
.ac-defile:focus-within .ac-defile-piste {
  animation-play-state: paused;
}

.ac-preuves-logos img {
  transition: opacity 0.25s ease, filter 0.25s ease, transform 0.25s var(--au-courbe);
}

@media (hover: hover) {
  .ac-preuves-logos li:hover img {
    opacity: 0.92;
    filter: grayscale(0);
    transform: translateY(-1px);
  }
}

.ac-defile {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

/* --------------------------------------------------------------------------
   3. NumberFlow vanilla : rouleaux de chiffres fluides (tabular-nums, fr-FR)
   -------------------------------------------------------------------------- */

.au-nf,
[data-au-nf],
[data-mv-chiffre] {
  font-variant-numeric: tabular-nums;
}

.au-nf-visuel {
  display: inline-flex;
  align-items: baseline;
  vertical-align: baseline;
  font-size: inherit;
  color: inherit;
  line-height: 1.05;
  padding: 0;
  margin: 0;
}

.au-nf-visuel span {
  font-size: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
}

.au-nf-col {
  display: inline-block;
  height: 1.05em;
  overflow: hidden;
  vertical-align: bottom;
}

.au-nf-rouleau {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(0);
  will-change: transform;
}

.au-nf-rouleau > span {
  display: block;
  height: 1.05em;
  line-height: 1.05em;
}

@media (prefers-reduced-motion: no-preference) {
  .au-nf-rouleau {
    transition: transform 0.95s var(--au-courbe) var(--au-nf-delai, 0ms);
  }
}

.au-nf-signe {
  display: inline-block;
  line-height: 1.05;
}

/* --------------------------------------------------------------------------
   4. SmoothUI / 01orbital : barre au scroll, accordeons, liens, focus WCAG AA
   -------------------------------------------------------------------------- */

/* Barre de navigation flottante raffinee au defilement. */
.ac-barre[data-barre].au-barre-fixe {
  position: fixed;
  top: 38px;
  left: 0;
  right: 0;
  transition: top 0.32s var(--au-courbe);
}

.ac-barre[data-barre].au-barre-fixe.au-barre-defilee {
  top: 14px;
}

@media (max-width: 760px) {
  .ac-barre[data-barre].au-barre-fixe {
    top: 26px;
  }

  .ac-barre[data-barre].au-barre-fixe.au-barre-defilee {
    top: 10px;
  }
}

.ac-barre[data-barre] .ac-pilule {
  transition:
    background-color 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.32s var(--au-courbe);
}

.ac-barre[data-barre].au-barre-defilee .ac-pilule,
body:not(.page-accueil-v5) .ac-barre[data-barre].au-barre-defilee .ac-pilule {
  background: rgba(255, 255, 255, 0.93);
  border-color: rgba(35, 11, 32, 0.1);
  box-shadow:
    0 1px 2px rgba(35, 11, 32, 0.05),
    0 14px 36px -12px rgba(35, 11, 32, 0.16);
}

/* Garder le panneau opaque et sans backdrop-filter quand un menu est ouvert. */
.ac-barre[data-barre].au-barre-defilee .ac-pilule:has(details[open]),
.ac-barre[data-barre].au-barre-defilee .ac-pilule:has(.ac-menu-metiers:hover),
.ac-barre[data-barre].au-barre-defilee .ac-pilule:has(.ac-menu-metiers:focus-within),
body:not(.page-accueil-v5) .ac-barre[data-barre].au-barre-defilee .ac-pilule:has(details[open]),
body:not(.page-accueil-v5) .ac-barre[data-barre].au-barre-defilee .ac-pilule:has(.ac-menu-metiers:hover),
body:not(.page-accueil-v5) .ac-barre[data-barre].au-barre-defilee .ac-pilule:has(.ac-menu-metiers:focus-within) {
  background: #fff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Retour tactile subtil a la pression sur les boutons et onglets. */
@media (prefers-reduced-motion: no-preference) {
  :is(
    .ac-btn,
    .nb-btn,
    .ac-amia-btn,
    .ac-nav-audit,
    .btn,
    .profile-primary,
    .ac-metiers-liste a,
    .ac-annonce
  ):active {
    transform: translateY(0) scale(0.985);
  }
}

/* Liens editoriaux raffines : transition couleur et deplacement de fleche. */
:is(.ac-lien, .ac-lien-clair, .ac-agents-lien, .profile-secondary, .offer-back, .offer-course > a, .offer-collective a) {
  transition: color 0.2s ease, border-color 0.2s ease;
}

.ac-agents-lien span[aria-hidden],
.ac-annonce-fleche,
.profile-secondary .ico,
.offer-course > a .ico,
.offer-collective a .ico {
  display: inline-flex;
  transition: transform 0.24s var(--au-courbe);
}

@media (hover: hover) {
  .ac-agents-lien:hover span[aria-hidden],
  .profile-secondary:hover .ico,
  .offer-course > a:hover .ico,
  .offer-collective a:hover .ico {
    transform: translateX(4px);
  }

  .ac-annonce {
    transition: border-color 0.24s ease, box-shadow 0.28s var(--au-courbe), transform 0.28s var(--au-courbe);
  }

  .ac-annonce:hover {
    border-color: rgba(204, 0, 204, 0.3);
    box-shadow: 0 10px 24px -14px rgba(35, 11, 32, 0.22);
    transform: translateY(-1px);
  }

  .ac-annonce:hover .ac-annonce-fleche {
    transform: translate(2px, -2px);
  }
}

/* Accordeons FAQ (<details>) : ouverture fluide sur toutes les pages. */
:is(.faq-list details, .offer-disclosure, .offer-program) > summary {
  transition: color 0.2s ease, background-color 0.2s ease;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (interpolate-size: allow-keywords) {
    :is(.faq-list, .offer-options, .profile-faq) {
      interpolate-size: allow-keywords;
    }

    :is(.faq-list details, .offer-disclosure, .offer-program)::details-content {
      overflow: clip;
      contain: layout;
      transition:
        block-size 0.34s var(--au-courbe),
        opacity 0.28s ease,
        content-visibility 0.34s allow-discrete;
    }

    :is(.faq-list details, .offer-disclosure, .offer-program):not([open])::details-content {
      block-size: 0;
      height: 0;
      opacity: 0;
    }

    :is(.faq-list details, .offer-disclosure, .offer-program)[open]::details-content {
      block-size: auto;
      height: auto;
      opacity: 1;
    }
  }
}

/* Focus clavier (:focus-visible) haute visibilite WCAG AA (contraste >= 3:1). */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--au-magenta);
  outline-offset: 3px;
}

:is(.ac-securite, .ac-amia-bleu, .ac-pied, .nb-dedie, .pied) :where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--au-magenta-clair);
  outline-offset: 3px;
}

.page-profile :where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--profile-color, var(--au-encre));
  outline-offset: 3px;
}

.ac-faq summary:focus-visible,
.faq-list summary:focus-visible,
.offer-disclosure > summary:focus-visible {
  border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Accessibilite : prefers-reduced-motion (tout immobile et immediatement lisible)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .au-shader {
    opacity: 0.45;
  }

  .au-reflet::after {
    display: none;
  }

  .au-nf-rouleau {
    transition: none !important;
  }

  .ac-defile {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .ac-barre[data-barre].au-barre-fixe,
  .ac-barre[data-barre] .ac-pilule {
    transition: none !important;
  }

  .js-anime [data-au-revele] {
    opacity: 1 !important;
    translate: none !important;
    transition: none !important;
  }
}
