.login-page {
    --pine: #244d42;
    --secondary-ink: #233e32;
    position: relative;
    isolation: isolate;
    background: #dce6d5;
    color: #233831;
}

.winter-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    background: #dce6d5;
}
.winter-village {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 35% 67%;
}
.winter-ambient::after {
    content: "";
    position: absolute;
    inset: clamp(12px, 1.3vw, 22px);
    border: 1px solid #ffffff80;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(310px, 1fr);
    align-items: center;
    gap: 5%;
    width: min(100%, 1700px);
    margin-inline: auto;
    padding: clamp(28px, 6vh, 70px) 6.5%;
}
.winter-guide {
    position: absolute;
    z-index: -1;
    right: 48%;
    bottom: 0;
    width: min(28vw, 33svh, 510px);
    height: auto;
    pointer-events: none;
    user-select: none;
}
.winter-intro {
    align-self: start;
    margin-top: clamp(25px, 10vh, 138px);
    color: var(--pine);
    text-shadow: 0 1px 14px #ecf1dd80;
}
.winter-intro small {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 17px;
    color: #395347;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.winter-intro small::before {
    content: "";
    width: 28px;
    height: 1px;
    background: #a5824c;
}
.winter-intro p {
    margin: 0;
    font: 400 clamp(37px, 4.7vw, 72px)/1.025 Georgia, "Times New Roman", serif;
    letter-spacing: -.05em;
}

.login-panel {
    --glass-fill: radial-gradient(ellipse 27% 7px at 28% 0%, #fffffb78, transparent),
        linear-gradient(0deg, #f3f8eda6, transparent 15%),
        linear-gradient(135deg, #ffffff69, #f1f8ef39 40%, #e4f2ed30 72%, #f4fcfc64);
    position: relative;
    isolation: isolate;
    justify-self: center;
    width: min(100%, clamp(355px, 31vw, 420px));
    padding: clamp(28px, 3vw, 42px) clamp(23px, 2.8vw, 38px) 26px;
    overflow: hidden;
    border: 0;
    border-radius: 29px;
    background: var(--glass-fill), #eaf2e3d4;
    box-shadow: 0 15px 38px -12px #1e382e49;
    animation: none;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .login-panel {
        background: var(--glass-fill);
        -webkit-backdrop-filter: blur(6px) saturate(1.16) brightness(1.04);
        backdrop-filter: blur(6px) saturate(1.16) brightness(1.04);
    }
}
.login-panel::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: url("monthly_window_frost.webp") right bottom / 54% auto no-repeat;
    opacity: .7;
    mask-image: radial-gradient(ellipse 49% 35% at 100% 100%, black 12%, #000a 53%, transparent);
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.winter-login-portrait {
    width: clamp(44px, 4vw, 55px);
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 14px;
    background: #f4f6ef;
    box-shadow: inset 0 0 0 1px #486e5721;
}
.login-wordmark { padding: 0; color: #253f37; font-size: 18px; letter-spacing: .16em; }
.login-heading { margin: 25px 0 22px; }
.login-heading h1 { color: #263e36; font-size: clamp(24px, 2.5vw, 30px); line-height: 1.12; }
.login-heading p, .login-access-note, .login-field label { color: var(--secondary-ink); }
.login-form { gap: 15px; }
.login-field { gap: 6px; }
.login-field label { padding: 0; font-size: 13px; font-weight: 500; }
.login-input-wrap input {
    padding-left: 14px;
    height: 46px;
    border-radius: 11px;
    border-color: #63827585;
    background: linear-gradient(#f9fff9b8, #f4faf1cb);
    box-shadow: inset 0 1px 3px #355c4f1f, 0 1px 0 #ffffffad;
}
.login-input-wrap input:focus { border-color: #527c69; background: #f3f8f0e6; box-shadow: 0 0 0 3px #3562482e; }
.login-input-wrap input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px #f3f6ee inset; }
.login-input-wrap input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px #f3f6ee inset, 0 0 0 3px #3562482e; }
.login-password-toggle { top: 1px; right: 2px; color: #405f51; }
.login-password-toggle:hover { color: var(--pine); background: #dae5d970; }
.login-submit {
    min-height: 46px;
    margin-top: 2px;
    padding-block: 11px;
    border: 1px solid #244e40;
    border-radius: 11px;
    background: linear-gradient(166deg, #39705d, #21513f 62%, #285947);
    box-shadow: inset 0 1px 0 #ffffff48, 0 3px 6px #224a3b30;
}
.login-submit:hover, .login-submit:active { transform: none; background: #214b3d; }
.login-access-note { margin: 22px 0 0; font-size: 12px; }
.login-access-note svg { color: #876a39; }
.login-submit:focus-visible, .login-password-toggle:focus-visible, .winter-snow-toggle:focus-visible {
    outline: 2px solid #315f4c;
    outline-offset: 2px;
}

.winter-snowfall { position: absolute; inset: 0; overflow: hidden; }
.winter-snowfall::before, .winter-snowfall::after {
    content: "";
    position: absolute;
    inset: calc(0px - var(--tile-height)) -24px 0;
    background-size: var(--tile-width) var(--tile-height);
    background-repeat: repeat;
    animation: login-snowfall var(--duration) linear infinite paused;
}
.winter-snowfall::before {
    --tile-height: 237px; --tile-width: 263px; --duration: 12s;
    background-image: radial-gradient(circle at 19px 65px, #fffef1c7 1px, transparent 2px),
        radial-gradient(circle at 96px 138px, #fffff6a8 .7px, transparent 1.6px),
        radial-gradient(circle at 189px 48px, #fffef1a6 .8px, transparent 1.6px),
        radial-gradient(circle at 142px 213px, #fffef1ce 1.3px, transparent 2.3px);
    animation-delay: -5s;
}
.winter-snowfall::after {
    --tile-height: 343px; --tile-width: 380px; --duration: 10s;
    background-image: radial-gradient(circle at 31px 23px, #fffef3db 1.5px, transparent 2.7px),
        radial-gradient(circle at 256px 115px, #fffef3b8 1.1px, transparent 2.5px),
        radial-gradient(circle at 157px 263px, #fffef1da 1.4px, transparent 2.7px);
    animation-delay: -8s;
}
.winter-snowfall.is-playing::before, .winter-snowfall.is-playing::after { animation-play-state: running; }
@keyframes login-snowfall {
    from { transform: translate(0, 0); }
    50% { transform: translate(12px, calc(var(--tile-height) / 2)); }
    to { transform: translate(0, var(--tile-height)); }
}
.winter-snow-toggle {
    position: absolute;
    bottom: 24px;
    left: 24px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #ffffff95;
    border-radius: 50%;
    color: #324f43;
    background: #f4f7e9e6;
    box-shadow: 0 2px 12px #12382718;
    cursor: pointer;
}
.winter-snow-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.winter-snow-toggle[aria-pressed="true"] .snow-play,
.winter-snow-toggle[aria-pressed="false"] .snow-pause { display: none; }

@media (max-width: 680px) {
    .login-page { --secondary-ink: #172e25; }
    .winter-village { object-position: 50% 78%; }
    .winter-ambient::after { display: none; }
    .login-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(140px, 1fr) auto;
        align-content: center;
        gap: 16px;
        padding: clamp(20px, 4vh, 38px) clamp(16px, 4.5vw, 30px) max(21px, env(safe-area-inset-bottom));
    }
    .winter-intro { grid-area: 1 / 1; margin: 0 0 0 2%; }
    .winter-intro p { font-size: clamp(30px, 7.2vw, 43px); }
    .winter-intro small { font-size: 11px; margin-bottom: 8px; }
    .login-panel { grid-area: 2 / 1; width: min(100%, 355px); padding: 22px clamp(18px, 5.5vw, 27px) 20px; border-radius: 25px; }
    .login-heading { margin: 18px 0; text-align: left; }
    .login-brand, .login-access-note { justify-content: flex-start; text-align: left; }
    .login-access-note { margin-top: 17px; }
    .winter-snow-toggle { grid-area: 1 / 1; position: static; align-self: end; justify-self: end; }
    .login-shell:has(.winter-guide) { grid-template-rows: minmax(clamp(222px, 32svh, 300px), 1fr) auto; }
    .winter-guide {
        grid-area: 1 / 1;
        position: relative;
        inset: auto;
        place-self: end;
        width: min(39vw, 19svh, 155px);
        margin-inline-end: max(3%, calc(50% - 145px));
        transform: translateY(18px);
        mask-image: linear-gradient(black 89%, transparent);
    }
    .winter-guide ~ .winter-snow-toggle { justify-self: start; margin-inline-start: 2%; }
}
@media (prefers-reduced-motion: reduce) {
    .winter-snowfall, .winter-snow-toggle { display: none; }
}
.login-page[data-scene="night"] {
    --secondary-ink: #deebed;
    background: #081e31;
}
[data-scene="night"] .winter-ambient { background: #081e31; }
[data-scene="night"] .winter-ambient::after { border-color: #e3e6d337; }
[data-scene="night"] .winter-intro { color: #fff4d9; text-shadow: 0 2px 13px #041523c4; }
[data-scene="night"] .winter-intro small { color: #e5ddd0; }
[data-scene="night"] .winter-intro small::before { background: #d5ac6b; }
[data-scene="night"] .winter-guide { filter: brightness(.86) saturate(.9) drop-shadow(0 4px 9px #06142652); }
[data-scene="night"] .login-panel {
    --glass-fill: radial-gradient(ellipse 26% 6px at 28% 0, #fff2ca60, transparent),
        linear-gradient(145deg, #45616b59, #152c3c87 52%, #61777b36);
    background: var(--glass-fill), #10283a;
    box-shadow: inset 0 1px 0 #d8eceb35, 0 18px 42px -12px #020c18a3;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    [data-scene="night"] .login-panel { background: var(--glass-fill), #0b2233ae; }
}
[data-scene="night"] .login-wordmark, [data-scene="night"] .login-heading h1 { color: #f8f5e9; }
[data-scene="night"] .winter-login-portrait { background: #d6e4df; }
[data-scene="night"] .login-panel::before { opacity: .38; }
[data-scene="night"] .login-input-wrap input {
    color: #f2f4ee;
    background: #112635d6;
    border-color: #77949a;
    color-scheme: dark;
}
[data-scene="night"] .login-input-wrap input:focus { border-color: #d6b883; box-shadow: 0 0 0 3px #d7ba7f31; }
[data-scene="night"] .login-input-wrap input:-webkit-autofill {
    -webkit-text-fill-color: #f2f4ee;
    -webkit-box-shadow: 0 0 0 100px #182d3a inset;
}
[data-scene="night"] .login-password-toggle { color: #c4d6db; }
[data-scene="night"] .login-password-toggle:hover { color: #fff4da; background: #c2d7d51c; }
[data-scene="night"] .login-submit { background: linear-gradient(158deg, #35745f, #245742); border-color: #8fbca78a; }
[data-scene="night"] .login-submit:hover { background: #336c57; }
[data-scene="night"] .login-access-note svg { color: #edc987; }
[data-scene="night"] .login-error { color: #ffe6d9; background: #512f32; border-color: #916364; }
[data-scene="night"] .winter-snow-toggle { color: #f8e9c7; background: #172d3be0; border-color: #ccd3bc66; }
[data-scene="night"] :is(.login-submit, .login-password-toggle, .winter-snow-toggle):focus-visible { outline-color: #f3d191; }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
    .login-panel { background: #edf3e9; -webkit-backdrop-filter: none; backdrop-filter: none; }
    [data-scene="night"] .login-panel { background: #122b3b; }
}
@media (forced-colors: active) {
    .winter-ambient, .winter-guide, .winter-snow-toggle, .login-panel::before { display: none; }
    .login-panel { border: 1px solid CanvasText; background: Canvas; }
    .login-submit { border-color: ButtonText; }
}
