/* =========================================================
   CyberSource BGFI — Polish & Micro-interactions
   Complète styles.css sans le modifier (offline-ready)
   ========================================================= */

/* ---------- Header : transition au scroll ---------- */
.site-header {
  transition: background .35s ease, box-shadow .35s ease, height .35s ease;
}
.site-header.scrolled {
  background: rgba(0, 27, 52, .97);
  box-shadow: 0 4px 30px rgba(0, 0, 0, .25);
}
.site-header.scrolled .navbar { height: 68px; }

/* ---------- Animations d'entrée ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Hero : animation au load */
.hero .eyebrow { animation: fadeInUp .6s ease-out both; }
.hero .hero-title,
.hero .page-title { animation: fadeInUp .7s ease-out .1s both; }
.hero .hero-lead,
.hero .page-lead { animation: fadeInUp .7s ease-out .2s both; }
.hero .hero-actions { animation: fadeInUp .7s ease-out .3s both; }
.hero .hero-points { animation: fadeInUp .7s ease-out .4s both; }
.hero .hero-visual { animation: scaleIn .8s ease-out .2s both; }

/* ---------- Reveal au scroll (Intersection Observer) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s cubic-bezier(.16,1,.3,1), transform .65s cubic-bezier(.16,1,.3,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.reveal-delay-1 { transition-delay: .1s; }
.reveal.reveal-delay-2 { transition-delay: .2s; }
.reveal.reveal-delay-3 { transition-delay: .3s; }

/* ---------- Cartes : hover amélioré ---------- */
.card {
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--sage));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s cubic-bezier(.16,1,.3,1);
}
.card:hover::before { transform: scaleX(1); }
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px -12px rgba(7, 42, 74, .2);
  border-color: rgba(58, 162, 171, .3);
}

/* ---------- Boutons : effet ripple + polish ---------- */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  transform: translate(-50%, -50%);
  transition: width .5s ease, height .5s ease;
}
.btn:active::after { width: 300px; height: 300px; transition: 0s; }
.btn-primary {
  background: linear-gradient(135deg, var(--success), #15a56b);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #188253, #117045);
  box-shadow: 0 4px 20px -4px rgba(30, 154, 99, .5);
}

/* ---------- Sliders custom (simulateur) ---------- */
.range-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal) var(--val, 50%), #E4EBF2 var(--val, 50%), #E4EBF2 100%);
  outline: none;
  cursor: pointer;
}
.range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--teal);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.range-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(58, 162, 171, .4);
}
.range-row input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--teal);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  cursor: pointer;
}

/* ---------- Formulaire : focus amélioré ---------- */
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(58, 162, 171, .14);
  background: #fff;
}

/* ---------- Images : loading + accessibilité ---------- */
img[loading] { content-visibility: auto; }

/* ---------- FAQ : animation fluide ---------- */
.faq-item.open .faq-panel {
  max-height: 300px;
  transition: max-height .4s cubic-bezier(.16,1,.3,1);
}

/* ---------- Toast : entrée améliorée ---------- */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.toast.show { animation: toastIn .35s cubic-bezier(.16,1,.3,1); }

/* ---------- Trust cards : hover ---------- */
.trust-item {
  transition: background .25s ease;
}
.trust-item:hover {
  background: rgba(58, 162, 171, .04);
}

/* ---------- CTA band : glow accent ---------- */
.cta-band {
  transition: box-shadow .35s ease;
}
.cta-band:hover {
  box-shadow: 0 8px 50px -10px rgba(0, 53, 101, .35);
}

/* ---------- Respect des préférences d'animation ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Scrollbar moderne ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =========================================================
   Pages légales : barre de progression + scrollspy
   ========================================================= */

/* Barre de progression de lecture (haut fixe) */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--sage));
  z-index: 9999;
  transition: width .1s ease;
}

/* Scrollspy : section active dans le sommaire */
.legal-nav a {
  position: relative;
  transition: color .2s ease, padding-left .2s ease;
  border-left: 2px solid transparent;
  padding-left: 12px;
}
.legal-nav a.active {
  color: var(--navy);
  font-weight: 700;
  border-left-color: var(--teal);
  padding-left: 16px;
}

/* Animation des cartes légales au scroll */
.legal-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.legal-card.visible {
  opacity: 1;
  transform: translateY(0);
}
