/* Login and logout styling, taken from Lustro
   (AF.CreditReportParser.Web, wwwroot/css/app.css).

   The tokens this file reads now come from :root in css/app.css, which is the single source of
   truth for the theme. The local copy that stood here while that was still outstanding has been
   removed: two copies of the same palette are two things to drift apart. */

/* Full width is not automatic here: these render into #wrapper, which sb-admin-2 declares
   "display: flex", so they are flex items. The rule that makes every layout fill lives on
   "#wrapper > *" in app.css. The width below is belt and braces, so this shell still fills if it
   is ever rendered somewhere without that rule. */
.login-shell,
.logout-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--shell-gradient);
    color: var(--ink);
}

/* The sign out screen is a spinner on the way out rather than a screen anybody reads, so it
   keeps the single centred card. The sign in screen is the split below. */
.logout-shell {
    align-items: center;
    justify-content: center;
}

/* The showcase panel, at Lustro's proportions: it takes the larger share and the card sits in
   the smaller one against a flat darker field, so the eye lands on the form. */
.login-showcase {
    flex: 1 1 58%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--hairline);
}

.login-panel {
    flex: 1 1 42%;
    min-width: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--shell-800);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
}

/* With the showcase hidden on a narrow viewport the panel is the whole screen, so it gives up
   the flat field and the shadow and lets the gradient through, rather than sitting as a band. */
@media (max-width: 1024px) {
    .login-panel {
        flex: 1 1 100%;
        min-width: 0;
        background: transparent;
        box-shadow: none;
    }
}

.login-card {
    width: 340px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.login-wordmark {
    display: flex;
    flex-direction: column;
    margin-bottom: 28px;
    line-height: 1.2;
}

.login-card .brand-name {
    display: block;
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
}

.login-card .brand-sub {
    display: block;
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.login-card .form-group {
    margin-bottom: 12px;
}

.login-card .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--ink-muted);
}

.login-card .form-control {
    width: 100%;
    padding: 9px 12px;
    background: var(--surface-raised);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    color: var(--ink);
}

.login-card .form-control:focus {
    background: var(--surface-raised);
    color: var(--ink);
    border-color: var(--gold);
    /* Focus is shown with a ring rather than a colour change alone, so it is visible to
       somebody who cannot distinguish the border colour. */
    box-shadow: 0 0 0 2px rgba(232, 184, 75, 0.25);
    outline: none;
}

.login-submit {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: var(--gold);
    color: var(--shell-900);
    font-weight: 600;
    cursor: pointer;
}

.login-submit:hover:not(:disabled) {
    background: var(--gold-bright);
}

.login-submit:disabled {
    opacity: 0.65;
    cursor: default;
}

/* Every interactive control on the card carries the same visible focus treatment, so the form
   can be worked through on the keyboard without the focus position ever being a guess. */
.login-submit:focus-visible,
.login-card a:focus-visible,
.login-card .form-control:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}

.login-error {
    margin-top: 12px;
    padding: 9px 12px;
    border: 1px solid var(--status-danger);
    border-radius: 8px;
    background: rgba(240, 103, 125, 0.12);
    color: var(--ink);
    font-size: 13px;
}

.login-card .validation-message {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--status-danger);
}

.login-links {
    margin-top: 14px;
    font-size: 13px;
}

.login-card a {
    color: var(--ink-muted);
    text-decoration: none;
}

.login-card a:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* --ink-muted rather than --ink-faint. Measured in the browser, the faint token put this at
   5.2:1 against the card, the weakest text on the screen. It cleared AA and still read as an
   afterthought at 12px, on the first screen anybody sees. --ink-muted takes it to 8.9:1. */
.login-note {
    margin-top: 22px;
    margin-bottom: 0;
    font-size: 12px;
    color: var(--ink-muted);
    text-align: center;
}

.logout-spinner {
    font-size: 24px;
    color: var(--gold);
}

.logout-message {
    margin-left: 12px;
    color: var(--ink-muted);
}

@media (max-width: 480px) {
    .login-card {
        width: 100%;
    }
}
