/*
 * THE HOUSE BEHIND THE SIGN-IN AND SIGN-UP PAGES, AND THE GLASS CARD ON IT
 * (the owner's brief of 19 October 2026). The rental site's sign-in,
 * sign-up, forgotten password and the second step of a Google sign-up: the
 * pages its layout marks $auth. A panel's own sign-in is not touched.
 *
 * The backdrop: the footer's pictures (App\Support\HouseScene), full screen
 * behind the page, fixed, out of the flow, so nothing on the page moves for
 * it. Night in dark mode, day in light; the theme switch fades one into the
 * other on opacity alone, at once for anybody who asked for less motion.
 * Until a picture arrives, a tiny blurred copy of it shows.
 *
 * The card: the site's own liquid glass (glass.css; the card already wears
 * it), held more solid over the house. How solid was measured on the
 * pictures themselves, blurred as the card blurs them, under the card on a
 * desktop and a phone: words, muted words and links hold 4.5 to 1 on the
 * worst point in both modes (AuthSceneTest). Dark mode: 74 per cent (worst
 * 5.9 to 1, a lit window). Light mode, frosted as iOS frosts its light
 * glass (blur 40px, saturate 180%, brightness 115%) so it shows the house
 * rather than a white sheet (the owner, the same day): 70 per cent, with
 * the card's muted words (#3f4757) and links (#5f4200) a shade darker, which
 * hold 4.5 to 1 there on a window in shade; the site's lighter gold needs
 * the card near white. Its fields are a visible grey glass in light mode. A browser without
 * backdrop-filter, or a reader who asked for less transparency, keeps the
 * solid surface glass.css gives it. Nothing here sizes or spaces the card,
 * its fields, buttons or links, or touches a focus ring.
 */
.auth-scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.auth-scene-layer, .auth-scene img { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-scene-layer { background-size: cover; background-position: 50% 50%; transition: opacity .6s ease; }
.auth-scene img { object-fit: cover; object-position: 50% 50%; }
.auth-scene-night { opacity: 1; background-image: url("data:image/webp;base64,UklGRpAAAABXRUJQVlA4IIQAAAAwBACdASogAA4APu1yrU+pp6QiMAgBMB2JQBOgMYUT7doVNNpDNBjheYAA/vvr6ocgVhYWi/gF47db8pVTek/ofB48+eORxzIpsQTeC6HL/Rmp2LYzd7txMzjAJuom0ZsoxPuv6oXvo4t94907JCFV7TheFdwHpusjfsFj/RY02fcpAAA="); }
.auth-scene-day { opacity: 0; background-image: url("data:image/webp;base64,UklGRqgAAABXRUJQVlA4IJwAAAAQBACdASogAA4APu1qrU8ppiQiMAgBMB2JZQCzgBuJEeRzWW0+yVONsAD9TZ4EPd7lOZTYHKp12pU+2xZ0+JxsBk4Yxq3fi3Gz0tn3c7dXU7prtKlvTLBiGi2jJCc+/tdmk8zA9h4UbdMkx8fjvhskupClgM81arzXuVW5nPLY9ZSwEutnOMI0zzqHV/24RgBA/5dsPWIAfyqAAAA="); }

/* Scrolling away (the owner, 19 Oct 2026): the partial's script sets
   --scene-away from 0 at the top to 1 half a screen down. The sharp picture
   gives way to the blurred copy behind it and the scene fades halfway into
   the page; scrolling back up brings it back. Opacity only; for less motion
   the script never sets it, so the house stays as it is. */
.auth-scene { opacity: calc(1 - var(--scene-away, 0) * .5); }
.auth-scene img { opacity: calc(1 - var(--scene-away, 0)); }

/* Light mode: the day, whether the device asks for it or the visitor did. */
@media (prefers-color-scheme: light) {
    html:not([data-mode="dark"]) .auth-scene-night { opacity: 0; }
    html:not([data-mode="dark"]) .auth-scene-day { opacity: 1; }
}
html[data-mode="light"] .auth-scene-night { opacity: 0; }
html[data-mode="light"] .auth-scene-day { opacity: 1; }

/* The card, over the house: a deeper shadow to lift it off the picture. */
[data-auth-scene] .auth-card { --glass-shadow: 0 1px 2px rgba(4, 8, 16, .3), 0 24px 60px rgba(4, 8, 16, .45); }
@media (prefers-color-scheme: light) {
    html:not([data-mode="dark"]) [data-auth-scene] .auth-card { --glass-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 24px 60px rgba(16, 24, 40, .24); }
}
html[data-mode="light"] [data-auth-scene] .auth-card { --glass-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 24px 60px rgba(16, 24, 40, .24); }

/* Its glass, only where glass.css gives glass at all. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (background-color: color-mix(in srgb, red 50%, transparent)) {
    [data-auth-scene] .auth-card { --glass-bg: color-mix(in srgb, var(--surface) 74%, transparent); }
    @media (prefers-color-scheme: light) {
        html:not([data-mode="dark"]) [data-auth-scene] .auth-card { --glass-bg: color-mix(in srgb, var(--surface) 70%, transparent); --glass-filter: blur(40px) saturate(180%) brightness(115%); }
    }
    html[data-mode="light"] [data-auth-scene] .auth-card { --glass-bg: color-mix(in srgb, var(--surface) 70%, transparent); --glass-filter: blur(40px) saturate(180%) brightness(115%); }
}

/* Light mode on the card: its muted words and links a shade darker, which
   the see-through glass needs for 4.5 to 1, and its fields visible against
   it rather than whiter (the owner, the same day): a light grey glass fill,
   a hairline edge, a slight inset and a shine along the top. Colours only. */
@media (prefers-color-scheme: light) {
    html:not([data-mode="dark"]) [data-auth-scene] .auth-panel { --muted: #3f4757; }
    html:not([data-mode="dark"]) [data-auth-scene] .auth-panel a:not(.button) { color: #5f4200; }
    html:not([data-mode="dark"]) [data-auth-scene] .auth-panel :is(.field > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .select-button) {
        background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 55%), rgba(15, 22, 36, .07);
        border-color: rgba(15, 22, 36, .18);
        box-shadow: inset 0 1px 2px rgba(16, 24, 40, .12), 0 1px 0 rgba(255, 255, 255, .7);
    }
    html:not([data-mode="dark"]) [data-auth-scene] .auth-panel .field > input::placeholder { color: var(--muted); }
}
html[data-mode="light"] [data-auth-scene] .auth-panel { --muted: #3f4757; }
html[data-mode="light"] [data-auth-scene] .auth-panel a:not(.button) { color: #5f4200; }
html[data-mode="light"] [data-auth-scene] .auth-panel :is(.field > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .select-button) {
    background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 55%), rgba(15, 22, 36, .07);
    border-color: rgba(15, 22, 36, .18);
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, .12), 0 1px 0 rgba(255, 255, 255, .7);
}
html[data-mode="light"] [data-auth-scene] .auth-panel .field > input::placeholder { color: var(--muted); }

@media (prefers-reduced-transparency: reduce) {
    [data-auth-scene] .auth-card { --glass-bg: var(--surface); --glass-filter: none; }
    html[data-mode="light"] [data-auth-scene] .auth-card, html:not([data-mode="dark"]) [data-auth-scene] .auth-card { --glass-bg: var(--surface); --glass-filter: none; }
    html[data-mode="light"] [data-auth-scene] .auth-panel :is(.field > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .select-button),
    html:not([data-mode="dark"]) [data-auth-scene] .auth-panel :is(.field > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .select-button) { background: var(--bg); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-scene-layer { transition: none; }
}
