html, body {
    height: 100%;
}

/* MudDrawer's toggle lives in AppNav's own interactive-server render island, but MudLayout (owner
   of the .mud-drawer-open-responsive-* class that normally drives .mud-main-content's margin) sits
   in the always-static MainLayout and never re-renders - so its class stays frozen at whatever it
   was on first render, leaving a stale margin reserved once the drawer closes. .mud-drawer itself
   *does* update correctly (it's part of AppNav's own subtree), so react to that instead of the
   frozen ancestor class - no cross-component/render-mode coordination needed. :has() rather than a
   `~` sibling combinator because sibling order in the DOM can't be relied on (see AppNav.razor).
   The equivalent .mud-appbar override isn't needed - ClipMode="Docked" on MudDrawer means MudBlazor
   never pushes/resizes the AppBar for drawer state in the first place. */
.mud-layout:has(> .mud-drawer.mud-drawer--closed) .mud-main-content {
    margin-left: 0;
}

/* MudBlazor only pushes the drawer below the fixed AppBar for ClipMode="Docked" when the drawer
   carries its own .mud-drawer-fixed class (position: fixed, for a drawer used standalone in a
   MudDrawerContainer outside MudLayout). A drawer nested directly in MudLayout, like this one, is
   always position: absolute relative to .mud-layout instead - Fixed="true" doesn't change that -
   so that rule never applies here and the drawer starts at the very top, letting the AppBar
   (higher z-index) cover its header. Apply the same offset/positioning MudBlazor would apply for
   the fixed case, using its own --mud-appbar-height variable.
   position: fixed matters beyond the initial paint too: being position: absolute means the drawer
   is positioned relative to .mud-layout and scrolls away with the page's normal document flow,
   while the AppBar (position: fixed) stays pinned to the viewport - on any page tall enough to
   scroll, the drawer's top edge slides up and disappears behind the AppBar. Forcing position: fixed
   here pins the drawer to the viewport too, matching the AppBar and the permanent-sidebar behavior
   a docked drawer is supposed to have.
   MudBlazor also has a separate, more specific breakpoint rule (.mud-drawer-md etc.) that sets its
   own explicit height (100%) - that beats a plain top+bottom+height:auto override, and per the CSS
   spec a box with top, height, AND bottom all non-auto ignores 'bottom' and uses top+height instead,
   which is exactly what was still overflowing past the viewport by the AppBar's height even after
   switching to top/bottom (confirmed live via computed styles). !important on all three forces ours
   to actually win instead of guessing at exact selector specificity again. */
.mud-drawer.mud-drawer-clipped-docked {
    position: fixed !important;
    top: var(--mud-appbar-height) !important;
    bottom: 0 !important;
    height: auto !important;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f7;
}

.login-card {
    width: 100%;
    max-width: 360px;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.login-card h1 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.login-card label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.login-card input[type=email],
.login-card input[type=text] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.login-card button[type=submit] {
    margin-top: 1.25rem;
    width: 100%;
    padding: 0.6rem;
    background: #594AE2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-card .link-button {
    margin-top: 0.75rem;
    background: none;
    border: none;
    color: #594AE2;
    cursor: pointer;
    padding: 0;
    width: auto;
}

.login-error {
    color: #b32121;
    font-size: 0.875rem;
}

/* The login pages are plain static HTML (not MudBlazor - see LoginLayout.razor), so they don't
   pick up the MudThemeProvider dark mode toggle. There's no toggle to show pre-login anyway, so
   follow the OS preference directly instead. */
@media (prefers-color-scheme: dark) {
    .login-page {
        background: #121212;
    }

    .login-card {
        background: #1e1e1e;
        color: #e0e0e0;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    }

    .login-card input[type=email],
    .login-card input[type=text] {
        background: #2a2a2a;
        border-color: #555;
        color: #e0e0e0;
    }
}
