.cosmic_background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    animation: nebula_float 20s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

[data-theme="light"] .nebula {
    opacity: 0.08;
}

.nebula.blue {
    background: radial-gradient(circle, var(--auth-accent-primary) 0%, transparent 70%);
    width: 400px;
    height: 400px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.nebula.purple {
    background: radial-gradient(circle, var(--auth-accent-secondary) 0%, transparent 70%);
    width: 300px;
    height: 300px;
    top: 60%;
    right: 15%;
    animation-delay: 7s;
}

.nebula.cyan {
    background: radial-gradient(circle, var(--auth-accent-tertiary) 0%, transparent 70%);
    width: 250px;
    height: 250px;
    top: 10%;
    right: 30%;
    animation-delay: 14s;
}

@keyframes nebula_float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.1); }
    50% { transform: translate(-15px, 20px) scale(0.9); }
    75% { transform: translate(25px, 15px) scale(1.05); }
}

.stars_container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: var(--auth-text-primary);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--auth-text-primary), 0 0 12px var(--auth-text-primary);
    opacity: 0;
    animation: star_move linear infinite;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.star.bright {
    box-shadow: 0 0 10px var(--auth-text-primary), 0 0 20px var(--auth-text-primary), 0 0 30px var(--auth-accent-primary);
}

.star.twinkle {
    animation: star_move linear infinite, twinkle 3s ease-in-out infinite;
}

[data-theme="light"] .star {
    background: #64748b;
    box-shadow: 0 0 6px #64748b, 0 0 12px #64748b;
}

[data-theme="light"] .star.bright {
    box-shadow: 0 0 10px #64748b, 0 0 20px #64748b, 0 0 30px var(--auth-accent-primary);
}

@keyframes star_move {
    0% {
        transform: translateY(100vh);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    95% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-20px);
        opacity: 0;
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.3;
    }
}

@media (max-width: 768px) {
    .theme_toggle {
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}
