/* =========================================================
   Veye Yo — animations supplémentaires et pages légales
   Les effets d'apparition ne s'activent que si animations.js
   a ajouté la classe .fx sur <html>.
   ========================================================= */

:root {
  --vy-blue: #0058bc;
  --vy-sky: #0070eb;
  --vy-violet: #4c4aca;
  --vy-green: #006e28;
  --vy-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --vy-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Titres mot à mot ---------- */
.fx .fx-word {
  display: inline-block;
  opacity: 0;
  translate: 0 0.55em;
  rotate: 3deg;
  transform-origin: left bottom;
  transition:
    opacity 600ms ease calc(var(--w) * 60ms),
    translate 700ms var(--vy-ease) calc(var(--w) * 60ms),
    rotate 700ms var(--vy-ease) calc(var(--w) * 60ms);
}

.fx .words-in .fx-word {
  opacity: 1;
  translate: 0 0;
  rotate: 0deg;
}

/* ---------- Menu : la page choisie ---------- */
header nav[aria-label="Navigation principale"] a[aria-current]::after {
  left: 0.15rem;
  right: 0.15rem;
  background: linear-gradient(90deg, var(--vy-blue), var(--vy-violet), var(--vy-blue));
  background-size: 200% 100%;
  animation: fx-pan 3s linear infinite;
}

@keyframes fx-pan {
  to { background-position: 200% 0; }
}

/* ---------- Changement de page ---------- */
.fx-sweep {
  position: fixed;
  inset: 5rem 0 auto;
  height: 3px;
  z-index: 60;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--vy-sky), var(--vy-violet), #6ffb85, transparent);
  transform: translateX(-100%);
}

.fx-sweep.is-on {
  animation: fx-sweep 750ms var(--vy-ease);
}

@keyframes fx-sweep {
  to { transform: translateX(100%); }
}

/* ---------- Héros : aurore + flèche de défilement ---------- */
#hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(38% 42% at 20% 30%, rgb(0 112 235 / 20%), transparent 70%),
    radial-gradient(34% 40% at 80% 25%, rgb(102 100 228 / 20%), transparent 70%),
    radial-gradient(40% 40% at 55% 85%, rgb(111 251 133 / 18%), transparent 70%);
  animation: fx-aurora 18s ease-in-out infinite alternate;
}

@keyframes fx-aurora {
  0% { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
  100% { transform: translate3d(4%, 3%, 0) rotate(8deg) scale(1.12); }
}

.fx-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 2px solid rgb(0 88 188 / 45%);
  border-radius: 14px;
  z-index: 10;
}

.fx-scroll-cue::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--vy-blue);
  animation: fx-cue 1.8s ease-in-out infinite;
}

@keyframes fx-cue {
  0% { transform: translateY(0); opacity: 1; }
  70%, 100% { transform: translateY(16px); opacity: 0; }
}

@media (max-width: 1023px) {
  .fx-scroll-cue { display: none; }
}

/* ---------- Bandeau défilant ---------- */
.marquee {
  overflow: hidden;
  padding: 1.1rem 0;
  background: linear-gradient(90deg, #0058bc, #4c4aca, #0070eb, #0058bc);
  background-size: 300% 100%;
  animation: page-in 450ms ease-out both, fx-marquee-bg 14s linear infinite !important;
}

@keyframes fx-marquee-bg {
  to { background-position: 300% 0; }
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: fx-marquee 42s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes fx-marquee {
  to { transform: translateX(-50%); }
}

.marquee-group {
  display: flex;
  flex: none;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 14%);
  color: #fff;
  font: 600 0.875rem "Plus Jakarta Sans", sans-serif;
  white-space: nowrap;
}

.marquee-item .material-symbols-outlined {
  font-size: 1.15rem;
}

/* ---------- Cartes : lumière et relief ---------- */
.fx .fx-spot {
  position: relative;
}

.fx .fx-spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgb(0 112 235 / 16%), transparent 70%);
}

.fx .fx-spot:hover::after {
  opacity: 1;
}

/* L'élévation au survol doit passer devant l'état « apparu » */
.motion-ready .card-hover.reveal.is-revealed:hover {
  translate: 0 -6px;
}

.fx .fx-tilt {
  transition: transform 250ms ease-out, translate 300ms var(--vy-ease), box-shadow 300ms ease, border-color 300ms ease, opacity 700ms ease, scale 700ms var(--vy-ease);
}

/* Icônes qui rebondissent quand la carte apparaît */
.motion-ready .reveal.is-visible > div:first-child > .material-symbols-outlined:only-child {
  animation: fx-pop 800ms var(--vy-spring) calc(var(--reveal-delay, 0ms) + 200ms) both;
}

@keyframes fx-pop {
  from { scale: 0.2; rotate: -25deg; opacity: 0; }
  to { scale: 1; rotate: 0deg; opacity: 1; }
}

.feature-tile:hover .story-icon {
  animation: fx-wiggle 600ms ease;
}

@keyframes fx-wiggle {
  0%, 100% { rotate: 0deg; }
  25% { rotate: -10deg; }
  75% { rotate: 10deg; }
}

/* ---------- Tarifs : offre mise en avant ---------- */
#tarifs .bg-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0058bc, #0070eb 45%, #4c4aca 100%);
  background-size: 200% 200%;
  animation: fx-breathe 7s ease-in-out infinite;
}

#tarifs .bg-primary::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -70%;
  width: 55%;
  height: 220%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 26%), transparent);
  transform: rotate(18deg);
  animation: fx-glint 5.5s ease-in-out infinite;
}

@keyframes fx-breathe {
  0%, 100% { background-position: 0% 0%; box-shadow: 0 18px 45px -18px rgb(0 88 188 / 55%); }
  50% { background-position: 100% 100%; box-shadow: 0 26px 70px -16px rgb(76 74 202 / 65%); }
}

@keyframes fx-glint {
  0%, 45% { left: -70%; }
  80%, 100% { left: 130%; }
}

.fx #tarifs .reveal li {
  opacity: 0;
  translate: -14px 0;
  transition: opacity 500ms ease, translate 500ms var(--vy-ease);
}

.fx #tarifs .reveal.is-visible li {
  opacity: 1;
  translate: 0 0;
}

.fx #tarifs .reveal.is-visible li:nth-child(1) { transition-delay: 450ms; }
.fx #tarifs .reveal.is-visible li:nth-child(2) { transition-delay: 600ms; }
.fx #tarifs .reveal.is-visible li:nth-child(3) { transition-delay: 750ms; }

/* ---------- Étiquettes « Nouveau » ---------- */
#bientot article > span:first-child {
  animation: fx-badge 2.4s ease-in-out infinite;
}

@keyframes fx-badge {
  0%, 100% { scale: 1; box-shadow: 0 0 0 0 rgb(76 74 202 / 30%); }
  50% { scale: 1.06; box-shadow: 0 0 0 7px rgb(76 74 202 / 0%); }
}

/* ---------- En-tête de page (sécurité, légal, testeur, contact, 404) ---------- */
.fx-page-icon {
  position: relative;
  animation: fx-float 4.5s ease-in-out infinite;
}

.fx-page-icon::before,
.fx-page-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid rgb(0 88 188 / 35%);
  animation: fx-ring 3s ease-out infinite;
  pointer-events: none;
}

.fx-page-icon::after {
  animation-delay: 1.5s;
}

@keyframes fx-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

@keyframes fx-ring {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(2.1); opacity: 0; }
}

.fx-page-glow {
  position: absolute;
  inset: 0 0 auto;
  height: 520px;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}

.fx-page-glow i {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.28;
  animation: fx-drift 14s ease-in-out infinite alternate;
}

.fx-page-glow i:nth-child(1) { left: -80px; top: -60px; background: #0070eb; }
.fx-page-glow i:nth-child(2) { right: -90px; top: 20px; background: #6664e4; animation-duration: 18s; animation-delay: -6s; }
.fx-page-glow i:nth-child(3) { left: 42%; top: 130px; background: #6ffb85; animation-duration: 22s; animation-delay: -11s; }

@keyframes fx-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(50px, 40px, 0) scale(1.2); }
}

/* ---------- Pages légales ---------- */
.legal-brief {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .legal-brief { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.legal-brief-card {
  padding: 1.1rem;
  border-radius: 1.1rem;
  border: 1px solid rgb(193 198 215 / 45%);
  background: rgb(255 255 255 / 80%);
  transition: translate 300ms var(--vy-ease), box-shadow 300ms ease;
}

.legal-brief-card:hover {
  translate: 0 -5px;
  box-shadow: 0 20px 40px -22px rgb(0 88 188 / 45%);
}

.legal-brief-card .material-symbols-outlined {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
  margin-bottom: 0.6rem;
  color: #fff;
  background: linear-gradient(135deg, var(--vy-blue), var(--vy-violet));
}

.legal-brief-card:nth-child(2n) .material-symbols-outlined {
  background: linear-gradient(135deg, var(--vy-green), #1ba84c);
}

.legal-brief-card strong {
  display: block;
  font: 700 0.95rem "Plus Jakarta Sans", sans-serif;
  color: #1a1b1f;
}

.legal-brief-card p {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #414755;
}

.legal-toc {
  position: sticky;
  top: 5.5rem;
  z-index: 20;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  border-radius: 999px;
  border: 1px solid rgb(193 198 215 / 45%);
  background: rgb(250 249 254 / 98%);
  box-shadow: 0 12px 30px -20px rgb(0 88 188 / 45%);
}

.legal-toc::-webkit-scrollbar { display: none; }

.legal-toc a {
  flex: none;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font: 600 0.78rem "Plus Jakarta Sans", sans-serif;
  color: #414755;
  white-space: nowrap;
  transition: background 250ms ease, color 250ms ease;
}

.legal-toc a:hover { background: #eeedf3; }

.legal-toc a.is-active {
  color: #fff;
  background: linear-gradient(90deg, var(--vy-blue), var(--vy-violet));
}

.legal-doc > section {
  position: relative;
  padding: 1.4rem;
  border-radius: 1.4rem;
  border: 1px solid rgb(193 198 215 / 35%);
  background: rgb(255 255 255 / 78%);
  scroll-margin-top: 10rem;
  transition: border-color 350ms ease, box-shadow 350ms ease;
}

@media (min-width: 640px) {
  .legal-doc > section { padding: 1.9rem 2rem; }
}

.legal-doc > section::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 1.6rem;
  bottom: 1.6rem;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--vy-sky), var(--vy-violet));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 700ms var(--vy-ease);
}

.legal-doc > section.is-current::before { transform: scaleY(1); }

.legal-doc > section.is-current {
  border-color: rgb(0 88 188 / 30%);
  box-shadow: 0 24px 55px -35px rgb(0 88 188 / 55%);
}

.legal-doc tbody tr { transition: background 200ms ease; }
.legal-doc tbody tr:hover { background: rgb(0 112 235 / 6%); }

.legal-doc li::marker { color: var(--vy-blue); }

.fx .fx-rise {
  opacity: 0;
  translate: 0 22px;
  transition: opacity 650ms ease var(--d, 0ms), translate 650ms var(--vy-ease) var(--d, 0ms);
}

.fx .fx-rise.fx-in {
  opacity: 1;
  translate: 0 0;
}

/* Sur téléphone, chaque ligne de tableau devient une carte lisible */
@media (max-width: 640px) {
  .legal-doc thead { display: none; }
  .legal-doc table,
  .legal-doc tbody,
  .legal-doc tr,
  .legal-doc td { display: block; width: 100%; }
  .legal-doc tr { padding: 0.8rem 0.9rem; }
  .legal-doc td { padding: 0.15rem 0 !important; }
  .legal-doc td:first-child { font-weight: 600; color: #1a1b1f; }
  .legal-doc td[data-label]::before {
    content: attr(data-label) " : ";
    font-weight: 600;
    color: var(--vy-blue);
  }
}

/* ---------- 404 ---------- */
.fx-404 {
  background: linear-gradient(90deg, #0058bc, #6664e4, #006e28, #0058bc);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: fx-pan-404 6s linear infinite, fx-float 4s ease-in-out infinite;
}

@keyframes fx-pan-404 {
  to { background-position: 300% 0; }
}

/* ---------- Formulaires ---------- */
main form input:not([type="checkbox"]):not([type="file"]),
main form select,
main form textarea {
  transition: box-shadow 250ms ease, border-color 250ms ease, translate 250ms ease;
}

main form input:not([type="checkbox"]):not([type="file"]):focus,
main form select:focus,
main form textarea:focus {
  translate: 0 -2px;
  box-shadow: 0 14px 30px -18px rgb(0 88 188 / 60%);
}

.fx-confetti {
  position: fixed;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  z-index: 100;
  pointer-events: none;
}

/* ---------- Pied de page ---------- */
footer ul a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 300ms ease, color 200ms ease;
}

footer ul a:hover { background-size: 100% 1px; }

/* ---------- FAQ ---------- */
.faq-item[aria-expanded="true"] {
  border-color: rgb(0 88 188 / 35%);
  box-shadow: 0 20px 45px -28px rgb(0 88 188 / 55%);
}

.faq-item[aria-expanded="true"] .faq-content > * {
  animation: fx-answer 450ms var(--vy-ease) both;
}

@keyframes fx-answer {
  from { opacity: 0; translate: 0 -8px; }
}

/* ---------- Préférence « moins d'animations » ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }

  .marquee-track { width: auto; overflow-x: auto; }
  .marquee-group[aria-hidden="true"] { display: none; }
  .fx-scroll-cue, .fx-sweep { display: none; }
}
