/* ---------------------------------------------------------------------------
   Styles for the statically-rendered auth pages only. Everything behind the
   login is MudBlazor, which brings its own stylesheet -- keeping the two apart
   means the login screen paints without waiting on a Blazor circuit.
   ------------------------------------------------------------------------- */

:root {
    --auth-bg: #eef2f9;
    --auth-bg-accent: #dbe6fb;
    --auth-surface: #ffffff;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #d8dee9;
    --auth-primary: #2563eb;
    --auth-primary-hover: #1d4ed8;
    --auth-danger-bg: #fef2f2;
    --auth-danger-border: #fecaca;
    --auth-danger-text: #b91c1c;
    --auth-focus-ring: rgba(37, 99, 235, 0.18);
}

@media (prefers-color-scheme: dark) {
    :root {
        --auth-bg: #0b1220;
        --auth-bg-accent: #111c30;
        --auth-surface: #151f32;
        --auth-text: #e2e8f0;
        --auth-muted: #94a3b8;
        --auth-border: #273349;
        --auth-primary: #3b82f6;
        --auth-primary-hover: #60a5fa;
        --auth-danger-bg: #2a1416;
        --auth-danger-border: #7f2529;
        --auth-danger-text: #fca5a5;
        --auth-focus-ring: rgba(96, 165, 250, 0.24);
    }
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
}

/* --- Auth shell ---------------------------------------------------------- */

/* Colour and font live here rather than on `body`: this stylesheet loads on
   every page, so styling `body` would override MudBlazor's own theme
   everywhere behind the login. */
.auth-shell {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--auth-text);

    /* Mobile-first: fill the small viewport (svh dodges the iOS URL bar), and
       keep the footer below the card without a fixed-position hack. */
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.5rem 1.125rem calc(1.5rem + env(safe-area-inset-bottom));
    box-sizing: border-box;
    background: radial-gradient(120% 100% at 50% 0%, var(--auth-bg-accent) 0%, var(--auth-bg) 60%);
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                0 12px 32px -12px rgba(15, 23, 42, 0.18);
}

.auth-footer {
    font-size: 0.75rem;
    color: var(--auth-muted);
}

/* --- Branding ------------------------------------------------------------ */

.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.875rem;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--auth-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
}

.auth-brand h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.auth-sub {
    margin: 0.375rem 0 0;
    font-size: 0.875rem;
    color: var(--auth-muted);
}

/* --- Form ---------------------------------------------------------------- */

.auth-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    /* 16px minimum, otherwise iOS Safari zooms the page on focus. */
    font-size: 1rem;
    padding: 0.75rem 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--auth-text);
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-focus-ring);
}

.auth-validation {
    display: block;
    min-height: 1rem;
    margin-bottom: 0.625rem;
    font-size: 0.75rem;
    color: var(--auth-danger-text);
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 1.25rem;
    font-size: 0.875rem;
    color: var(--auth-muted);
    cursor: pointer;
}

.auth-check input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--auth-primary);
    margin: 0;
}

.auth-button {
    width: 100%;
    /* 46px tall: comfortably above the minimum touch target on a phone. */
    min-height: 2.875rem;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--auth-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.auth-button:hover { background: var(--auth-primary-hover); }
.auth-button:active { transform: translateY(1px); }

.auth-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--auth-focus-ring);
}

/* --- Messages ------------------------------------------------------------ */

.auth-alert {
    margin-bottom: 1.125rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--auth-danger-text);
    background: var(--auth-danger-bg);
    border: 1px solid var(--auth-danger-border);
    border-radius: 10px;
}

.auth-hint {
    margin: 1.25rem 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--auth-muted);
    text-align: center;
}

/* Blazor's built-in disconnect/error bar, restyled to match. */
#blazor-error-ui {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    background: #fef3c7;
    color: #713f12;
    font-size: 0.8125rem;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
    font-weight: 700;
}
