/* Fundos animados suaves (compartilhado entre site e painel) */
.fx-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--bg); transition: background .6s ease; }
.fx-bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .22; will-change: transform; }
.fx-bg i:nth-child(1) { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: var(--primary); animation: fxFloat1 26s ease-in-out infinite alternate; }
.fx-bg i:nth-child(2) { width: 36vmax; height: 36vmax; right: -12vmax; top: 18vh; background: var(--secondary); opacity: .13; animation: fxFloat2 32s ease-in-out infinite alternate; }
.fx-bg i:nth-child(3) { width: 30vmax; height: 30vmax; left: 30vw; bottom: -16vmax; background: var(--accent); opacity: .16; animation: fxFloat3 28s ease-in-out infinite alternate; }
.fx-bg b { position: absolute; inset: 0; opacity: .5; }
[data-mode="dark"] .fx-bg i { opacity: .2; }
[data-mode="dark"] .fx-bg i:nth-child(2) { opacity: .12; }

@keyframes fxFloat1 { to { transform: translate(14vw, 10vh) scale(1.12); } }
@keyframes fxFloat2 { to { transform: translate(-12vw, 16vh) scale(.9); } }
@keyframes fxFloat3 { to { transform: translate(-16vw, -12vh) scale(1.15); } }

/* Circuito: linhas finas que deslizam */
[data-anim="circuit"] .fx-bg b {
  background-image:
    linear-gradient(rgba(var(--primary-rgb), .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--primary-rgb), .07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 30% 20%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 20%, #000 10%, transparent 70%);
  animation: fxGrid 20s linear infinite;
}
@keyframes fxGrid { to { background-position: 44px 44px, 44px 44px; } }

/* Faíscas: pontos que sobem devagar */
[data-anim="sparks"] .fx-bg b {
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(var(--accent-rgb), .7), transparent 60%),
    radial-gradient(2px 2px at 70% 80%, rgba(var(--accent-rgb), .55), transparent 60%),
    radial-gradient(1.5px 1.5px at 40% 60%, rgba(var(--primary-rgb), .6), transparent 60%),
    radial-gradient(1.5px 1.5px at 85% 25%, rgba(var(--secondary-rgb), .5), transparent 60%),
    radial-gradient(2px 2px at 55% 15%, rgba(var(--accent-rgb), .5), transparent 60%);
  background-size: 380px 380px;
  animation: fxSparks 30s linear infinite;
}
@keyframes fxSparks { to { background-position: 0 -380px; } }

/* Ondas: faixa diagonal suave */
[data-anim="waves"] .fx-bg b {
  background: repeating-linear-gradient(115deg, transparent 0 60px, rgba(var(--primary-rgb), .035) 60px 120px);
  background-size: 200% 200%;
  animation: fxWaves 24s linear infinite;
}
@keyframes fxWaves { to { background-position: 260px 0; } }

/* Aurora: cortina de cor */
[data-anim="aurora"] .fx-bg b {
  background: linear-gradient(120deg, transparent 20%, rgba(var(--primary-rgb), .12) 40%, rgba(var(--secondary-rgb), .1) 55%, transparent 75%);
  background-size: 300% 300%;
  animation: fxAurora 18s ease-in-out infinite alternate;
}
@keyframes fxAurora { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* Blobs: só as bolhas (b vazio) */
[data-anim="blobs"] .fx-bg i { opacity: .26; }

/* Animações desligadas / acessibilidade */
.no-anim .fx-bg i, .no-anim .fx-bg b { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .fx-bg i, .fx-bg b { animation: none !important; }
}
