/* Windows 11 Login Screen Style */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Windows 11 Bloom Dark/Light Wallpaper Placeholder - CSS Gradient Fallback */
    background-color: #000;
    background: radial-gradient(circle at 50% 50%, #1a1b2e 0%, #000000 100%);
    background-image: 
        radial-gradient(circle at 80% 20%, rgba(68, 98, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(138, 43, 226, 0.15) 0%, transparent 40%),
        url('https://4kwallpapers.com/images/wallpapers/windows-11-blue-stock-official-3840x2160-5630.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

#login-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 0; /* Centered vertically */
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards 0.2s;
}

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

.user-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #444;
    background-image: url('../assets/imgs/program_icon.png');
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin: 0 auto 10px auto;
    transition: background-image 0.3s ease-in-out;
}

.user-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    min-height: 38px; /* Prevent layout jump */
}

.login-form, .register-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 300px;
}

.input-group {
    position: relative;
    width: 100%;
}

.password-input {
    width: 100%;
    padding: 10px 15px;
    padding-right: 40px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.password-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.password-input:focus {
    background: rgba(255, 255, 255, 1);
    color: black;
    border-color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.password-input:focus::placeholder {
    color: #666;
}

.submit-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.submit-btn:hover {
    opacity: 1;
}

.submit-btn.register-arrow {
    color: #8aff8a; /* Green for register */
}

.arrow-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.2s;
}

.submit-btn:active .arrow-icon {
    transform: scale(0.9);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    display: none; /* Hidden by default */
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.submit-btn.loading .arrow-icon {
    display: none;
}

.submit-btn.loading .loading-spinner {
    display: block;
}

/* Caps Lock Indicator */
.caps-lock-indicator {
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffc107; /* Warning yellow */
    font-weight: bold;
    font-size: 16px;
    display: none; /* Hidden by default */
    cursor: help;
}

.caps-lock-indicator::after {
    content: 'Caps Lock is ON';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.caps-lock-indicator:hover::after {
    opacity: 1;
}

.login-message {
    height: 20px;
    font-size: 13px;
    color: #ff6b6b;
    margin-top: 5px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.login-reset {
    margin-top: 4px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.login-reset:hover {
    color: #ffffff;
}

.toggle-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.toggle-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Clock and Date (Lock Screen style - visible before clicking?) 
   For now we just keep it simple as a login prompt 
*/
.lock-screen-clock {
    position: absolute;
    top: 100px;
    text-align: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.clock-time { font-size: 96px; font-weight: 500; line-height: 1; }
.clock-date { font-size: 28px; font-weight: 400; margin-top: 10px; }

/* Hide other UI elements initially (only when NOT logged in) */
body:not(.logged-in) #mdc-window,
body:not(.logged-in) .taskbar,
body:not(.logged-in) .desktop-icons-container {
    display: none !important;
}
