/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Neo Sans', 'Helvetica Neue', Arial, sans-serif;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Animated Starfield */
body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

body::before {
    background-image:
        radial-gradient(1px 1px at 20px 30px, white, transparent),
        radial-gradient(1px 1px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(1px 1px at 90px 10px, white, transparent),
        radial-gradient(1px 1px at 160px 120px, white, transparent);
    background-size: 200px 200px;
    background-repeat: repeat;
    opacity: 0.6;
    animation: starMove1 120s linear infinite;
}

body::after {
    background-image:
        radial-gradient(2px 2px at 100px 50px, rgba(76, 201, 240, 0.8), transparent),
        radial-gradient(2px 2px at 150px 120px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 75px 180px, rgba(76, 201, 240, 0.6), transparent);
    background-size: 250px 250px;
    background-repeat: repeat;
    opacity: 0.4;
    animation: starMove2 180s linear infinite;
}

/* Layer 3: Larger glowing stars */
.stars-layer3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image: 
        radial-gradient(circle, rgba(76, 201, 240, 0.4) 0%, transparent 2px),
        radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 2px),
        radial-gradient(circle, rgba(72, 149, 239, 0.4) 0%, transparent 2px);
    background-size: 400px 400px, 350px 350px, 450px 450px;
    background-position: 0 0, 100px 100px, 200px 50px;
    background-repeat: repeat;
    opacity: 0.3;
    animation: starMove3 240s linear infinite, twinkleSlow 5s ease-in-out infinite;
}

/* Shooting Stars */
.shooting-star {
    position: fixed;
    width: 10px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 10px 2px rgba(255, 255, 255, 0.8),
        0 0 20px 4px rgba(76, 201, 240, 0.6);
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

.shooting-star:nth-child(2) {
    top: 20%;
    animation: shootingStar 4s ease-out infinite 2s;
}

.shooting-star:nth-child(3) {
    top: 40%;
    animation: shootingStar 3.5s ease-out infinite 5s;
}

.shooting-star:nth-child(4) {
    top: 60%;
    animation: shootingStar 4.2s ease-out infinite 8s;
}

.shooting-star:nth-child(5) {
    top: 80%;
    animation: shootingStar 3.8s ease-out infinite 11s;
}

.shooting-star:nth-child(6) {
    top: 30%;
    animation: shootingStar 4.5s ease-out infinite 14s;
}

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: translateX(-100px) translateY(0) rotate(-45deg);
    }
    5% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(1000px) translateY(500px) rotate(-45deg);
    }
}

@keyframes starMove1 {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-200px) translateX(-200px); }
}

@keyframes starMove2 {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(250px) translateX(-250px); }
}

@keyframes starMove3 {
    0% { transform: translateY(0) translateX(0) rotate(0deg); }
    100% { transform: translateY(-400px) translateX(400px) rotate(360deg); }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
}

/* Login Card */
.login-card {
    background: rgba(15, 20, 35, 0);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    margin-bottom: 15px;
}

.logo img {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    font-size: 2rem;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(76, 201, 240, 0.5);
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: rgba(30, 40, 60, 0.6);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-tab:hover {
    background: rgba(30, 40, 60, 0.8);
    border-color: rgba(76, 201, 240, 0.5);
    color: white;
}

.auth-tab.active {
    background: linear-gradient(135deg, #4cc9f0 0%, #4895ef 100%);
    border-color: #4cc9f0;
    color: white;
    box-shadow: 0 5px 15px rgba(76, 201, 240, 0.3);
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(30, 40, 60, 0.6);
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus {
    outline: none;
    border-color: #4cc9f0;
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.2);
    background: rgba(30, 40, 60, 0.8);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* Password Input */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    padding: 5px;
}

.toggle-password:hover {
    color: #4cc9f0;
}

/* Buttons */
.btn-login,
.btn-register {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4cc9f0 0%, #4895ef 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.btn-login:hover,
.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 201, 240, 0.5);
}

.btn-login:active,
.btn-register:active {
    transform: translateY(0);
}

.btn-google {
    width: 100%;
    padding: 14px;
    background: white;
    color: #333;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.btn-google i {
    color: #4285f4;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: rgba(255, 255, 255, 0.5);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.divider span {
    padding: 0 15px;
    font-size: 0.9rem;
}

/* Forgot Password */
.forgot-password {
    text-align: center;
    margin-top: 15px;
}

.forgot-password a {
    color: #4cc9f0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.forgot-password a:hover {
    color: #4895ef;
    text-decoration: underline;
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    color: #4cc9f0;
    margin-bottom: 15px;
}

.loading-spinner p {
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 25px;
    }

    .login-header h1 {
        font-size: 1.6rem;
    }

    .auth-tab {
        font-size: 0.85rem;
        padding: 10px;
    }

    .btn-login,
    .btn-register,
    .btn-google {
        padding: 12px;
        font-size: 0.95rem;
    }
}

/* Username info message */
.username-info {
    background: rgba(76, 201, 240, 0.1);
    border: 1px solid rgba(76, 201, 240, 0.3);
    border-radius: 10px;
    padding: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.username-info i {
    color: #4cc9f0;
    flex-shrink: 0;
}
