/* Login page CSS. Extracted from Components/Pages/Account/Login.razor (Wave 1.7).
   Lives in wwwroot rather than as a co-located .razor.css because Login uses
   EmptyLayout and sets html/body backgrounds directly — Blazor's scoped CSS only
   attributes elements rendered BY the component, never the document root.
   The `.login-*` prefix keeps these selectors inert on non-login pages. */

/* Light-theme defaults — single source of truth, dark-theme block at the bottom
   overrides only the variables that change. */

/* EmptyLayout has no RadzenLayout wrapper, so Radzen's body theme classes
   never get applied even though the material-dark.css is loaded in App.razor.
   Result: html / body keep the browser-default white in dark mode and the
   themed form card sits on a white page. Paint them directly here. */
html, body {
    background: var(--login-page-bg, #f4f5fa) !important;
    color: var(--login-fg, #222);
    min-height: 100vh;
    margin: 0;
}

.login-card {
    max-width: 420px;
    margin: 80px auto;
    padding: 0 16px;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    color: var(--login-fg, #222);
}
.login-title    { margin-top: 0; color: var(--login-fg, #222); }
.login-subtitle { font-weight: 400; font-size: .7em; color: var(--login-muted, #666); }

.login-alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; border: 1px solid; }
.login-alert--warn  { background: var(--login-alert-warn-bg,  #fff8e0); border-color: var(--login-alert-warn-bd,  #e6c200); color: var(--login-alert-warn-fg,  #664400); }
.login-alert--error { background: var(--login-alert-err-bg,   #fee);    border-color: var(--login-alert-err-bd,   #f99);    color: var(--login-alert-err-fg,   #900);    }
.login-alert--info  { background: var(--login-alert-info-bg,  #eef3ff); border-color: var(--login-alert-info-bd,  #c6d4f5); color: var(--login-alert-info-fg,  #2a3e8a); }
.login-alert code   { background: var(--login-code-bg, rgba(0,0,0,.06)); padding: 1px 4px; border-radius: 3px; }

.login-field           { margin-bottom: 12px; }
.login-field label     { display: block; font-size: 13px; margin-bottom: 4px; color: var(--login-fg, #222); }
.login-field input     { width: 100%; padding: 8px 10px; box-sizing: border-box;
                          background: var(--login-input-bg, #fff);
                          color: var(--login-input-fg, #222);
                          border: 1px solid var(--login-input-bd, #ccc);
                          border-radius: 4px; font: inherit; }
.login-field input:focus { outline: none; border-color: var(--login-accent, #5469d4); box-shadow: 0 0 0 3px var(--login-accent-soft, rgba(84,105,212,.18)); }

.login-button { width: 100%; padding: 10px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.login-button:disabled { cursor: not-allowed; opacity: .55; }
.login-button--primary { background: var(--login-accent, #5469d4); color: #fff; border: 1px solid var(--login-accent, #5469d4); }
.login-button--ghost   { background: transparent; color: var(--login-accent, #5469d4); border: 1px solid var(--login-accent, #5469d4); }

.login-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; color: var(--login-muted, #888); font-size: .78rem; }
.login-divider hr { flex: 1; border: none; border-top: 1px solid var(--login-rule, #e1e4ea); }

/* Dark theme — App.razor stamps data-theme="material-dark" on the root html
   element. Override just the variables; layout / shapes / spacing don't change.
   data-theme lives on the root html element. Selectors that scope DOWN to
   html (e.g. [data-theme="material-dark"] html) can't match — nothing is
   nested inside the html element. Use html[data-theme=...] for the root,
   plus a descendant body rule. */
html[data-theme="material-dark"],
html[data-theme="material-dark"] body {
    background: #1a1a1a !important;
    color: #e8e8e8;
}

[data-theme="material-dark"] .login-card {
    --login-page-bg:   #1a1a1a;
    --login-fg:        #e8e8e8;
    --login-muted:     #b0b0b0;
    --login-input-bg:  #2b2b2b;
    --login-input-fg:  #f1f1f1;
    --login-input-bd:  rgba(255,255,255,.15);
    --login-accent:    #7c8cef;
    --login-accent-soft: rgba(124,140,239,.25);
    --login-rule:      rgba(255,255,255,.12);
    --login-code-bg:   rgba(255,255,255,.08);
    --login-alert-warn-bg:  #3a2e10; --login-alert-warn-bd:  #b88f00; --login-alert-warn-fg:  #f5d77a;
    --login-alert-err-bg:   #3a1a1a; --login-alert-err-bd:   #d05959; --login-alert-err-fg:   #f5a1a1;
    --login-alert-info-bg:  #1a213a; --login-alert-info-bd:  #4d63b0; --login-alert-info-fg:  #b6c4f7;
}
