/* =========================================================
 * GLACIER360 LOGIN
 * ========================================================= */

body.login.glacier360-login-page {
    min-height: 100vh;
    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: column;
    align-items: center;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    background:
        linear-gradient(
            145deg,
            #f5f8fc 0%,
            #eef3f9 100%
        );

    color: #1f2937;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}


/* =========================================================
 * LOGIN HEADER
 * ========================================================= */

body.login.glacier360-login-page #login {
    width: 100%;
    max-width: 420px;

    margin: 0 auto;
    padding: 52px 20px 24px;

    box-sizing: border-box;
}


/* =========================================================
 * GLACIER360 BRAND
 * ========================================================= */

body.login.glacier360-login-page h1 {
    margin: 0 0 28px;
    padding: 0;

    text-align: center;
}


body.login.glacier360-login-page h1 a {
    width: auto;
    height: auto;

    margin: 0 auto;

    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background-image: none;

    text-indent: 0;
    overflow: visible;

    color: #172554;

    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;

    text-decoration: none;
}


body.login.glacier360-login-page h1 a::before {
    content: "";

    width: 64px;
    height: 64px;

    margin-bottom: 12px;

    display: block;

    border-radius: 16px;

    background-color: transparent;
    background-image: var(--g360-login-mark);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    box-shadow:
        0 8px 20px rgba(37, 99, 235, .18);
}


body.login.glacier360-login-page h1 a::after {
    content: "ERP Workspace";

    margin-top: 6px;

    color: #64748b;

    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
}


/* =========================================================
 * LOGIN FORM
 * ========================================================= */

body.login.glacier360-login-page #loginform {
    margin: 0;
    padding: 28px;

    border: 1px solid #dbe3ee;
    border-radius: 14px;

    background: #fff;

    box-shadow:
        0 14px 40px rgba(15, 23, 42, .08);

    box-sizing: border-box;

    /*
     * Keep overflow visible until 2FA is injected. Wordfence's
     * overlay is position:absolute; inset:0 with extra padding;
     * clipping it here would crop the OTP field and overlay Log In.
     */
    overflow: visible;
    position: relative;
}


/* =========================================================
 * LABELS
 * ========================================================= */

body.login.glacier360-login-page #loginform label {
    color: #334155;

    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}


/* =========================================================
 * INPUTS
 * ========================================================= */

body.login.glacier360-login-page #loginform input[type="text"],
body.login.glacier360-login-page #loginform input[type="email"],
body.login.glacier360-login-page #loginform input[type="password"] {
    width: 100%;
    min-height: 46px;

    margin-top: 7px;

    padding: 10px 12px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #fff;

    color: #0f172a;

    font-size: 16px;
    line-height: 1.4;

    -webkit-user-select: text;
    user-select: text;

    box-shadow: none;

    box-sizing: border-box;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background-color .15s ease;
}


body.login.glacier360-login-page #loginform input:hover {
    border-color: #94a3b8;
}

body.login.glacier360-login-page #wfls-prompt-overlay input {
    transition: none;
}


body.login.glacier360-login-page #loginform input:focus {
    border-color: #2563eb;

    outline: 2px solid #2563eb;
    outline-offset: 2px;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, .12);
}


/* =========================================================
 * PASSWORD WRAPPER
 * ========================================================= */

body.login.glacier360-login-page .user-pass-wrap {
    margin-top: 20px;
}


/* =========================================================
 * PASSWORD TOGGLE
 * ========================================================= */

body.login.glacier360-login-page .wp-pwd {
    position: relative;
}


body.login.glacier360-login-page .wp-pwd input[type="password"],
body.login.glacier360-login-page .wp-pwd input[type="text"] {
    padding-right: 48px;
}


body.login.glacier360-login-page .wp-pwd .button.wp-hide-pw {
    top: 7px;
    right: 7px;

    width: 38px;
    height: 38px;

    padding: 0;

    border: 0;
    border-radius: 7px;

    background: transparent;

    color: #64748b;
}


body.login.glacier360-login-page .wp-pwd .button.wp-hide-pw:hover {
    background: #f1f5f9;
    color: #2563eb;
}


body.login.glacier360-login-page .wp-pwd .button.wp-hide-pw:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}


/* =========================================================
 * REMEMBER / BUTTON ROW
 * ========================================================= */

body.login.glacier360-login-page #loginform .forgetmenot {
    float: none;

    display: inline-flex;
    align-items: center;

    min-height: 44px;
}


body.login.glacier360-login-page #loginform .forgetmenot label {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    cursor: pointer;
}


body.login.glacier360-login-page #loginform .forgetmenot input[type="checkbox"] {
    width: 17px;
    height: 17px;

    margin: 0;
}


/* =========================================================
 * SUBMIT BUTTON
 * ========================================================= */

body.login.glacier360-login-page #loginform .submit {
    margin-top: 20px;
    padding: 0;
}


body.login.glacier360-login-page #loginform .submit input[type="submit"] {
    width: 100%;
    min-height: 46px;

    padding: 11px 18px;

    border: 0;
    border-radius: 8px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #1d4ed8
        );

    color: #fff;

    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;

    cursor: pointer;
    touch-action: manipulation;

    box-shadow:
        0 6px 16px rgba(37, 99, 235, .18);

    transition:
        transform .12s ease,
        box-shadow .12s ease,
        opacity .12s ease;
}


body.login.glacier360-login-page #loginform .submit input[type="submit"]:hover {
    transform: translateY(-1px);

    box-shadow:
        0 9px 20px rgba(37, 99, 235, .24);
}


body.login.glacier360-login-page #loginform .submit input[type="submit"]:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}


body.login.glacier360-login-page #loginform .submit input[type="submit"]:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}


/* =========================================================
 * LOGIN LINKS
 * ========================================================= */

body.login.glacier360-login-page #nav,
body.login.glacier360-login-page #backtoblog {
    margin: 14px 0 0;

    padding: 0;

    text-align: center;
}


body.login.glacier360-login-page #nav a,
body.login.glacier360-login-page #backtoblog a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 8px 10px;

    color: #2563eb;

    font-size: 13px;

    text-decoration: none;
}


body.login.glacier360-login-page #nav a:hover,
body.login.glacier360-login-page #backtoblog a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}


/* =========================================================
 * HIDE BACK TO WORDPRESS
 * ========================================================= */

body.login.glacier360-login-page #backtoblog {
    display: none;
}


/* =========================================================
 * LOGIN ERRORS
 * ========================================================= */

body.login.glacier360-login-page .message,
body.login.glacier360-login-page #login_error {
    width: 100%;

    margin: 0 0 18px;
    padding: 12px 14px;

    border-radius: 8px;

    box-sizing: border-box;

    font-size: 13px;
    line-height: 1.5;
}


body.login.glacier360-login-page #login_error {
    border-left: 4px solid #dc2626;
    background: #fef2f2;
    color: #991b1b;
}


body.login.glacier360-login-page .message {
    border-left: 4px solid #2563eb;
    background: #eff6ff;
    color: #1e40af;
}


/* =========================================================
 * LOGIN FOOTER
 * ========================================================= */

body.login.glacier360-login-page .glacier360-login-footer {
    width: 100%;

    padding: 0 20px 28px;

    text-align: center;

    color: #64748b;

    font-size: 12px;
    line-height: 1.5;

    box-sizing: border-box;
}


body.login.glacier360-login-page .glacier360-login-footer-separator {
    margin: 0 5px;
    opacity: .55;
}


/* =========================================================
 * LOADING STATE
 * ========================================================= */

/*
 * Do not set pointer-events: none on the whole form.
 * iOS Safari does not reliably deliver touches to a
 * descendant with pointer-events: auto, including
 * Wordfence #wfls-prompt-overlay. The original submit
 * is disabled in login.js instead.
 *
 * Do not make the overlay a scroll container:
 * iOS Safari freezes focused inputs inside a
 * position:absolute scroller.
 */
body.login.glacier360-login-page #loginform.glacier360-login-submitting
> p.submit input[type="submit"] {
    pointer-events: none;
    opacity: .70;
}


/*
 * Wordfence 9 overlay: position:absolute; inset:0; display:flex;
 * padding:26px 24px 46px; background:#fff.
 *
 * #loginform is position:relative with auto height, so the overlay
 * containing block is this form. inset:0 plus that padding makes a
 * taller white panel than the in-flow fields; overflow:visible lets
 * it paint outside the card, and the original Signing in... control
 * stays in flow at the bottom.
 *
 * Fill the form padding box (longhand, inside the overlay's own
 * box-sizing) and hide in-flow siblings only while the overlay
 * exists. Do not change Wordfence auth or make the overlay a
 * scroller.
 */
body.login.glacier360-login-page #loginform:has(#wfls-prompt-overlay) {
    overflow: hidden;
}

body.login.glacier360-login-page #loginform:has(#wfls-prompt-overlay)
> :not(#wfls-prompt-overlay) {
    visibility: hidden;
}

body.login.glacier360-login-page #loginform #wfls-prompt-overlay {
    box-sizing: border-box;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 480px) {

    body.login.glacier360-login-page #login {
        max-width: 100%;

        padding:
            30px 16px 20px;
    }


    body.login.glacier360-login-page h1 {
        margin-bottom: 22px;
    }


    body.login.glacier360-login-page h1 a {
        font-size: 27px;
    }


    body.login.glacier360-login-page h1 a::before {
        width: 46px;
        height: 46px;

        border-radius: 12px;

        font-size: 24px;
    }


    body.login.glacier360-login-page #loginform {
        padding: 22px 18px;

        border-radius: 12px;
    }
}


/* =========================================================
 * REDUCED MOTION
 * ========================================================= */

@media (prefers-reduced-motion: reduce) {

    body.login.glacier360-login-page *,
    body.login.glacier360-login-page *::before,
    body.login.glacier360-login-page *::after {
        transition: none !important;
        animation: none !important;
    }
}