/* LOGIN SCREEN STYLES */

.login-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-login);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
}

/* Background with Acrylic Blur */
.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/wallpapers/default.jpg');
    /* Need to ensure this exists or fallback */
    background-size: cover;
    background-position: center;
    filter: blur(25px) brightness(0.85);
    /* Acrylic effect */
    transform: scale(1.1);
    /* Slight zoom to avoid blur edges */
    z-index: -1;
    transition: filter 500ms var(--ease-win), transform 500ms var(--ease-win);
}

/* CSS Gradient Fallback for checks */
.login-background.fallback {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

.login-auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    opacity: 0;
    /* Starts hidden, animates in */
    transform: translateY(20px);
}

.user-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    background-image: url('../assets/icons/user.png');
    /* Fallback needed */
    background-size: cover;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.user-avatar.fallback {
    background-image: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.user-avatar.fallback::after {
    content: "👤";
}

.user-name {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

#password-input {
    width: 240px;
    padding: 10px 12px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

#password-input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: white;
    color: black;
}

#password-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#login-btn {
    position: absolute;
    right: 4px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#login-btn:hover {
    opacity: 1;
}

#password-input:focus~#login-btn {
    color: #333;
    /* Dark icon on white input */
}

.login-message {
    margin-top: 16px;
    font-size: 0.9rem;
    min-height: 20px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* --- BOTTOM CONTROLS --- */

/* User Selection (Bottom Left) */
.login-user-list {
    position: absolute;
    bottom: 32px;
    left: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    transition: background 0.2s;
    color: rgba(255, 255, 255, 0.6);
}

.user-item:hover,
.user-item.selected {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.user-item.selected {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.user-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-item-avatar::after {
    content: "👤";
    font-size: 20px;
}

/* Guest Variant */
.user-item-avatar.guest::after {
    content: "👥";
}

/* System Controls (Bottom Right) */
.login-system-controls {
    position: absolute;
    bottom: 32px;
    right: 32px;
    display: flex;
    gap: 16px;
    align-items: center;
    color: white;
}

.control-item {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    /* For popup */
}

.control-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Power Menu Popup */
.power-menu {
    position: absolute;
    bottom: 110%;
    /* Above button */
    right: 0;
    width: 140px;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
}

.power-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-item {
    padding: 8px 12px;
    font-size: 14px;
    color: white;
    cursor: pointer;
    border-radius: 2px;
    text-align: left;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* LOGIN SUCCESS STATE */

/* Hide irrelevant elements during welcome */
.login-layer.welcome-mode .user-avatar,
.login-layer.welcome-mode .login-input-group,
.login-layer.welcome-mode .login-user-list,
.login-layer.welcome-mode .login-system-controls,
.login-layer.welcome-mode .user-name {
    display: none !important;
}

/* Explicitly hide background to show black body */
.login-layer.welcome-mode .login-background {
    display: none !important;
    background: black !important;
    /* Double safety */
    opacity: 0 !important;
}

/* Transform the message into the main Welcome Text */
.login-layer.welcome-mode .login-message {
    font-size: 4rem;
    /* Even larger as requested "Large" */
    font-weight: 300;
    margin: 0;
    /* Remove margin so it centers purely */
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: welcome-blink 1.5s ease-in-out 2 forwards;
}

@keyframes welcome-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}