/* ==========================================================================
   Windows 11 Web Desktop — lock / sign-in screen
   ========================================================================== */

:root {
    --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --accent: #4cc2ff;
    --accent-text: #00243d;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.lock-body {
    margin: 0;
    overflow: hidden;
    font-family: var(--font);
    color: #fff;
    background: #050a16;
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

button,
input {
    font: inherit;
    color: inherit;
}

button {
    cursor: default;
}

button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    pointer-events: none;
}

.lock-screen {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

.lock-wallpaper {
    position: absolute;
    inset: -2%;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.02);
    filter: brightness(0.92) saturate(1.05);
    animation: lockZoom 24s ease-out forwards;
}

@keyframes lockZoom {
    from {
        transform: scale(1.06);
    }
    to {
        transform: scale(1.02);
    }
}

.lock-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 90% at 20% 15%, rgba(0, 0, 0, 0.12), transparent 50%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.02) 38%, rgba(0, 0, 0, 0.42));
    pointer-events: none;
}

.lock-clock {
    position: absolute;
    left: 56px;
    top: 46px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lock-time {
    font-family: var(--font-display);
    font-size: clamp(64px, 8.2vw, 108px);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -0.035em;
}

.lock-date {
    margin-top: 10px;
    font-size: clamp(17px, 1.8vw, 24px);
    font-weight: 300;
    letter-spacing: 0.005em;
    opacity: 0.94;
}

.lock-date::first-letter {
    text-transform: uppercase;
}

.lock-hint {
    position: absolute;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 18px;
    border-radius: 20px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.86);
    background: rgba(12, 18, 30, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: hintPulse 2.4s ease-in-out infinite;
    transition: opacity 0.25s ease;
    cursor: default;
}

.lock-hint .icon {
    width: 15px;
    height: 15px;
}

@keyframes hintPulse {
    0%, 100% {
        opacity: 0.75;
    }
    50% {
        opacity: 1;
    }
}

.lock-bottom {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.lock-pin-hint {
    position: absolute;
    left: 0;
    bottom: 0;
    padding: 5px 9px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: 0.01em;
}

.lock-net {
    display: flex;
    gap: 12px;
    align-items: center;
}

.lock-net .icon {
    width: 18px;
    height: 18px;
    opacity: 0.85;
}

.lock-public-link {
    position: absolute;
    top: 28px;
    right: 28px;
    z-index: 4;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    text-decoration: none;
    letter-spacing: 0.01em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.15s ease, color 0.15s ease;
}

.lock-public-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* ------------------------------ Sign-in ---------------------------------- */

.signin-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(8, 14, 26, 0.28);
    backdrop-filter: blur(30px) saturate(0.9);
    -webkit-backdrop-filter: blur(30px) saturate(0.9);
    animation: signinIn 0.32s ease;
    z-index: 5;
}

@keyframes signinIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
}

.signin-layer[hidden] {
    display: none !important;
}

.signin-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(340px, calc(100vw - 48px));
    margin-top: -4vh;
}

.signin-avatar {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(140deg, #4a9fe0 0%, #6d5cff 55%, #b45cff 100%);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.38),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    margin-bottom: 18px;
}

.signin-name {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.signin-notice {
    margin-top: 4px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.62);
}

#pin-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 22px;
}

#pin-form .pin-error {
    margin-top: 0;
}

#pin-form .signin-submit {
    margin-top: 4px;
}

.pin-dots {
    display: flex;
    gap: 12px;
    height: 26px;
    align-items: center;
    justify-content: center;
}

.pin-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.6px solid rgba(255, 255, 255, 0.85);
    background: transparent;
    transition: background 0.12s ease, transform 0.12s ease;
}

.pin-dots span.filled {
    background: #fff;
    transform: scale(1.08);
}

.pin-dots.error {
    animation: shake 0.36s ease;
}

@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

.pin-error {
    min-height: 18px;
    margin-top: 6px;
    font-size: 11.5px;
    color: #ffb4ab;
    opacity: 0;
    transition: opacity 0.15s;
}

.pin-error.show {
    opacity: 1;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 58px);
    gap: 10px;
    margin-top: 14px;
    justify-content: center;
}

.key {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 17px;
    font-weight: 400;
    display: grid;
    place-items: center;
    transition: background 0.1s ease, transform 0.1s ease;
}

.key:hover {
    background: rgba(255, 255, 255, 0.2);
}

.key:active {
    background: rgba(255, 255, 255, 0.32);
    transform: scale(0.94);
}

.key-ghost {
    visibility: hidden;
    pointer-events: none;
}

.key-back .icon {
    width: 22px;
    height: 22px;
}

.signin-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 190px;
    height: 38px;
    margin-top: 18px;
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #10233d;
    font-size: 12.5px;
    font-weight: 600;
    transition: background 0.1s ease, transform 0.1s ease;
}

.signin-submit:hover {
    background: #fff;
}

.signin-submit:active {
    transform: scale(0.99);
}

.signin-submit[disabled] {
    opacity: 0.55;
    pointer-events: none;
}

.signin-submit .icon {
    width: 15px;
    height: 15px;
}

.signin-hint {
    margin-top: 11px;
    font-size: 10.5px;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.4);
}

.signin-footer {
    position: absolute;
    right: 30px;
    bottom: 26px;
    display: flex;
    gap: 10px;
}

.signin-power {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    display: grid;
    place-items: center;
    transition: background 0.12s ease;
}

.signin-power:hover {
    background: rgba(255, 255, 255, 0.2);
}

.signin-power .icon {
    width: 20px;
    height: 20px;
}

/* Dim lock content while signing in */
.lock-screen.signing-in .lock-clock,
.lock-screen.signing-in .lock-hint,
.lock-screen.signing-in .lock-bottom {
    opacity: 0;
    pointer-events: none;
}

/* ------------------------------ Responsive ------------------------------- */

@media (max-height: 760px) {
    .lock-clock {
        left: 40px;
        top: 30px;
    }

    .signin-avatar {
        width: 84px;
        height: 84px;
        font-size: 27px;
        margin-bottom: 12px;
    }

    .signin-name {
        font-size: 22px;
    }

    .keypad {
        grid-template-columns: repeat(3, 50px);
        gap: 8px;
        margin-top: 10px;
    }

    .key {
        width: 50px;
        height: 50px;
        font-size: 15px;
    }

    .signin-submit {
        margin-top: 12px;
    }
}

@media (max-width: 640px) {
    .lock-clock {
        left: 28px;
        top: 26px;
    }

    .lock-hint {
        bottom: 70px;
        font-size: 11.5px;
    }

    .lock-bottom {
        left: 20px;
        right: 20px;
        bottom: 18px;
    }

    .signin-footer {
        right: 20px;
        bottom: 18px;
    }

    .lock-pin-hint {
        bottom: 0;
    }
}
