/*
 * Sign-in screen, on top of login.less (loaded after it by the login layout).
 *
 * A plain stylesheet rather than more of login.less: the AssetCompress bundle
 * can outlive a deploy, and this file is cache-busted by its own timestamp.
 *
 * All widths: visible field labels, a show-password button, a busy state on
 * submit, and the page colour on <html> too, so nothing of another colour
 * shows under Safari's toolbar or in the overscroll.
 *
 * Phone (< 36rem): no floating card. The brand band runs to the top edge
 * under the status bar (theme-color matches it), and the form sits at the
 * bottom of the screen, where the thumb is.
 */

html.login-html {
    background: #eef1f4;
}

html.login-html[data-theme="dark"] {
    background: #11171d;
}

/* ---------- Fields ---------- */

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

.login-form .login-label {
    color: var(--login-text);
    display: block;
    font-size: .9rem;
    font-weight: 600;
    margin: 0 0 .4rem;
}

.login-form .login-control {
    font-size: 1rem;
    min-height: 3.25rem;
}

/* The icon cell is decoration; the reveal button is a real control. */
.login-form .login-reveal {
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    min-height: 3.25rem;
}

.login-form .login-reveal:hover,
.login-form .login-reveal:focus-visible {
    color: var(--login-text);
}

.login-form .login-reveal:focus-visible {
    box-shadow: inset 0 0 0 2px #d5ae00;
    outline: 0;
}

.login-page .login-submit {
    align-items: center;
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.login-page .login-submit:disabled {
    opacity: .75;
    transform: none;
}

.login-submit .login-spinner {
    animation: login-spin .8s linear infinite;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-right-color: transparent;
    display: none;
    height: 1rem;
    width: 1rem;
}

.login-submit.is-busy .login-spinner {
    display: inline-block;
}

@keyframes login-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-submit .login-spinner {
        animation-duration: 2.4s;
    }

    .login-page .login-submit:hover,
    .login-page .login-submit:focus {
        transform: none;
    }
}

/* ---------- Phone ---------- */

/* The yellow brand takes whatever height the screen has; the form is a sheet
   at the bottom, in reach of the thumb. With the keyboard up the brand
   shrinks first. <html> carries the sheet colour, which is what shows under
   Safari's toolbar. */
@media (max-width: 35.98rem) {
    html.login-html {
        background: #ffffff;
    }

    html.login-html[data-theme="dark"] {
        background: #192129;
    }

    .login-page {
        align-items: stretch;
        background: #ffd200 !important;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0 !important;
    }

    .login-box {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        width: 100%;
    }

    .login-card {
        background: transparent;
        border-radius: 0;
        box-shadow: none !important;
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        overflow: visible;
    }

    .login-card .login-brand {
        align-items: center;
        display: flex;
        flex: 1 1 auto;
        justify-content: center;
        min-height: 9rem;
        padding: calc(env(safe-area-inset-top, 0px) + 1.5rem) 1.5rem 3.25rem !important;
    }

    .login-brand .brand-logo {
        max-height: 4rem;
        max-width: 11rem;
    }

    .login-card-body {
        background: var(--login-card);
        border-radius: 1.75rem 1.75rem 0 0;
        box-shadow: 0 -.5rem 2rem rgba(20, 16, 8, .12);
        flex: 0 0 auto;
        margin-top: -1.75rem;
        padding: 2rem 1.5rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem) !important;
        position: relative;
    }

    .login-intro {
        margin-bottom: 1.5rem;
        text-align: left;
    }

    .login-intro h2 {
        font-size: 1.6rem;
    }

    .login-intro p {
        font-size: 1rem;
    }

    .login-page .login-submit {
        font-size: 1.05rem;
        min-height: 3.5rem;
    }
}
