/* =============================================
   NAV - Barre flottante commune à toutes les pages
   (verre dépoli, bordure animée, indicateur glissant)
   ============================================= */

@property --fnav-a {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.fnav {
  --fnav-ease: cubic-bezier(.2, .8, .2, 1);
  --fnav-spring: cubic-bezier(.34, 1.45, .5, 1);
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(14, 14, 22, .8);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 12px 40px -12px rgba(0, 0, 0, .5),
    0 2px 6px -2px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  transform: translateX(-50%);
  transition: top .5s var(--fnav-ease), padding .5s var(--fnav-ease), background .5s, box-shadow .5s;
  animation: fnavIn 1s var(--fnav-ease) both .15s;
}

@keyframes fnavIn {
  from { opacity: 0; transform: translate(-50%, -24px) scale(.94); filter: blur(8px); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); filter: blur(0); }
}

/* Bordure dégradée qui tourne */
.fnav::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--fnav-a),
    rgba(255, 255, 255, .10) 0deg,
    rgba(255, 255, 255, .10) 40deg,
    rgba(196, 30, 94, .95) 90deg,
    rgba(255, 140, 180, .9) 115deg,
    rgba(255, 255, 255, .10) 170deg,
    rgba(255, 255, 255, .10) 220deg,
    rgba(124, 92, 255, .8) 270deg,
    rgba(255, 255, 255, .10) 320deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: fnavSpin 7s linear infinite;
  pointer-events: none;
}
@keyframes fnavSpin { to { --fnav-a: 360deg; } }

/* Lueur qui suit la souris */
.fnav-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
  background: radial-gradient(140px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .13), transparent 65%);
}
.fnav:hover .fnav-glow { opacity: 1; }

/* Version compacte au scroll */
.fnav.is-compact {
  top: 10px;
  padding: 4px;
  background: rgba(10, 10, 16, .88);
}

/* ── Logo ── */
.fnav-logo {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8B1538, #C41E5E);
  box-shadow: 0 4px 14px -4px rgba(196, 30, 94, .8), inset 0 1px 0 rgba(255, 255, 255, .25);
  font-family: 'Inter Tight', 'Syne', 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .02em;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .6s var(--fnav-spring);
}
.fnav-logo:hover { transform: rotate(-12deg) scale(1.08); }
.fnav-logo span { display: inline-block; transition: transform .5s var(--fnav-spring); }
.fnav-logo:hover span:first-child { transform: translateY(-2px); }
.fnav-logo:hover span:last-child  { transform: translateY(2px); }

.fnav-sep {
  width: 1px;
  height: 18px;
  margin: 0 6px 0 8px;
  background: rgba(255, 255, 255, .14);
  flex-shrink: 0;
}

/* ── Liens + indicateur glissant ── */
.fnav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}
.fnav-ind {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .11);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  opacity: 0;
  pointer-events: none;
  transition:
    transform .55s var(--fnav-spring),
    width .55s var(--fnav-spring),
    opacity .3s;
}
.fnav-ind.is-visible { opacity: 1; }

.fnav-links a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .68);
  text-decoration: none;
  white-space: nowrap;
  transition: color .3s;
}
.fnav-links a:hover,
.fnav-links a.is-active { color: #fff; }

/* Point lumineux sous le lien actif */
.fnav-links a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #ff5c93;
  box-shadow: 0 0 8px 1px rgba(255, 92, 147, .9);
  transform: scale(0);
  transition: transform .45s var(--fnav-spring);
}
.fnav-links a.is-active::after { transform: scale(1); }

/* Étincelle IA */
.fnav-spark {
  font-style: normal;
  font-size: 11px;
  background: linear-gradient(135deg, #ff5c93, #7c5cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
@keyframes fnavTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50%      { transform: scale(.7) rotate(90deg); opacity: .6; }
}

/* ── CTA Contact ── */
.fnav-cta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding: 11px 18px;
  border-radius: 999px;
  background: #fff;
  color: #14141f;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color .4s, transform .4s var(--fnav-spring);
}
.fnav-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, #8B1538, #C41E5E 60%, #ff5c93);
  transform: translateY(102%);
  transition: transform .45s var(--fnav-ease);
}
.fnav-cta:hover { color: #fff; transform: scale(1.04); }
.fnav-cta:hover::before { transform: none; }
.fnav-cta b { font-weight: 700; display: inline-block; transition: transform .4s var(--fnav-spring); }
.fnav-cta:hover b { transform: translateX(3px) rotate(-45deg); }

/* ── Responsive ── */
@media (max-width: 720px) {
  .fnav { top: 12px; font-size: 13px; padding: 5px; }
  .fnav-links a { padding: 10px 11px; }
  .fnav-links .fnav-opt { display: none; }
  .fnav-cta { padding: 10px 14px; margin-left: 2px; }
  .fnav-sep { margin: 0 3px 0 5px; }
}
@media (max-width: 400px) {
  .fnav { font-size: 12.5px; }
  .fnav-logo { width: 34px; height: 34px; font-size: 12px; }
  .fnav-sep { display: none; }
  .fnav-links a { padding: 10px 9px; }
  .fnav-cta b { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fnav, .fnav::before, .fnav-spark { animation: none; }
}

/* ── Menu déroulant « Solutions » ── */
.fnav-dd { position: relative; }
.fnav-dd-btn .fnav-chev {
  margin-left: 2px;
  opacity: .7;
  transition: transform .4s var(--fnav-spring), opacity .3s;
}
.fnav-dd.is-open .fnav-chev { transform: rotate(180deg); opacity: 1; }

.fnav-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  width: 340px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(14, 14, 22, .9);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px) scale(.96);
  transform-origin: top center;
  transition: opacity .3s var(--fnav-ease), transform .45s var(--fnav-spring), visibility 0s .3s;
}
/* Pont invisible pour que le survol ne se coupe pas */
.fnav-menu::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -16px;
  height: 16px;
}
.fnav-dd.is-open .fnav-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
  transition: opacity .3s var(--fnav-ease), transform .45s var(--fnav-spring), visibility 0s;
}

.fnav .fnav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px 8px 8px;
  border-radius: 16px;
  color: #fff;
  text-decoration: none;
  opacity: 0;
  transform: translateY(6px);
  transition: background .3s, opacity .35s var(--fnav-ease), transform .45s var(--fnav-spring);
}
.fnav-dd.is-open .fnav-item { opacity: 1; transform: none; }
.fnav-dd.is-open .fnav-item:nth-child(2) { transition-delay: 0s, .05s, .05s; }
.fnav-item:hover,
.fnav-item.is-current { background: rgba(255, 255, 255, .07); }

.fnav-item img {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform .5s var(--fnav-spring);
}
.fnav-item:hover img { transform: scale(1.06) rotate(-2deg); }
.fnav-item span { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.fnav-item b { font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.fnav-item small { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .55); }
.fnav-item .fnav-spark { font-size: 10px; margin-left: 2px; vertical-align: 2px; }
.fnav-item i {
  font-style: normal;
  color: rgba(255, 255, 255, .4);
  transition: transform .4s var(--fnav-spring), color .3s;
}
.fnav-item:hover i { color: #ff5c93; transform: translateX(4px); }
.fnav-item.is-current b::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: #ff5c93;
  box-shadow: 0 0 8px rgba(255, 92, 147, .9);
  vertical-align: 2px;
}

@media (max-width: 720px) {
  /* Le menu se centre sur la barre de liens pour ne pas déborder de l'écran */
  .fnav-dd { position: static; }
  .fnav-menu { width: min(320px, calc(100vw - 24px)); }
  .fnav-item i { display: none; }
}

/* ── Sous-liens « pages services » dans le menu ── */
.fnav-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding: 10px 6px 4px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s var(--fnav-ease) .08s, transform .45s var(--fnav-spring) .08s;
}
.fnav-dd.is-open .fnav-sub { opacity: 1; transform: none; }
.fnav .fnav-sub a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: background .25s, color .25s;
}
.fnav .fnav-sub a::after { display: none; }
.fnav .fnav-sub a:hover,
.fnav .fnav-sub a.is-current { background: rgba(196, 30, 94, .35); color: #fff; }
