/* Fundo tecnológico — cores seguem o tema do tenant */
.global-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -5;
    pointer-events: none;
    background:
        radial-gradient(ellipse 90% 70% at 12% 18%, rgba(var(--tema-sec-rgb, 43, 92, 146), 0.22), transparent 52%),
        radial-gradient(ellipse 70% 55% at 88% 78%, rgba(var(--tema-rgb, 11, 28, 53), 0.28), transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(var(--tema-sec-rgb, 43, 92, 146), 0.12), transparent 55%),
        linear-gradient(180deg, color-mix(in srgb, rgb(var(--tema-rgb, 11, 28, 53)) 92%, #000) 0%, color-mix(in srgb, rgb(var(--tema-rgb, 11, 28, 53)) 78%, #000) 48%, #03070f 100%);
}

#telaLogin .global-bg {
    position: absolute;
    z-index: 1;
}

.circuit-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -4;
    overflow: hidden;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-opacity='0.18' stroke-width='1' d='M12 40h48v32h40M100 72h52v-28h36M12 140h28v48h56M148 160h40v32h28M40 200h80'/%3E%3Ccircle cx='60' cy='40' r='3' fill='%23ffffff' fill-opacity='0.35'/%3E%3Ccircle cx='188' cy='44' r='3' fill='%23ffffff' fill-opacity='0.28'/%3E%3Ccircle cx='96' cy='188' r='3' fill='%23ffffff' fill-opacity='0.32'/%3E%3Crect x='96' y='68' width='8' height='8' fill='none' stroke='%23ffffff' stroke-opacity='0.28'/%3E%3Crect x='148' y='156' width='8' height='8' fill='none' stroke='%23ffffff' stroke-opacity='0.24'/%3E%3C/svg%3E"),
        linear-gradient(rgba(var(--tema-sec-rgb, 43, 92, 146), 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--tema-sec-rgb, 43, 92, 146), 0.05) 1px, transparent 1px);
    background-size: 240px 240px, 48px 48px, 48px 48px;
    animation: eqCircuitDrift 48s linear infinite;
}

#telaLogin .circuit-overlay {
    position: absolute;
    z-index: 2;
}

.circuit-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(var(--tema-sec-rgb, 43, 92, 146), 0.04) 46%,
        rgba(var(--tema-sec-rgb, 43, 92, 146), 0.14) 50%,
        rgba(var(--tema-sec-rgb, 43, 92, 146), 0.04) 54%,
        transparent 100%
    );
    background-size: 100% 220%;
    animation: eqScanSweep 7.5s ease-in-out infinite;
}

.circuit-overlay::after {
    content: "";
    position: absolute;
    inset: -20%;
    background-image:
        radial-gradient(circle at 18% 22%, rgba(var(--tema-sec-rgb, 43, 92, 146), 0.55) 0 2px, transparent 3px),
        radial-gradient(circle at 72% 18%, rgba(var(--tema-sec-rgb, 43, 92, 146), 0.4) 0 2px, transparent 3px),
        radial-gradient(circle at 84% 64%, rgba(var(--tema-sec-rgb, 43, 92, 146), 0.5) 0 2px, transparent 3px),
        radial-gradient(circle at 28% 78%, rgba(var(--tema-rgb, 11, 28, 53), 0.4) 0 2px, transparent 3px),
        radial-gradient(circle at 52% 46%, rgba(var(--tema-sec-rgb, 43, 92, 146), 0.35) 0 2px, transparent 3px);
    animation: eqNodesPulse 3.2s ease-in-out infinite;
}

.tech-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -3;
    background:
        radial-gradient(ellipse at center, transparent 28%, rgba(2, 6, 13, 0.55) 100%),
        linear-gradient(90deg, rgba(2, 8, 18, 0.35), transparent 18%, transparent 82%, rgba(2, 8, 18, 0.35));
}

#telaLogin .tech-vignette {
    position: absolute;
    z-index: 3;
}

@keyframes eqCircuitDrift {
    from { background-position: 0 0, 0 0, 0 0; }
    to { background-position: 240px 240px, 48px 48px, 48px 48px; }
}

@keyframes eqScanSweep {
    0% { background-position: 0 -80%; }
    100% { background-position: 0 180%; }
}

@keyframes eqNodesPulse {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
    .circuit-overlay,
    .circuit-overlay::before,
    .circuit-overlay::after {
        animation: none;
    }
}
