/* Login Page Styles - Premium & Creative */

/* -----------------------------------------------------------------------------
   1. Layout & Background
   ----------------------------------------------------------------------------- */
main {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg) var(--spacing-md);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
}

/* Animated Background Elements */
main::before,
main::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
}

main::before {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: -100px;
    left: -100px;
    animation: float 10s ease-in-out infinite;
}

main::after {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    bottom: -50px;
    right: -50px;
    animation: float 12s ease-in-out infinite reverse;
}

/* Neural Network Canvas */
#neural-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* -----------------------------------------------------------------------------
   2. Login Container
   ----------------------------------------------------------------------------- */
.login-container {
    width: 100%;
    max-width: 900px;
    /* Wider for split layout */
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.login-box {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    width: 100%;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 768px) {
    .login-box {
        grid-template-columns: 2fr 3fr;
        /* Split layout: 40% left, 60% right */
    }
}

/* -----------------------------------------------------------------------------
   3. Split Sections
   ----------------------------------------------------------------------------- */
.login-welcome-side {
    background: var(--gradient-primary);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Decorative circles for left side */
.login-welcome-side::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.login-welcome-side::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.login-welcome-content {
    position: relative;
    z-index: 2;
}

.login-welcome-side h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    color: white;
}

.login-welcome-side p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.login-form-side {
    padding: var(--spacing-xl);
    background: rgba(255, 255, 255, 0.4);
    /* Lighter background for form area */
}

[data-theme="dark"] .login-form-side {
    background: rgba(15, 23, 42, 0.4);
}

/* -----------------------------------------------------------------------------
   4. Form Styles
   ----------------------------------------------------------------------------- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-alpha);
    outline: none;
}

/* Password Toggle */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.25rem;
}

.password-toggle:hover {
    color: var(--accent-primary);
}

/* -----------------------------------------------------------------------------
   5. Footer Actions
   ----------------------------------------------------------------------------- */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-top: var(--spacing-xs);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
}

.remember-me input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent-primary);
}

.forgot-password {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   6. Buttons & Links
   ----------------------------------------------------------------------------- */
.login-button {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: var(--spacing-sm);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

/* Bottom Register Section */
.register-section {
    text-align: center;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s backwards;
}

.register-text {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.register-link {
    color: var(--accent-primary);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
    position: relative;
    display: inline-block;
}

.register-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.register-link:hover::after {
    width: 100%;
}

/* Remove old styles */
.login-header,
.login-divider,
.register-link a {
    display: none;
    /* Hide old elements if they persist in HTML temporarily */
}

/* -----------------------------------------------------------------------------
   7. Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .login-box {
        padding: var(--spacing-lg);
    }

    .form-footer {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }
}