/* ============================================================
   AUTH BACKGROUND — ambient motion for the credential screens
   ============================================================
   Pure CSS. No JS, no external assets, no network calls.

   - Fixed layer behind .auth-page (z-index 0 vs 1)
   - Only transform is animated (compositor-friendly)
   - Orbs are accent-driven so they follow the active theme
   - prefers-reduced-motion removes all motion
   ============================================================ */

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* The credential pages paint their own opaque body color here.
   Transparent lets the fixed layer show through; body keeps the base color. */
.auth-page {
    position: relative;
    z-index: 1;
    background: transparent !important;
}

.auth-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(64px);
    opacity: .55;
    will-change: transform;
}

.auth-bg-orb--1 {
    width: 44vmax;
    height: 44vmax;
    top: -14vmax;
    left: -12vmax;
    background: radial-gradient(circle at 35% 35%,
        rgba(var(--accent-color-rgb), 0.55) 0%,
        rgba(var(--accent-color-rgb), 0.20) 45%,
        transparent 70%);
    animation: auth-drift-1 26s ease-in-out infinite alternate;
}

.auth-bg-orb--2 {
    width: 36vmax;
    height: 36vmax;
    top: 6vmax;
    right: -14vmax;
    background: radial-gradient(circle at 50% 50%,
        rgba(14, 165, 233, 0.40) 0%,
        rgba(14, 165, 233, 0.14) 48%,
        transparent 72%);
    animation: auth-drift-2 32s ease-in-out infinite alternate;
}

.auth-bg-orb--3 {
    width: 40vmax;
    height: 40vmax;
    bottom: -18vmax;
    left: 22%;
    background: radial-gradient(circle at 50% 50%,
        rgba(139, 92, 246, 0.34) 0%,
        rgba(139, 92, 246, 0.12) 46%,
        transparent 70%);
    animation: auth-drift-3 38s ease-in-out infinite alternate;
}

.auth-bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(100, 116, 139, 0.22) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 25%, transparent 75%);
    opacity: .45;
}

[data-theme="dark"] .auth-bg-orb { opacity: .42; }
[data-theme="dark"] .auth-bg-grid {
    background-image: radial-gradient(rgba(148, 163, 184, 0.16) 1px, transparent 1px);
    opacity: .55;
}

@keyframes auth-drift-1 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(7vmax, 5vmax, 0) scale(1.08); }
}

@keyframes auth-drift-2 {
    from { transform: translate3d(0, 0, 0) scale(1.05); }
    to   { transform: translate3d(-6vmax, 7vmax, 0) scale(0.95); }
}

@keyframes auth-drift-3 {
    from { transform: translate3d(0, 0, 0) scale(0.98); }
    to   { transform: translate3d(5vmax, -6vmax, 0) scale(1.10); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-bg-orb { animation: none; }
}

@media (max-width: 576px) {
    .auth-bg-orb { filter: blur(48px); }
    .auth-bg-grid { opacity: .30; }
}
