/* La magie commune du site Frequence financiere : ambiance d'Aura Flow.
   Chaque page la porte avec body.ff-magie et une variante data-ambiance,
   pour que les pages se ressemblent sans etre identiques.
   Toutes les animations s'eteignent si la personne a demande moins de mouvement. */

body.ff-magie {
  --ff-nuit: #1b1436;
  --ff-nuit-2: #120d26;
  --ff-or: #cf9a4c;
  --ff-or-clair: #f7d696;
  --ff-texte: #ddd6f5;
  --ff-voile-rgb: 200, 189, 246; /* teinte des bordures et voiles de verre */
  --ff-a1: #6b60cd; /* les trois aurores (changent selon la page) */
  --ff-a2: #8880d7;
  --ff-a3: #cf9a4c;
  color: #fff;
  background: linear-gradient(180deg, var(--ff-nuit) 0%, var(--ff-nuit-2) 55%, var(--ff-nuit-3, #0d0a1c) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
.ff-magie .site-header { background: color-mix(in srgb, var(--ff-nuit) 75%, transparent); border-bottom: 1px solid rgba(var(--ff-voile-rgb), 0.12); }
.ff-magie .main-nav a { color: #fff; }
.ff-magie .main-nav a:hover, .ff-magie .main-nav a.active { color: var(--ff-or-clair); }
.ff-magie .nav-toggle { color: #fff; }
.ff-magie h1, .ff-magie h2, .ff-magie h3 { color: #fff; }
.ff-magie .eyebrow { color: var(--color-lilac); }
.ff-magie .eyebrow::before, .ff-magie .eyebrow::after { background: var(--color-lilac); opacity: 0.5; }
.ff-magie .twinkle { opacity: 0.45; }

/* L'or qui miroite : remplace le degrade violet sur fond nuit */
.ff-magie .gradient-text {
  background-image: linear-gradient(100deg, var(--ff-or), var(--ff-or-clair) 30%, #fff 50%, var(--ff-or-clair) 70%, var(--ff-or));
  background-size: 220% 100%;
  animation: ff-miroite 4.5s linear infinite;
  filter: drop-shadow(0 0 14px rgba(247, 214, 150, 0.35));
}
.ff-magie .gradient-text::before, .ff-magie .gradient-text::after { color: var(--ff-or-clair); }
@keyframes ff-miroite { to { background-position: -220% 0; } }

/* ---------- Les aurores qui flottent derriere tout ---------- */
.ff-aurore { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ff-aurore span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; }
.ff-aurore span:nth-child(1) { width: 620px; height: 620px; top: -180px; left: -160px; background: var(--ff-a1); animation: ff-derive 22s ease-in-out infinite alternate; }
.ff-aurore span:nth-child(2) { width: 520px; height: 520px; top: 30%; right: -200px; background: var(--ff-a2); opacity: 0.35; animation: ff-derive 28s ease-in-out infinite alternate-reverse; }
.ff-aurore span:nth-child(3) { width: 460px; height: 460px; bottom: -160px; left: 30%; background: var(--ff-a3); opacity: 0.18; animation: ff-derive 25s ease-in-out infinite alternate; }
@keyframes ff-derive {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.15); }
  100% { transform: translate(-40px, 120px) scale(0.95); }
}

/* ---------- Boutons ---------- */
.ff-magie .btn-primary {
  position: relative; overflow: hidden;
  background: linear-gradient(100deg, var(--ff-or), var(--ff-or-clair));
  color: var(--ff-nuit);
  box-shadow: 0 10px 30px rgba(207, 154, 76, 0.35);
}
.ff-magie .btn-primary:hover { box-shadow: 0 14px 40px rgba(247, 214, 150, 0.55); color: var(--ff-nuit); }
.ff-magie .btn-primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: skewX(-20deg);
  animation: ff-eclat 3.2s ease-in-out infinite;
}
@keyframes ff-eclat { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.ff-magie .btn-outline { border-color: rgba(var(--ff-voile-rgb), 0.45); color: #fff; }
.ff-magie .btn-outline:hover { border-color: var(--ff-or-clair); color: var(--ff-or-clair); }

.ff-verre {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--ff-voile-rgb), 0.16);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.ff-verre:hover { transform: translateY(-6px); border-color: rgba(247, 214, 150, 0.45); box-shadow: 0 20px 50px rgba(107, 96, 205, 0.35); }

/* Etincelles qui suivent la souris (creees par magie.js) */
.ff-etincelle {
  position: fixed; z-index: 200; pointer-events: none; color: var(--ff-or-clair);
  text-shadow: 0 0 8px rgba(247, 214, 150, 0.9); font-size: 12px;
  animation: ff-etincelle 0.9s ease-out forwards;
}
@keyframes ff-etincelle { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2) rotate(90deg); } }

/* Apparition au defilement */
.ff-apparait { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s ease; }
.ff-apparait.ff-vu { opacity: 1; transform: none; }

.ff-magie .site-footer { background: rgba(10, 7, 22, 0.85); }


/* ---------- Une variante par page : memes ingredients, autre dosage ---------- */
body[data-ambiance="aura"]   { --ff-a1: #8880d7; --ff-a2: #c8bdf6; --ff-a3: #b27fb8; }  /* lilas et orchidee, comme l'appli */
body[data-ambiance="livre"]  { --ff-a1: #6b60cd; --ff-a2: #cf9a4c; --ff-a3: #8880d7; }  /* plus d'or, comme la couverture */
body[data-ambiance="test"]   { --ff-a1: #b27fb8; --ff-a2: #6b60cd; --ff-a3: #7fb8c9; }  /* orchidee et bleu ciel, plus mysterieux */
body[data-ambiance="podcast"]{ --ff-a1: #4a3fa3; --ff-a2: #cf9a4c; --ff-a3: #d98a9a; }  /* chaud comme un cafe */
body[data-ambiance="contact"]{ --ff-a1: #6b60cd; --ff-a2: #d98a9a; --ff-a3: #f7d696; }  /* rose corail, doux */

@keyframes ff-pulse { 0%, 100% { transform: scale(0.92); opacity: 0.8; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes ff-flotte { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-14px) rotate(1deg); } }

/* ---------- Les pages interieures sur fond nuit ---------- */
.ff-magie p, .ff-magie li { color: var(--ff-texte); }
.ff-magie .lead { color: #efeaff; }
.ff-magie a:not(.btn) { color: var(--ff-or-clair); }
.ff-magie .section { background: transparent; }
.ff-magie .section-lilas {
  background: linear-gradient(180deg, rgba(var(--ff-voile-rgb), 0.07), rgba(var(--ff-voile-rgb), 0.02));
  border-top: 1px solid rgba(var(--ff-voile-rgb), 0.1);
  border-bottom: 1px solid rgba(var(--ff-voile-rgb), 0.1);
}
.ff-magie .section-mauve {
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--ff-voile-rgb), 0.22), transparent 60%),
    linear-gradient(150deg, rgba(107, 96, 205, 0.55), rgba(55, 44, 110, 0.35));
}

@media (max-width: 860px) {
  .ff-aurore span { filter: blur(60px); }
}
@media (prefers-reduced-motion: reduce) {
  .ff-magie *, .ff-magie *::before, .ff-magie *::after { animation: none !important; transition: none !important; }
  .ff-apparait { opacity: 1; transform: none; }
}

/* ---------- Les cartes deviennent du verre (la teinte change selon la page) ---------- */
body.ff-magie { --ff-accent: var(--color-lilac); }
body[data-ambiance="livre"]   { --ff-accent: #f7d696; }
body[data-ambiance="test"]    { --ff-accent: #d7a6dd; }
body[data-ambiance="podcast"] { --ff-accent: #f0b49c; }
body[data-ambiance="contact"] { --ff-accent: #f2b8c2; }

.ff-magie .vente-carte, .ff-magie .vente-ligne, .ff-magie .perso-carte, .ff-magie .contact-carte {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(var(--ff-voile-rgb), 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.ff-magie .vente-ligne { border-left: 4px solid var(--ff-accent); }
.ff-magie .vente-carte:hover, .ff-magie .vente-ligne:hover, .ff-magie .perso-carte:hover {
  transform: translateY(-5px);
  border-color: var(--ff-accent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 30px color-mix(in srgb, var(--ff-accent) 35%, transparent);
}
.ff-magie .vente-carte h3, .ff-magie .vente-ligne h3, .ff-magie .perso-carte h3 { color: var(--ff-accent); }
.ff-magie .vente-carte p, .ff-magie .vente-ligne p, .ff-magie .perso-carte p, .ff-magie .contact-note { color: var(--ff-texte); }

.ff-magie .vente-baseline { background: transparent; border: 1px solid var(--ff-accent); color: var(--ff-accent); box-shadow: 0 0 18px color-mix(in srgb, var(--ff-accent) 30%, transparent); }

.ff-magie .contact-titre {
  background-image: linear-gradient(100deg, var(--ff-or), var(--ff-or-clair) 30%, #fff 50%, var(--ff-or-clair) 70%, var(--ff-or));
  background-size: 220% 100%;
  animation: ff-miroite 4.5s linear infinite;
}
.ff-magie .contact-carte label span { color: #fff; }
.ff-magie .contact-carte input, .ff-magie .contact-carte select, .ff-magie .contact-carte textarea {
  background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(var(--ff-voile-rgb), 0.3);
}
.ff-magie .contact-carte input:focus, .ff-magie .contact-carte select:focus, .ff-magie .contact-carte textarea:focus { border-color: var(--ff-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ff-accent) 25%, transparent); }
.ff-magie .contact-carte option { color: #2c2740; }

/* ---------- Le test : questions et resultats sur fond nuit ---------- */
.ff-magie .perso-revers, .ff-magie .test-revers { color: #b9b0d9 !important; border-top-color: rgba(var(--ff-voile-rgb), 0.18); }
.ff-magie .test-item, .ff-magie .test-carte-resultat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(var(--ff-voile-rgb), 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
}
.ff-magie .test-enonce, .ff-magie .test-barre-nom { color: #fff; }
.ff-magie .test-intro { color: var(--ff-texte); }
.ff-magie .test-note, .ff-magie .test-compteur, .ff-magie .test-barre-valeur, .ff-magie .test-choix-libelle { color: #b9b0d9; }
.ff-magie .test-choix-option { border-color: rgba(var(--ff-voile-rgb), 0.25); }
.ff-magie .test-choix-option:hover { background: rgba(var(--ff-voile-rgb), 0.12); }
.ff-magie .test-choix-chiffre { color: var(--ff-accent); }
.ff-magie .test-choix-option:has(input:checked) { background: linear-gradient(135deg, var(--color-primary), #b27fb8); border-color: transparent; box-shadow: 0 0 18px rgba(215, 166, 221, 0.5); }
.ff-magie .test-choix-option:has(input:checked) .test-choix-chiffre { color: #fff; }
.ff-magie .test-progression, .ff-magie .test-barre-piste { background: rgba(var(--ff-voile-rgb), 0.14); }
.ff-magie .test-progression-jauge, .ff-magie .test-barre-remplissage { background: linear-gradient(90deg, var(--color-lilac), var(--ff-accent), var(--ff-or-clair)); box-shadow: 0 0 12px rgba(247, 214, 150, 0.5); }
.ff-magie .test-score { color: var(--ff-or-clair); }

/* Aura Flow : « Ce que tu y gagnes » */
.ff-magie .vente-coches li { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(var(--ff-voile-rgb), 0.16); color: #fff; }
.ff-magie .vente-coches li::before { content: "\2726"; color: var(--ff-or-clair); text-shadow: 0 0 10px rgba(247, 214, 150, 0.7); }
