/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* === Boot Screen === */
#boot-screen {
    position: fixed;
    inset: 0;
    background: #050510;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease;
}

#boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.boot-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.boot-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(108, 92, 231, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.boot-text {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 6px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* === Lock Screen === */
#lock-screen {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 16, 0.4);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#lock-screen.hidden {
    display: none;
}

#lock-screen.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.lock-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.lock-time {
    font-size: 84px;
    font-weight: 200;
    letter-spacing: -1px;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lock-date {
    font-size: 20px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-top: -10px;
    margin-bottom: 60px;
}

.lock-login-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px;
    border-radius: 24px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    pointer-events: none;
}

#lock-screen.show-login .lock-login-box {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#lock-screen.show-login .lock-time,
#lock-screen.show-login .lock-date {
    transform: translateY(-20px);
    opacity: 0.7;
    transition: all 0.5s ease;
}

#lock-screen.show-login .lock-hint {
    display: none;
}

.lock-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lock-avatar span {
    font-size: 64px;
    color: white;
}

.lock-username {
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.lock-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 6px 6px 6px 16px;
    width: 100%;
    transition: border-color 0.3s;
}

.lock-input-group:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.15);
}

#lock-password, #lock-recovery-key {
    background: transparent;
    border: none;
    color: white;
    font-size: 15px;
    outline: none;
    flex: 1;
    width: 100%;
}

#lock-password::placeholder, #lock-recovery-key::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#lock-unlock-btn, #lock-recovery-btn {
    background: var(--accent);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

#lock-unlock-btn:hover, #lock-recovery-btn:hover {
    transform: scale(1.05);
    background: var(--accent-glow);
}

#lock-unlock-btn span, #lock-recovery-btn span {
    font-size: 18px;
}

.lock-hint {
    margin-top: 40px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    animation: pulse-hint 2s ease infinite;
}

/* === Advanced Lock Screen UI === */
.lock-users-list {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    justify-content: center;
}

.lock-user-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lock-user-item.active {
    opacity: 1;
    transform: scale(1.1);
}

.lock-user-item .lock-avatar {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lock-user-item .lock-avatar span {
    font-size: 48px;
    color: white;
}

.lock-user-item span {
    font-size: 14px;
    color: white;
    font-weight: 500;
}

.lock-extra-actions {
    margin-top: 16px;
    display: flex;
    gap: 16px;
}

.lock-link {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.2s;
}

.lock-link:hover {
    color: white;
    text-decoration: underline;
}

.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes pulse-hint {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}