/* Login.css - what is inside the login card (COID Easy "Sign in", D61): the boxes, the eye button, the red messages, the Sign in button,
   Forgot password, the help line, and the loading screen (D62).
   Uses: CoidEasyTokens.css (colours), CardPage.css (the strip, banner, card and bottom line around it; loaded before this file).
   Used by: Views/Login/Index.cshtml only. Changed: COID Easy look; it no longer changes Site.css (that file isn't loaded here any more). */

/* One label + box pair. */
.login-field {
    margin-bottom: 14px;
}

.login-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #333;
}

/* The boxes: light grey, thin border. */
.login-input {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--field-bg);
    color: var(--navy);
    font-size: 12.5px;
    outline: none;
}

    /* Cursor in the box: sky-blue edge and a soft ring (the accent's base tier: no text on it, CE03). */
    .login-input:focus {
        border-color: var(--c-accent);
        background: var(--white);
        box-shadow: 0 0 0 2px var(--c-accent-bg);
    }

/* The password box and its eye button: the eye sits inside the box's right edge. */
.password-wrap {
    position: relative;
}

    /* Room on the right so the text never runs under the eye. */
    .password-wrap .login-input {
        padding-right: 40px;
    }

/* The eye button: no box of its own, grey, light grey square under the mouse. */
#togglePassword {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--mid-grey);
    cursor: pointer;
}

    #togglePassword:hover,
    #togglePassword:focus-visible {
        background: var(--field-bg);
        outline: none;
    }

    #togglePassword svg {
        width: 18px;
        height: 18px;
        fill: currentColor;
    }

    /* The slash through the eye only while the password is showing (Login.js adds "showing"). */
    #togglePassword .eye-slash {
        display: none;
    }

    #togglePassword.showing .eye-slash {
        display: inline;
    }

/* The red message under a box (Login.js writes it; empty = takes no room). */
.error-message {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--c-danger-text);
}

    .error-message:empty {
        display: none;
    }

/* Sign in: navy, full width; strong sky blue under the mouse (CE03: white text sits on the strong tier only). */
.login-btn {
    width: 100%;
    margin-top: 4px;
    padding: 11px;
    border: none;
    border-radius: 5px;
    background: var(--navy);
    color: var(--white);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

    .login-btn:hover,
    .login-btn:focus-visible {
        background: var(--c-accent-strong);
        outline: none;
    }

/* Forgot password: a normal link (link blue, CE04), centred. */
.login-forgot {
    display: block;
    margin-top: 14px;
    font-size: 12px;
    color: var(--c-link);
    text-align: center;
    text-decoration: none;
}

    .login-forgot:hover {
        text-decoration: underline;
    }

/* The note Forgot password shows (Login.js). */
.login-forgot-note {
    margin: 8px 0 0;
    padding: 8px 11px;
    background: var(--c-accent-warm);
    border-left: 3px solid var(--c-accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 11.5px;
    color: var(--dark-grey);
}

/* Who to contact, under a thin line. */
.login-help {
    margin-top: 18px;
    padding-top: 14px;
    border-top: .5px solid var(--border);
    font-size: 11px;
    line-height: 1.6;
    color: var(--mid-grey);
    text-align: center;
}

    .login-help b {
        color: var(--dark-grey);
    }

/* The loading screen (D62): navy over the whole page, the logo, a turning ring and the brand line. Login.js switches it between flex and none. */
.login-loading {
    position: fixed;
    inset: 0;
    z-index: 900;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(30,43,60,.92);
}

    .login-loading img {
        height: 46px;
        width: auto;
    }

    .login-loading p {
        margin: 0;
        font-size: 10px;
        letter-spacing: .22em;
        text-transform: uppercase;
        color: rgba(255,255,255,.6);
    }

/* The turning ring: sky blue on a faint white ring. */
.login-loading-spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: var(--c-accent);
    animation: login-spin .8s linear infinite;
}

@keyframes login-spin {
    to {
        transform: rotate(360deg);
    }
}

/* People who asked their computer for less movement get a slower turn. */
@media (prefers-reduced-motion: reduce) {
    .login-loading-spinner {
        animation-duration: 2.4s;
    }
}
