/* The login page is the only page that does not load pages.css, so the two
   things the portal shares have to be repeated here: the font stack and the
   green icon tokens. Keep both in step with cssPages/pages.css.

   Inter used to be named here but was never loaded, so this page silently fell
   back to Arial while every admin page rendered in Segoe UI. */
:root {
    --icon: #2f8f4e;
    --icon-muted: #578563;
    /* The left panel sits on a dark photograph, so its icons take the lifted
       dark-mode green and a green tint rather than the light-mode value. */
    --icon-on-dark: #6fcf8e;
    --icon-tint: rgba(47, 143, 78, 0.14);
    --icon-tint-on-dark: rgba(111, 207, 142, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    min-height: 100vh;
    /* Dark behind the photo, so nothing light flashes while it loads. */
    background: #0b140e;
}

/* Full screen: the photo covers the whole window. One column inside it --
   brand on top, the login card centred in the space left over, and the
   features card along the bottom. .left-panel steps out of the way
   (display: contents) so its logo and features card can take their own
   rows either side of the login card. */
.container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    row-gap: 28px;
    padding: 28px clamp(16px, 4vw, 56px) 32px;
    overflow: hidden;

    background-image: url("../assets/images/bgimage.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    isolation: isolate;
}

.container > .right-panel,
.container .logo,
.container .overlay-box {
    position: relative;
    z-index: 1;
}

/* Two columns, as the page was originally: brand top-left, the features
   card along the bottom-left, and the login card on the right, centred
   top to bottom. Below 1024px it stacks (see the media query further down). */
.container {
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr);
    column-gap: clamp(24px, 4vw, 64px);
}
.container .logo {
    grid-column: 1;
    grid-row: 1;
}
.container .overlay-box {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    max-width: 760px;
    /* Sits a little lower than the page padding, closer to the bottom edge. */
    margin-bottom: -18px;
}
.container > .right-panel {
    grid-column: 2;
    grid-row: 1 / -1;
}

.left-panel {
    display: contents;
}

.logo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1;
}

.logo img {
    width: 56px;
}

.logo h1 {
    color: #104213;
    font-size: 32px;
    line-height: 1;
}

.logo span {
    color: #062f0c;
}

.logo p {
    color: rgba(12, 64, 25, 0.88);
    font-size: 14px;
    line-height: 1.7;
}

.overlay-box {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    border-radius: 28px;
    padding: 25px;

    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    align-items: center;
    gap: 25px;

    border: 1px solid rgba(255, 255, 255, 0.15);
}

.divider {
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
}

.feature {
    display: flex;
    gap: 16px;
    margin-bottom: 26px;
}

.features {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature:last-child {
    margin-bottom: 0;
}

.feature i {
    width: 46px;
    height: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: var(--icon-tint-on-dark);
    color: var(--icon-on-dark);
    font-size: 18px;
}

.feature h3 {
    margin-bottom: 5px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

.feature p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 13.5px;
}

.empower {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empower img {
    width: 120px;
    margin-bottom: 18px;
}

.empower h1 {
    color: #e8d319;
    font-size: 38px;
    margin-bottom: 5px;
}

.empower h4 {
    color: white;
    font-size: 22px;
    margin-bottom: 12px;
    margin-left: 0;
}

.empower p {
    color: #ddd;
    font-size: 15px;
    line-height: 1.8;
}

.empower h1 {
    color: #4f9d5c;
}

.empower h4 {
    color: #ffffff;
    margin-left: 10px;
}

.empower p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
    line-height: 1.9;
    max-width: 300px;
}

.right-panel {
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    width: 100%;
    max-width: 470px;
    background: #ffffff;
    padding: 44px 42px;
    border-radius: 28px;
    box-shadow: 0 22px 54px rgba(19, 39, 63, 0.12);
}

.shield {
    width: 88px;
    height: 88px;
    margin: 0 auto 18px;
    border-radius: 24px;
    background: var(--icon-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icon);
    font-size: 34px;
}

.login-card h1 {
    text-align: center;
    color: #14242f;
    margin-bottom: 10px;
    font-size: 32px;
}

.login-card p {
    text-align: center;
    color: #5c6f7f;
    margin-bottom: 28px;
    font-size: 15px;
}

.card-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 32px;
}

.card-divider span {
    flex: 1;
    height: 1px;
    background: #e8eef5;
}

.card-divider .divider-icon {
    color: var(--icon);
    font-size: 20px;
}

.line {
    display: none;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #2d3e4d;
    font-size: 13.5px;
}

.input-box {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #dae4eb;
    border-radius: 16px;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: #f8fbfd;
}

.input-box i {
    color: var(--icon-muted);
    min-width: 20px;
    text-align: center;
}

.input-box input {
    width: 100%;
    border: none;
    outline: none;
    padding: 0;
    font-size: 15px;
    color: #24323f;
    background: transparent;
}

.password-box {
    position: relative;
}

.password-box input {
    flex: 1;
}

.password-toggle {
    width: auto;
    padding: 0;
    background: transparent;
    color: var(--icon-muted);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    min-width: 20px;
}

.password-toggle:hover {
    background: transparent;
}

.password-toggle i {
    pointer-events: none;
}

.input-box input::placeholder {
    color: #a3afbc;
}

.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    font-size: 14px;
    color: #5f707d;
}

.options label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #5f707d;
    font-weight: 500;
}

.options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1e7f41;
}

.options a {
    color: #1e7f41;
    text-decoration: none;
    font-weight: 600;
}

button {
    width: 100%;
    padding: 16px 0;
    border: none;
    border-radius: 16px;
    background: linear-gradient(90deg, #1d7f3f 0%, #0f9a4e 100%);
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.25s ease;
}

button:hover {
    background: linear-gradient(90deg, #166737 0%, #0d7e44 100%);
}

.footer {
    margin-top: 28px;
    text-align: center;
    color: #8d9aa6;
    font-size: 13px;
    line-height: 1.8;
}

.footer i {
    color: var(--icon);
    margin-right: 8px;
}

/* ==========================================================================
   Login card as dark frosted glass: the photo behind it shows through,
   blurred and darkened, and the text inside flips to light colours.
   Scoped to .login-card so the modals keep their light styling.
   ========================================================================== */
.login-card {
    background: rgba(8, 14, 10, 0.55);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Browsers without backdrop blur get a solid dark card, still readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .login-card {
        background: rgba(8, 14, 10, 0.88);
    }
}

.login-card .shield {
    background: rgba(79, 157, 92, 0.18);
    color: #6fcf86;
}
.login-card h1 {
    color: #ffffff;
}
.login-card p {
    color: rgba(255, 255, 255, 0.72);
}
.login-card .card-divider span {
    background: rgba(255, 255, 255, 0.16);
}
.login-card .card-divider .divider-icon {
    color: #6fcf86;
}

.login-card label {
    color: rgba(255, 255, 255, 0.9);
}

.login-card .input-box {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}
.login-card .input-box:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: #4fbf6a;
}
.login-card .input-box i,
.login-card .password-toggle {
    color: rgba(255, 255, 255, 0.65);
}
.login-card .input-box input {
    color: #ffffff;
}
.login-card .input-box input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}
/* Chrome's autofill paints its own light box; keep it dark. */
.login-card .input-box input:-webkit-autofill {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0 1000px rgba(20, 30, 24, 1) inset;
    caret-color: #ffffff;
    transition: background-color 9999s ease-out;
}

.login-card .options,
.login-card .options label {
    color: rgba(255, 255, 255, 0.75);
}
.login-card .options input[type="checkbox"] {
    accent-color: #2f9e55;
}
.login-card .options a {
    color: #6fcf86;
}
.login-card .options a:hover {
    text-decoration: underline;
}

.login-card .footer {
    color: rgba(255, 255, 255, 0.55);
}
.login-card .footer i {
    color: #6fcf86;
}

/* ==========================================================================
   Design polish
   ========================================================================== */

/* A shade over the photo: darker at the top (behind the brand) and the
   bottom (behind the features card), clear in the middle so the forest
   still shows around the login card. ::after paints above the photo but
   below the content, which sits at z-index 1. */
.container::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(4, 12, 6, 0.62) 0%,
            rgba(4, 12, 6, 0.18) 22%,
            rgba(4, 12, 6, 0.1) 50%,
            rgba(4, 12, 6, 0.3) 72%,
            rgba(4, 12, 6, 0.72) 100%
        ),
        radial-gradient(ellipse 60% 55% at 50% 50%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 100%);
}

/* Brand: white on the shaded top edge, readable over any part of the photo. */
.logo img {
    width: 52px;
    height: 52px;
    padding: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    object-fit: contain;
}
.logo h1 {
    color: #ffffff;
    font-size: 28px;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.logo span {
    color: #7ddc96;
}
.logo p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* Login card: a touch narrower and tighter, with a lit top edge. */
.login-card {
    max-width: 440px;
    padding: 38px 38px 30px;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 40%),
        rgba(8, 14, 10, 0.58);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.16) inset,
        0 30px 70px -10px rgba(0, 0, 0, 0.55);
}
.login-card .shield {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 18px;
    font-size: 26px;
    background: linear-gradient(145deg, rgba(111, 207, 134, 0.28), rgba(47, 143, 78, 0.14));
    border: 1px solid rgba(111, 207, 134, 0.3);
    box-shadow: 0 8px 24px -6px rgba(47, 143, 78, 0.5);
}
.login-card h1 {
    font-size: 28px;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}
.login-card > p {
    font-size: 14px;
    margin-bottom: 22px;
}
.login-card .card-divider {
    margin-bottom: 24px;
    gap: 14px;
}
.login-card .card-divider .divider-icon {
    font-size: 15px;
    opacity: 0.85;
}

.login-card label {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

/* Inputs: a hover hint and a soft green ring on focus. */
.login-card .input-box {
    border-radius: 14px;
    padding: 13px 15px;
    margin-bottom: 18px;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}
.login-card .input-box:hover {
    border-color: rgba(255, 255, 255, 0.3);
}
.login-card .input-box:focus-within {
    box-shadow: 0 0 0 4px rgba(79, 191, 106, 0.18);
}
.login-card .input-box:focus-within i {
    color: #7ddc96;
}
.login-card .password-toggle {
    border-radius: 8px;
    padding: 4px;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}
.login-card .password-toggle:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.login-card .options {
    margin: 4px 0 24px;
    font-size: 13px;
}
.login-card .options label {
    font-size: 13px;
    letter-spacing: 0;
    margin: 0;
    cursor: pointer;
}

/* Sign in: brighter gradient, a green glow, a small lift on hover and a
   press on click. Scoped to the submit button so the eye toggle and the
   modal buttons are untouched. */
.login-card button[type="submit"] {
    padding: 15px 0;
    border-radius: 14px;
    font-size: 16px;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, #25a357 0%, #178a45 55%, #0f7a3c 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.25) inset,
        0 12px 28px -10px rgba(37, 163, 87, 0.75);
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}
.login-card button[type="submit"]:hover {
    background: linear-gradient(135deg, #25a357 0%, #178a45 55%, #0f7a3c 100%);
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.25) inset,
        0 16px 34px -10px rgba(37, 163, 87, 0.85);
}
.login-card button[type="submit"]:active {
    transform: translateY(0);
    filter: brightness(0.96);
}
.login-card button[type="submit"]:disabled {
    cursor: default;
    filter: saturate(0.6) brightness(0.9);
    transform: none;
}

/* Keyboard focus is always visible. */
.login-card a:focus-visible,
.login-card button:focus-visible,
.login-card input[type="checkbox"]:focus-visible {
    outline: 2px solid #7ddc96;
    outline-offset: 3px;
    border-radius: 6px;
}

.login-card .footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    line-height: 1.7;
}
.login-card .footer br + br {
    display: none;
}

/* Features card: matching glass, with each feature lifting on hover. */
.overlay-box {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 50%),
        rgba(6, 12, 8, 0.5);
    /* Heavier frost, so the photo behind reads only as colour and light. */
    backdrop-filter: blur(34px) saturate(1.15);
    -webkit-backdrop-filter: blur(34px) saturate(1.15);
    border-radius: 24px;
    padding: 26px 30px;
    column-gap: 30px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 24px 60px -16px rgba(0, 0, 0, 0.5);
}
.feature {
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 8px 10px;
    margin-left: -10px;
    border-radius: 14px;
    transition: background 0.2s ease;
}
.feature:hover {
    background: rgba(255, 255, 255, 0.05);
}
.feature i {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 16px;
    border: 1px solid rgba(111, 207, 142, 0.22);
}
.feature h3 {
    font-size: 14.5px;
    margin-bottom: 3px;
}
.feature p {
    font-size: 13px;
    line-height: 1.55;
}

.empower img {
    width: 84px;
    margin-bottom: 10px;
}
.empower h1 {
    color: #7ddc96;
    font-size: 34px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.empower h4 {
    font-size: 19px;
    margin: 2px 0 10px;
}
.empower p {
    font-size: 13.5px;
    line-height: 1.75;
}

/* A gentle entrance: brand, then the login card, then the features. */
@keyframes loginRise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.container .logo {
    animation: loginRise 0.6s ease-out both;
}
.container > .right-panel {
    animation: loginRise 0.6s 0.08s ease-out both;
}
.container .overlay-box {
    animation: loginRise 0.6s 0.18s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .container .logo,
    .container > .right-panel,
    .container .overlay-box {
        animation: none;
    }
    .login-card button[type="submit"],
    .login-card button[type="submit"]:hover {
        transform: none;
        transition: none;
    }
}

/* Tablets and phones: one column -- brand, login card, then features. */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: minmax(0, 1fr);
    }
    .container .logo {
        grid-column: 1;
        grid-row: 1;
    }
    .container > .right-panel {
        grid-column: 1;
        grid-row: 2;
    }
    .container .overlay-box {
        grid-column: 1;
        grid-row: 3;
        max-width: none;
        margin-bottom: 0;
    }
}

/* Narrower screens: the features card stacks its two halves, with the
   divider turned sideways between them. */
@media (max-width: 860px) {
    .container {
        padding: 28px 24px 28px;
        row-gap: 22px;
    }

    .overlay-box {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .overlay-box .divider {
        width: 100%;
        height: 1px;
    }
}

@media (max-width: 680px) {
    .container {
        padding: 22px 16px 18px;
    }
    .overlay-box {
        padding: 22px;
    }
    .login-card {
        padding: 28px 24px;
    }
    .input-box {
        padding: 12px 14px;
    }
    button {
        padding: 14px 0;
    }
}

/* Error Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 42px;
    color: #d9534f;
    margin-bottom: 12px;
}

.modal-box h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1a1a1a;
}

.modal-box p {
    margin: 0 0 20px;
    color: #555;
    font-size: 14px;
}

.modal-btn {
    background: #1e7e34;
    color: #fff;
    border: none;
    padding: 10px 32px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.modal-btn:hover {
    background: #17692b;
}

/* Forgot Password Modal */
.forgot-box {
    max-width: 420px;
    /* The code step is tall; on a short screen it scrolls inside itself. */
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

/* Round green tile at the top of each step. */
.forgot-badge {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--icon-tint);
    color: #1e7f41;
    font-size: 24px;
}

.forgot-badge.is-success {
    border-radius: 50%;
    font-size: 28px;
}

.forgot-step[hidden] {
    display: none;
}

.forgot-step {
    animation: modalPop 0.2s ease-out;
}

.forgot-box p strong {
    color: #1a1a1a;
    overflow-wrap: anywhere;
}

.forgot-box label {
    margin-bottom: 8px;
    text-align: left;
    font-size: 13px;
}

.forgot-box .input-box {
    margin-bottom: 12px;
    text-align: left;
}

.forgot-box .input-box:focus-within {
    border-color: #1e7f41;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 127, 65, 0.14);
}

.forgot-box .input-box.invalid:focus-within {
    border-color: #e3a29b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

/* The six code boxes. */
.code-inputs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 0 20px;
}

.code-digit {
    flex: 1 1 0;
    min-width: 0;
    max-width: 50px;
    height: 56px;
    border: 1px solid #dae4eb;
    border-radius: 12px;
    background: #f8fbfd;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #17232d;
    caret-color: #1e7f41;
    font-variant-numeric: tabular-nums;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.code-digit:focus {
    outline: none;
    border-color: #1e7f41;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 127, 65, 0.14);
}

.code-inputs.invalid .code-digit {
    border-color: #e3a29b;
    background: #fff8f7;
}

.forgot-box .resend-row {
    margin: 16px 0 0;
    font-size: 13px;
    color: #6b7885;
}

/* A text link that is really a button; undoes the page's big green button. */
.link-btn {
    display: inline;
    width: auto;
    padding: 0;
    border-radius: 0;
    background: none;
    color: #1e7f41;
    font-size: 13px;
    font-weight: 700;
}

.link-btn:hover {
    background: none;
    text-decoration: underline;
}

.link-btn:disabled {
    color: #9aa6b1;
    cursor: default;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

#verifySubmit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .forgot-step {
        animation: none;
    }
}

.forgot-box input[readonly] {
    cursor: default;
}

.forgot-box .forgot-status {
    min-height: 18px;
    margin: 0 0 16px;
    font-size: 13px;
    text-align: left;
}

.forgot-status.error {
    color: #d9534f;
}

.forgot-status.success {
    color: #1e7f41;
}

.forgot-actions {
    display: flex;
    gap: 12px;
}

.forgot-actions .modal-btn {
    flex: 1;
    padding: 12px 0;
}

.modal-btn-secondary {
    background: #eef2f5;
    color: #445361;
}

.modal-btn-secondary:hover {
    background: #dfe5ea;
}

.modal-btn:focus-visible,
.link-btn:focus-visible,
.forgot-box .password-toggle:focus-visible {
    outline: 3px solid rgba(30, 127, 65, 0.35);
    outline-offset: 2px;
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Sign-in alert =====
   Replaces the old centered "red icon + OK" popup. The variant attribute
   picks the accent: danger for credential/access problems, warning for
   things the admin can fix by waiting or retyping. */
.alert-box {
    --alert-accent: #c0392b;
    --alert-tint: rgba(192, 57, 43, 0.1);
    --alert-soft: #fdf3f2;

    position: relative;
    width: 92%;
    max-width: 420px;
    padding: 26px 26px 22px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e6ecf0;
    box-shadow:
        0 24px 60px rgba(16, 32, 24, 0.22),
        0 2px 6px rgba(16, 32, 24, 0.08);
    overflow: hidden;
    animation: alertIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.alert-box[data-variant="warning"] {
    --alert-accent: #b7791f;
    --alert-tint: rgba(214, 158, 46, 0.14);
    --alert-soft: #fdf8ee;
}

/* Thin accent bar across the top edge. */
.alert-box::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--alert-accent), transparent 85%);
}

@keyframes alertIn {
    from {
        transform: translateY(12px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-overlay:has(.alert-box) {
    background: rgba(12, 24, 18, 0.45);
}

.alert-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.alert-badge {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--alert-tint);
    color: var(--alert-accent);
    font-size: 19px;
}

.alert-heading {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.alert-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--alert-accent);
}

.alert-heading h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #17232d;
    line-height: 1.25;
}

.alert-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: -4px -6px 0 0;
    border-radius: 10px;
    background: transparent;
    color: #8d9aa6;
    font-size: 16px;
}

.alert-close:hover {
    background: #f1f4f6;
    color: #3d4b57;
}

.alert-message {
    margin: 0 0 16px;
    font-size: 14.5px;
    line-height: 1.6;
    color: #4a5966;
}

.alert-hint {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--alert-soft);
    font-size: 13px;
    line-height: 1.5;
    color: #5b6873;
}

.alert-hint[hidden] {
    display: none;
}

.alert-hint i {
    margin-top: 2px;
    color: var(--alert-accent);
}

.alert-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.alert-btn {
    width: auto;
    padding: 11px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
}

.alert-btn[hidden] {
    display: none;
}

.alert-btn-primary {
    min-width: 120px;
}

.alert-btn-ghost {
    background: #ffffff;
    color: #1e7f41;
    border: 1px solid #cfe3d6;
}

.alert-btn-ghost:hover {
    background: #f1f8f3;
}

.alert-btn:focus-visible,
.alert-close:focus-visible {
    outline: 3px solid rgba(30, 127, 65, 0.35);
    outline-offset: 2px;
}

@media (max-width: 420px) {
    .alert-actions {
        flex-direction: column-reverse;
    }
    .alert-btn {
        width: 100%;
    }
}

/* In-form feedback: the card shakes and the offending fields turn red,
   so the error is visible where the admin is looking, not only in the alert. */
.login-card.shake {
    animation: cardShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes cardShake {
    15%,
    85% {
        transform: translateX(-2px);
    }
    30%,
    70% {
        transform: translateX(5px);
    }
    45%,
    55% {
        transform: translateX(-7px);
    }
    50% {
        transform: translateX(7px);
    }
}

.input-box.invalid {
    border-color: #e3a29b;
    background: #fff8f7;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

.input-box.invalid > i:first-child {
    color: #c0392b;
}

/* The same on the dark glass card: the light pink box above would sit under
   white text and hide it, so here the box stays dark with a red tint and
   the text stays white. */
.login-card .input-box.invalid {
    background: rgba(220, 60, 50, 0.14);
    border-color: #ff7a6e;
    box-shadow: 0 0 0 4px rgba(255, 90, 80, 0.18);
}
.login-card .input-box.invalid:focus-within {
    background: rgba(220, 60, 50, 0.18);
    border-color: #ff8f84;
}
.login-card .input-box.invalid > i:first-child,
.login-card .input-box.invalid:focus-within > i:first-child {
    color: #ff8f84;
}
.login-card .input-box.invalid input {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}
.login-card .input-box.invalid input::placeholder {
    color: rgba(255, 220, 216, 0.6);
}
/* A saved (autofilled) value keeps its dark box too, now red-tinted. */
.login-card .input-box.invalid input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #3a1c1a inset;
}

/* Sign-in button while the request is in flight. */
#loginForm button[type="submit"]:disabled {
    opacity: 0.75;
    cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
    .alert-box,
    .login-card.shake {
        animation: none;
    }
}

/* The sign-in alert can open on top of the Forgot Password window (for an
   email that is not a registered admin), so it stacks above it. */
#errorModal {
    z-index: 1100;
}

/* Edge (and old IE) draw their own black "reveal password" eye inside every
   password field. The page has its own show/hide button, so hide the
   browser's to avoid two eyes side by side. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}
