/* ==============================================
   Login Page - Premium Design
   ============================================== */

.login-page {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 9999;
}

/* Animated Background */
.login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Floating orbs */
.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.login-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    animation: floatOrb1 20s ease-in-out infinite;
}

.login-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.35) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: floatOrb2 25s ease-in-out infinite;
}

.login-orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
    top: 40%;
    left: 20%;
    animation: floatOrb3 18s ease-in-out infinite;
}

.login-orb-4 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    top: 20%;
    right: 30%;
    animation: floatOrb4 22s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 40px) scale(1.1); }
    66% { transform: translate(20px, -20px) scale(0.95); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -30px) scale(1.05); }
    66% { transform: translate(-30px, 20px) scale(1.1); }
}

@keyframes floatOrb3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 40px) scale(1.15); }
}

@keyframes floatOrb4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, 30px) scale(1.1); }
}

/* Grid pattern overlay */
.login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.5;
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    padding: 40px 24px;
}

/* Login Card - Glassmorphism */
.login-card {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

/* Logo */
.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 50%, #EC4899 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow:
        0 10px 40px rgba(59, 130, 246, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 10px 40px rgba(59, 130, 246, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) inset; }
    50% { box-shadow: 0 15px 50px rgba(139, 92, 246, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.3) inset; }
}

.login-logo-icon svg {
    width: 40px;
    height: 40px;
}

.login-logo-text {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.login-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.login-divider span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-field label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.3px;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrapper > svg {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
    transition: stroke 0.2s ease;
}

.login-input-wrapper input {
    width: 100%;
    padding: 16px 50px 16px 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 15px;
    color: #fff;
    transition: all 0.3s ease;
}

.login-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-input-wrapper input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.login-input-wrapper input:focus + svg,
.login-input-wrapper:focus-within > svg:first-of-type {
    stroke: #3B82F6;
}

/* Password Toggle */
.login-password-toggle {
    position: absolute;
    right: 12px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.login-password-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.login-password-toggle svg {
    width: 20px;
    height: 20px;
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 2;
    fill: none;
    transition: stroke 0.2s ease;
}

.login-password-toggle:hover svg {
    stroke: rgba(255, 255, 255, 0.7);
}

.login-password-toggle .eye-closed {
    display: none;
}

.login-password-toggle.visible .eye-open {
    display: none;
}

.login-password-toggle.visible .eye-closed {
    display: block;
}

/* Error Message */
.login-error {
    font-size: 14px;
    color: #f87171;
    text-align: center;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    display: none;
}

.login-error.visible {
    display: block;
    animation: loginErrorShake 0.4s ease;
}

@keyframes loginErrorShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Submit Button */
.login-btn {
    position: relative;
    width: 100%;
    padding: 16px 24px;
    margin-top: 8px;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

.login-btn:hover::before {
    opacity: 1;
}

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

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

.login-btn-text {
    position: relative;
    z-index: 1;
}

.login-btn-loader {
    display: none;
}

.login-btn-loader svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.login-btn.loading .login-btn-text {
    opacity: 0;
}

.login-btn.loading .login-btn-loader {
    display: flex;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Footer */
.login-footer {
    margin-top: 32px;
    text-align: center;
}

.login-footer p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.login-footer-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

.login-footer-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.login-footer-feature svg {
    width: 14px;
    height: 14px;
    stroke: #10B981;
    stroke-width: 2;
    fill: none;
}

/* Light Mode */
[data-theme="light"] .login-page {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 50%, #f0f4ff 100%);
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .login-logo-text {
    background: linear-gradient(135deg, #1e293b 0%, #3B82F6 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .login-title {
    color: #1e293b;
}

[data-theme="light"] .login-subtitle {
    color: #64748b;
}

[data-theme="light"] .login-field label {
    color: #475569;
}

[data-theme="light"] .login-input-wrapper input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

[data-theme="light"] .login-input-wrapper input::placeholder {
    color: #94a3b8;
}

[data-theme="light"] .login-input-wrapper > svg {
    stroke: #94a3b8;
}

[data-theme="light"] .login-password-toggle svg {
    stroke: #94a3b8;
}

[data-theme="light"] .login-footer p {
    color: #64748b;
}

[data-theme="light"] .login-orb-1 {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
}

[data-theme="light"] .login-orb-2 {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
}

[data-theme="light"] .login-orb-3 {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
}

[data-theme="light"] .login-grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 24px 16px;
    }

    .login-card {
        padding: 36px 24px;
        border-radius: 20px;
    }

    .login-logo-icon {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .login-logo-icon svg {
        width: 32px;
        height: 32px;
    }

    .login-logo-text {
        font-size: 26px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-footer-features {
        flex-direction: column;
        gap: 8px;
    }
}
