/* Shared animated background for landing / login / register */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-bg__aurora {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, #6366f1 0%, #4f46e5 28%, #2563eb 62%, #1d4ed8 100%);
    animation: auth-bg-shift 14s ease-in-out infinite alternate;
}

.auth-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
}

.auth-bg__orb--a {
    width: 42vw;
    height: 42vw;
    max-width: 520px;
    max-height: 520px;
    top: -12%;
    left: -8%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.7), transparent 68%);
    animation: auth-bg-drift 16s ease-in-out infinite;
}

.auth-bg__orb--b {
    width: 36vw;
    height: 36vw;
    max-width: 460px;
    max-height: 460px;
    right: -6%;
    bottom: -10%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.55), transparent 68%);
    animation: auth-bg-drift 18s ease-in-out infinite reverse;
}

.auth-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
    opacity: 0.5;
}

.auth-bg__lines {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.auth-bg__lines-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
}

.auth-bg__draw {
    stroke-dasharray: 12 18;
    animation: auth-bg-line-flow 18s linear infinite;
}

.auth-bg__draw--1 { animation-duration: 16s; opacity: 0.85; }
.auth-bg__draw--2 { animation-duration: 22s; animation-delay: -4s; opacity: 0.7; }
.auth-bg__draw--3 { animation-duration: 19s; animation-delay: -8s; opacity: 0.75; }
.auth-bg__draw--4 { animation-duration: 24s; animation-delay: -2s; opacity: 0.55; }
.auth-bg__draw--5 { animation-duration: 20s; animation-delay: -6s; opacity: 0.6; }
.auth-bg__draw--6 { animation-duration: 26s; animation-delay: -10s; opacity: 0.55; }
.auth-bg__draw--7 { animation-duration: 17s; animation-delay: -3s; opacity: 0.8; }
.auth-bg__draw--8 { animation-duration: 21s; animation-delay: -7s; opacity: 0.65; }

.auth-bg__node {
    animation: auth-bg-node-pulse 3.2s ease-in-out infinite;
}

.auth-bg__node--1 { animation-delay: 0s; }
.auth-bg__node--2 { animation-delay: 0.3s; }
.auth-bg__node--3 { animation-delay: 0.6s; }
.auth-bg__node--4 { animation-delay: 0.9s; }
.auth-bg__node--5 { animation-delay: 1.2s; }
.auth-bg__node--6 { animation-delay: 1.5s; }
.auth-bg__node--7 { animation-delay: 0.2s; }
.auth-bg__node--8 { animation-delay: 0.8s; }
.auth-bg__node--9 { animation-delay: 1.1s; }
.auth-bg__node--10 { animation-delay: 1.4s; }
.auth-bg__node--11 { animation-delay: 0.5s; }
.auth-bg__node--12 { animation-delay: 1.7s; }

.auth-bg__beam {
    position: absolute;
    height: 1px;
    width: 140%;
    left: -20%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(255, 255, 255, 0.05) 80%,
        transparent 100%
    );
    opacity: 0.45;
}

.auth-bg__beam--1 {
    top: 18%;
    --beam-rot: -18deg;
    transform: rotate(var(--beam-rot));
    animation: auth-bg-beam-sweep 9s ease-in-out infinite;
}

.auth-bg__beam--2 {
    top: 42%;
    --beam-rot: 12deg;
    transform: rotate(var(--beam-rot));
    animation: auth-bg-beam-sweep 11s ease-in-out infinite reverse;
    animation-delay: -2s;
}

.auth-bg__beam--3 {
    top: 68%;
    --beam-rot: -8deg;
    transform: rotate(var(--beam-rot));
    animation: auth-bg-beam-sweep 13s ease-in-out infinite;
    animation-delay: -5s;
}

.auth-bg__beam--4 {
    top: 28%;
    width: 90%;
    left: 5%;
    --beam-rot: 28deg;
    transform: rotate(var(--beam-rot));
    opacity: 0.28;
    animation: auth-bg-beam-sweep 15s ease-in-out infinite reverse;
    animation-delay: -1s;
}

.auth-bg__beam--5 {
    top: 78%;
    width: 100%;
    left: 0;
    --beam-rot: 22deg;
    transform: rotate(var(--beam-rot));
    opacity: 0.3;
    animation: auth-bg-beam-sweep 10s ease-in-out infinite;
    animation-delay: -4s;
}

/* Powered by Atech — animated */
.auth-powered {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 8px 20px 28px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    animation: auth-powered-in 0.9s ease 0.4s both;
}

.auth-powered__label {
    margin-right: 6px;
    opacity: 0.85;
}

.auth-powered__link {
    position: relative;
    display: inline-block;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
    animation: auth-powered-pulse 2.8s ease-in-out infinite;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.auth-powered__link:hover {
    border-bottom-color: #fff;
    transform: translateY(-1px);
    animation-play-state: paused;
}

.auth-powered__shine {
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    animation: auth-powered-shine 3.2s ease-in-out infinite;
    pointer-events: none;
}

.auth-powered--on-light {
    color: #6b7280;
}

.auth-powered--on-light .auth-powered__link {
    color: #6d28d9;
    border-bottom-color: rgba(109, 40, 217, 0.35);
    animation: auth-powered-pulse-dark 2.8s ease-in-out infinite;
}

.auth-powered--on-light .auth-powered__link:hover {
    border-bottom-color: #6d28d9;
}

.auth-powered--on-light .auth-powered__shine {
    background: linear-gradient(90deg, transparent, rgba(109, 40, 217, 0.35), transparent);
}

@keyframes auth-bg-shift {
    from { filter: hue-rotate(0deg) saturate(1); }
    to { filter: hue-rotate(12deg) saturate(1.08); }
}

@keyframes auth-bg-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(4%, -6%) scale(1.08); }
}

@keyframes auth-bg-line-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -240; }
}

@keyframes auth-bg-node-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes auth-bg-beam-sweep {
    0%, 100% {
        opacity: 0.12;
        transform: translateX(-8%) rotate(var(--beam-rot, 0deg));
    }
    50% {
        opacity: 0.55;
        transform: translateX(8%) rotate(var(--beam-rot, 0deg));
    }
}

@keyframes auth-powered-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-powered-pulse {
    0%, 100% { text-shadow: 0 0 0 rgba(255, 255, 255, 0); }
    50% { text-shadow: 0 0 16px rgba(255, 255, 255, 0.55); }
}

@keyframes auth-powered-pulse-dark {
    0%, 100% { text-shadow: 0 0 0 rgba(109, 40, 217, 0); }
    50% { text-shadow: 0 0 12px rgba(109, 40, 217, 0.35); }
}

@keyframes auth-powered-shine {
    0%, 40% { left: -120%; }
    70%, 100% { left: 140%; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-bg__aurora,
    .auth-bg__orb,
    .auth-bg__draw,
    .auth-bg__node,
    .auth-bg__beam,
    .auth-powered,
    .auth-powered__link,
    .auth-powered__shine {
        animation: none !important;
    }
}
