/* Login page: full-screen scene, logo, Santa, and the username card */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #eef3ff;
    background-color: #0f1b33;
    background-image: radial-gradient(circle at 50% 0%, #22407a 0%, #0f1b33 60%, #0a1224 100%);
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.login-logo {
    position: absolute;
    top: max(22px, env(safe-area-inset-top));
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 3;
    display: block;
    height: clamp(48px, 10vh, 110px);
    width: auto;
    max-width: 80vw;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(4, 10, 30, .4));
}

/* Big Santa between the logo and the bottom of the screen */
.login-santa {
    position: absolute;
    left: 0; right: 0;
    top: calc(max(22px, env(safe-area-inset-top)) + clamp(48px, 10vh, 110px) + 8px);
    bottom: clamp(70px, 9vh, 120px);
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}
.login-santa img {
    display: block;
    max-width: min(96vw, 1200px);
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .25));
    animation: santa-float 3.2s ease-in-out infinite alternate;
}
@keyframes santa-float { from { transform: translateY(0); } to { transform: translateY(-10px); } }

/* Username card: centred when there's no Santa, over the sleigh's base when there is */
.card {
    position: relative;
    z-index: 2;
    width: min(92vw, 480px);
    margin: 0 auto;
    padding: 22px 24px 24px;
    border: 3px solid rgba(255, 255, 255, .85);
    border-radius: 12px;
    background: rgba(14, 26, 56, .96);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}
body.login:not(.has-santa) { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 140px 16px 40px; }
body.has-santa .card {
    position: absolute;
    left: 50%;
    bottom: max(clamp(28px, 14vh, 160px), calc(env(safe-area-inset-bottom) + 16px));
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
}

label { display: block; margin: 0 0 8px; font-size: .95rem; color: #cdd8f2; }
input {
    width: 100%;
    padding: 14px 14px;
    border-radius: 10px;
    border: 2px solid #c8424a;
    background: #0a1430;
    color: #fff;
    font-size: 1.05rem;
}
input:focus { outline: none; border-color: #ffcc12; box-shadow: 0 0 0 3px rgba(255, 204, 18, .25); }
button {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 15px;
    border: 0;
    border-radius: 10px;
    background: #d6363b;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}
button:hover { background: #e04a4f; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.err { background: #6b1f24; padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; font-size: .92rem; }

@media (max-width: 560px) {
    .login-santa { bottom: 150px; }
    body.has-santa .card { bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px)); }
}
@media (prefers-reduced-motion: reduce) { .login-santa img { animation: none; } }
