:root {
    --primary-gradient: linear-gradient(135deg, #4a90a4 0%, #2c5364 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    --border-radius-xl: 1.5rem;
    --border-radius-2xl: 2rem;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 25%, #2c5364 50%, #4a90a4 75%, #5f9aa8 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding-bottom: 80px; /* Space for fixed footer */
}

/* Fullscreen canvas container for interactive background */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Above decorative ::before/::after (z-index:0), below content */
    pointer-events: none; /* keep UI interactive */
    background: #000; /* deep space black */
}

#canvas-container canvas {
    display: block; /* remove gaps */
}

/* Vignette overlay above galaxy, below UI */
.vignette-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,0.35) 100%);
}

.spotlight-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background: radial-gradient(
        circle at var(--mx, 50%) var(--my, 50%),
        rgba(108, 99, 255, 0.22) 0%,
        rgba(108, 99, 255, 0.15) 14%,
        rgba(108, 99, 255, 0.08) 25%,
        transparent 42%
    );
}

/* Floating Background Elements */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(74, 144, 164, 0.5) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(95, 154, 168, 0.5) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(44, 83, 100, 0.5) 0%, transparent 50%);
    animation: float 25s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--border-radius-2xl);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        var(--shadow-2xl);
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    animation: cardEntrance 1s ease-out 0.3s forwards;
    width: 100%;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius-2xl) var(--border-radius-2xl) 0 0;
}

.login-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 4s ease-in-out infinite;
}

/* removed container-limited spotlight in favor of full-viewport .spotlight-overlay */

.brand-section {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
    position: relative;
    z-index: 1;
}

.brand-logo {
    width: 140px;
    height: 140px;
    border-radius: 24px;
    object-fit: contain;
    margin-bottom: 1.25rem;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
}

.brand-logo:hover {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 0 4px rgba(255, 255, 255, 0.2);
}

.brand-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.3);
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.form-group {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out both;
    position: relative;
    z-index: 1;
}

.form-group:nth-child(1) { animation-delay: 0.8s; }
.form-group:nth-child(2) { animation-delay: 0.9s; }
.form-group:nth-child(3) { animation-delay: 1.0s; }

.form-label {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: block;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.2px;
}

.form-control {
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    color: white;
    padding: 1.1rem 1.35rem;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 0 0 4px rgba(255, 255, 255, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.2);
    color: white;
    outline: none;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1.25rem;
    top: 3.4rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1.15rem;
    z-index: 2;
}

.password-toggle:hover {
    color: white;
    transform: scale(1.15);
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 1.1s both;
    position: relative;
    z-index: 1;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.remember-me:hover {
    background: rgba(255, 255, 255, 0.05);
}

.form-check-input {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 0;
}

.form-check-input:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
}

.form-check-input:checked {
    background: var(--primary-gradient);
    border-color: transparent;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.form-check-label {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    margin-left: 0.75rem;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}

.login-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 1.15rem 2rem;
    width: 100%;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    animation: fadeInUp 0.8s ease-out 1.2s both;
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.5),
        0 0 0 0 rgba(102, 126, 234, 0.4);
    letter-spacing: 0.3px;
    z-index: 1;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 45px rgba(102, 126, 234, 0.6),
        0 0 0 0 rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(-1px);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Fixed Footer */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    z-index: 1000;
    animation: fadeInUp 0.8s ease-out 1.4s both;
}

.fixed-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition-smooth);
    font-weight: 500;
}

.fixed-footer a:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.validation-error {
    color: #ff6b6b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    display: block;
}

.alert {
    border-radius: 12px;
    border: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fee2e2;
}

/* Animations */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-40px) rotate(2deg); }
    66% { transform: translateY(-20px) rotate(-2deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 0.6; }
}

@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 576px) {
    body {
        padding-bottom: 70px;
    }

    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 1.5rem;
    }
    
    .brand-title {
        font-size: 1.75rem;
    }
    
    .brand-logo {
        width: 110px;
        height: 110px;
    }

    .brand-subtitle {
        font-size: 0.9rem;
    }

    .form-control {
        padding: 1rem 1.2rem;
    }

    .login-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .login-card {
        padding: 1.75rem 1.25rem;
    }
    
    .form-control {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .brand-title {
        font-size: 1.5rem;
    }
}

@media (max-height: 700px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .brand-section {
        margin-bottom: 1.5rem;
    }

    .brand-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 0.75rem;
    }
}




