/* The login card. LoginLayout draws the card and its logo; the pages under it — /login,
   /account/forgot-password and /account/reset-password — draw what goes inside. Global rather than
   scoped because four components render into one card: a .razor.css reaches only the component it is
   named after, so the layout's would leave the pages' headings and forms unstyled. */
.login-page {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.login-card {
    --gold: #f4b740;
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    padding: 2.25rem 2rem 2rem;
    width: 100%;
    max-width: 410px;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(15, 27, 61, 0.04),
        0 24px 60px -20px rgba(15, 27, 61, 0.22);
}

/* Gold → blue accent bar along the top edge */
.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--clr-blue-500));
}

/* ── Brand ── */
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.4rem;
}

.login-logo {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-xl);
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, #ffffff, var(--clr-slate-50));
    border: 1px solid var(--border);
    box-shadow: 0 12px 26px -12px rgba(42, 86, 214, 0.4);
}

.login-logo img {
    height: 38px;
    width: auto;
}

.login-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--clr-slate-900);
}

/* ── Heading ── */
.login-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-head h1 {
    font-size: 1.4rem;
    margin: 0 0 0.35rem;
    color: var(--clr-slate-900);
}

.login-sub {
    font-size: 0.88rem;
    color: var(--clr-slate-500);
    margin: 0;
}

/* ── Form ── */
.login-card form {
    display: flex;
    flex-direction: column;
}

.login-card .form-group {
    margin-bottom: 1rem;
}

.login-card label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--clr-slate-700);
    margin-bottom: 0.4rem;
}

.login-card .form-control {
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-card .form-control:focus {
    outline: none;
    border-color: var(--clr-blue-500);
    box-shadow: 0 0 0 3px rgba(42, 86, 214, 0.15);
}

.login-btn {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.login-submit {
    margin-top: 0.35rem;
    box-shadow: 0 12px 26px -12px rgba(42, 86, 214, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px -12px rgba(42, 86, 214, 0.65);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--clr-slate-400);
    font-size: 0.82rem;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--clr-slate-200);
}

.login-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--clr-red-50);
    color: var(--clr-red-600);
    border: 1px solid var(--clr-red-200);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ── The installation's look (docs/BRANDING.md) ──
   The company logo under the name, one variant per theme; the notice under the form; a test system's
   label above the brand. */
.login-company-logo {
    display: block;
    max-width: 220px;
    max-height: 48px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.login-company-logo--dark {
    display: none;
}

/* The light-ground logo standing in on the dark card. */
.login-company-logo--plate {
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    background: #fff;
}

.login-instance {
    display: flex;
    width: fit-content;
    margin: 0 auto 0.9rem;
}

.login-notice {
    margin: 1.1rem 0 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: center;
    white-space: pre-line;
}

/* ── Dark mode: elevated card on the navy hero ── */
html[data-theme="dark"] .login-company-logo--light {
    display: none;
}

html[data-theme="dark"] .login-company-logo--dark {
    display: block;
}

html[data-theme="dark"] .login-card {
    background: #1b2a3d;
    border-color: #2d4561;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 28px 64px -24px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .login-logo {
    background: linear-gradient(140deg, #22344a, #1b2a3d);
    border-color: #2d4561;
    box-shadow: 0 12px 26px -12px rgba(42, 86, 214, 0.5);
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .login-company-logo--light {
        display: none;
    }

    html:not([data-theme]) .login-company-logo--dark {
        display: block;
    }

    html:not([data-theme]) .login-card {
        background: #1b2a3d;
        border-color: #2d4561;
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.3),
            0 28px 64px -24px rgba(0, 0, 0, 0.6);
    }

    html:not([data-theme]) .login-logo {
        background: linear-gradient(140deg, #22344a, #1b2a3d);
        border-color: #2d4561;
        box-shadow: 0 12px 26px -12px rgba(42, 86, 214, 0.5);
    }
}

/* "Passwort vergessen?" under the form, and the way back from the recovery pages. Quiet on purpose:
   it is the exit for the minority who need it, not a second call to action. */
.login-link {
    display: block;
    margin-top: 0.9rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    text-decoration: none;
}

.login-link:hover {
    color: var(--clr-royal, #2563eb);
    text-decoration: underline;
}