:root {
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --input-focus: #2563eb;
}

[data-theme="dark"] {
    --bg-light: #090d16;
    --card-bg: #111827;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: #090d16;
    --input-border: #1f293d;
    --input-focus: #3b82f6;
}

body.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    background-image: 
        radial-gradient(at 15% 15%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 85% 85%, rgba(139, 92, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(14, 165, 233, 0.08) 0px, transparent 50%);
    font-family: var(--font-sans, 'Inter', sans-serif);
    color: var(--text-color);
    position: relative;
    overflow-x: hidden;
}

body.login-page .app-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.login-page .main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}

.login-container {
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 1rem;
    z-index: 10;
    position: relative;
    box-sizing: border-box;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
    animation: loginFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(16px);
    box-sizing: border-box;
    width: 100%;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-wrapper {
    margin-bottom: 12px;
}

.login-logo-img {
    max-width: 140px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.06));
}

.login-title {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    letter-spacing: -0.025em;
    color: var(--text-color);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
    font-weight: 500;
}

.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 0.02em;
}

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

.input-wrapper .icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    outline: none;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

.input-wrapper input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.input-wrapper input:focus + .icon,
.input-wrapper:focus-within .icon {
    color: var(--primary);
}

.forgot-password-link {
    font-size: 0.8125rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

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

.alert {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    background: rgba(225, 29, 72, 0.12);
    border: 1px solid rgba(225, 29, 72, 0.25);
    color: #e11d48;
    display: flex;
    align-items: center;
    gap: 8px;
}

[data-theme="dark"] .alert {
    background: rgba(225, 29, 72, 0.2);
    color: #fecdd3;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Float Animation for Background Decorative Elements */
.bg-decor {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.decor-1 { top: -100px; left: -100px; animation: float 10s infinite; }
.decor-2 { bottom: -100px; right: -100px; animation: float 12s infinite reverse; }

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

/* Google OAuth Styles */
.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 22px 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--input-border);
}

.separator:not(:empty)::before {
    margin-right: 1em;
}

.separator:not(:empty)::after {
    margin-left: 1em;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 13px 20px;
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #1e293b !important;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.google-btn span {
    color: #1e293b !important;
    font-weight: 700;
}

.google-btn img {
    width: 20px;
    height: 20px;
}

.google-btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

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

.toggle-local-wrapper {
    margin-top: 14px;
    text-align: center;
}

.toggle-local-btn {
    background: var(--bg-hover, #f1f5f9);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-full, 9999px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    width: 100%;
}

.toggle-local-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.toggle-local-btn .chevron-icon {
    transition: transform 0.25s ease;
    display: inline-flex;
}

.toggle-local-btn.active .chevron-icon {
    transform: rotate(180deg);
}

.toggle-local-btn.active {
    background: rgba(37, 99, 235, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}

.local-login-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--input-border);
    animation: loginFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-logo {
    max-height: 36px;
    opacity: 0.75;
    margin-bottom: 8px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: opacity 0.2s;
}

[data-theme="dark"] .footer-logo {
    filter: brightness(0) invert(1);
    opacity: 0.65;
}

@media (max-width: 480px) {
    body.login-page .main-content {
        padding: 1rem 0.5rem;
    }
    
    .login-container {
        max-width: 100%;
        padding: 0.5rem;
    }
    
    .login-card {
        padding: 28px 20px;
        border-radius: 20px;
    }
    
    .login-header {
        margin-bottom: 20px;
    }
    
    .login-title {
        font-size: 1.4rem;
    }
    
    .google-btn {
        padding: 11px 14px;
        font-size: 0.9rem;
    }
    
    .toggle-local-btn {
        font-size: 0.78rem;
        padding: 8px 12px;
    }
}
