/* Login Screen */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.login-screen.visible {
    opacity: 1;
}

.login-screen.hiding {
    opacity: 0;
    pointer-events: none;
}

/* Animated background blobs */
.login-screen::before,
.login-screen::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: loginBlobFloat 8s ease-in-out infinite alternate;
}

.login-screen::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #a78bfa, #60a5fa);
    top: -100px;
    left: -100px;
}

.login-screen::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #f472b6, #fb923c);
    bottom: -80px;
    right: -80px;
    animation-delay: -4s;
}

@keyframes loginBlobFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, 20px) scale(1.1); }
}

/* Container */
.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 40px 48px 32px;
    min-width: 320px;
    max-width: 380px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.15) inset;
    animation: loginContainerIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes loginContainerIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Clock */
.login-clock {
    text-align: center;
    color: #fff;
    user-select: none;
}

.login-time {
    font-size: 52px;
    font-weight: 200;
    letter-spacing: -1px;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.login-date {
    font-size: 13px;
    font-weight: 400;
    margin-top: 4px;
    opacity: 0.8;
    text-transform: capitalize;
}

/* Avatar */
.login-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.login-avatar:hover {
    transform: scale(1.05);
}

/* Display name below avatar */
.login-display-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.2px;
    margin-top: -16px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
    user-select: none;
}

[data-theme="light"] .login-display-name {
    color: #1e293b;
}

/* Form */
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form input {
    width: 100%;
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.login-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.login-form input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.login-form input.error {
    border-color: rgba(248, 113, 113, 0.7);
    background: rgba(248, 113, 113, 0.1);
    animation: loginShake 0.35s ease;
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* Submit button */
#login-submit {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.3px;
}

#login-submit:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#login-submit:active {
    transform: scale(0.97);
}

#login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#login-submit.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpinner 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes loginSpinner {
    to { transform: rotate(360deg); }
}

/* Error message */
.login-error {
    padding: 8px 12px;
    background: rgba(248, 113, 113, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.4);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 13px;
    text-align: center;
    animation: loginFadeIn 0.2s ease;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Footer info */
.login-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
    user-select: none;
}

/* Light theme adjustments */
[data-theme="light"] .login-screen {
    background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
}

[data-theme="light"] .login-container {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

[data-theme="light"] .login-clock,
[data-theme="light"] .login-form input,
[data-theme="light"] #login-submit {
    color: #1e293b;
}

[data-theme="light"] .login-form input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .login-form input::placeholder {
    color: rgba(30, 41, 59, 0.45);
}

[data-theme="light"] .login-form input:focus {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

[data-theme="light"] #login-submit {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] #login-submit:hover {
    background: rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .login-info {
    color: rgba(30, 41, 59, 0.4);
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px 24px;
        min-width: 0;
        margin: 0 16px;
    }

    .login-time {
        font-size: 42px;
    }
}
