:root {
    --green: #008a45;
    --green-dark: #006b35;
    --green-soft: #eaf7f0;
    --red: #ed1b2f;
    --ink: #111827;
    --muted: #6b7280;
    --line: #dfe4ea;
    --surface: #ffffff;
    --background: #f4f7f6;
    --shadow: 0 28px 70px rgba(17, 24, 39, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    font-family: "Inter", sans-serif;
    color: var(--ink);
    background: var(--background);
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(430px, 46%) 1fr;
}

.brand-panel {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 54px clamp(42px, 5vw, 80px) 38px;
    color: #fff;
    background:
        radial-gradient(circle at 80% 16%, rgba(237, 27, 47, 0.34), transparent 26%),
        radial-gradient(circle at 8% 85%, rgba(0, 138, 69, 0.55), transparent 34%),
        linear-gradient(145deg, #06110b 0%, #092319 55%, #07130e 100%);
}

.brand-panel::before,
.brand-panel::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(2px);
}

.brand-panel::before {
    width: 370px;
    height: 370px;
    right: -210px;
    top: 30%;
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018);
}

.brand-panel::after {
    width: 240px;
    height: 240px;
    left: -125px;
    bottom: 10%;
    background: rgba(0, 138, 69, .13);
}

.brand-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .12;
    background-image:
        linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 70%, transparent);
}

.brand-content {
    max-width: 590px;
    margin: auto 0;
}

.logo-shell {
    width: 300px;
    height: 190px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    overflow: visible;
}

.brand-logo {
    display: block;
    width: 300px;
    height: 300px;
    object-fit: contain;
}

.eyebrow,
.welcome-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #8ee0b5;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.brand-copy h1 {
    max-width: 560px;
    margin: 0 0 20px;
    font-size: clamp(2.25rem, 4vw, 4.3rem);
    line-height: 1.05;
    letter-spacing: -.055em;
}

.brand-copy p {
    max-width: 540px;
    margin: 0;
    color: rgba(255,255,255,.72);
    font-size: 1.03rem;
    line-height: 1.8;
}

.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 38px;
}

.feature-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    color: rgba(255,255,255,.82);
    background: rgba(255,255,255,.055);
    font-size: .78rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.feature-item i {
    color: #8ee0b5;
}

.brand-footer {
    margin: 0;
    color: rgba(255,255,255,.45);
    font-size: .78rem;
    letter-spacing: .04em;
}

.form-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 42px 28px 24px;
    background:
        radial-gradient(circle at 85% 12%, rgba(0, 138, 69, .075), transparent 22%),
        var(--background);
}

.mobile-brand {
    display: none;
}

.login-card {
    width: min(100%, 480px);
    padding: clamp(30px, 4vw, 46px);
    border: 1px solid rgba(17, 24, 39, .07);
    border-radius: 26px;
    background: rgba(255,255,255,.97);
    box-shadow: var(--shadow);
}

.login-heading {
    margin-bottom: 30px;
}

.welcome-label {
    margin-bottom: 10px;
    color: var(--green);
}

.login-heading h2 {
    margin: 0 0 10px;
    font-size: clamp(1.85rem, 3vw, 2.45rem);
    line-height: 1.16;
    letter-spacing: -.04em;
}

.login-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.alert-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    padding: 13px 14px;
    border: 1px solid #f5c2c7;
    border-radius: 12px;
    color: #a51221;
    background: #fff0f1;
    font-size: .87rem;
    line-height: 1.5;
}

.alert-message i {
    margin-top: 1px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: inline-block;
    margin-bottom: 8px;
    color: #27303f;
    font-size: .86rem;
    font-weight: 700;
}

.label-row,
.options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.text-link {
    color: var(--green);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.input-wrap {
    position: relative;
}

.input-wrap > i:first-child {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a94a3;
    font-size: 1rem;
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 45px;
    border: 1px solid var(--line);
    border-radius: 13px;
    outline: none;
    color: var(--ink);
    background: #fbfcfd;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-wrap input::placeholder {
    color: #a1a9b5;
}

.input-wrap input:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0,138,69,.11);
}

.input-wrap input.invalid {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(237,27,47,.08);
}

.password-toggle {
    position: absolute;
    right: 7px;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: #687386;
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--green);
    background: var(--green-soft);
    outline: none;
}

.field-error {
    display: block;
    min-height: 18px;
    padding-top: 5px;
    color: var(--red);
    font-size: .75rem;
}

.options-row {
    margin: 2px 0 24px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #4b5563;
    font-size: .82rem;
    cursor: pointer;
}

.checkbox-label input {
    width: 17px;
    height: 17px;
    accent-color: var(--green);
}

.secure-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #7b8491;
    font-size: .75rem;
}

.secure-label i {
    color: var(--green);
}

.login-button {
    width: 100%;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    box-shadow: 0 13px 28px rgba(0, 138, 69, .22);
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(0, 138, 69, .28);
    filter: brightness(1.03);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    cursor: wait;
    opacity: .8;
}

.button-loader {
    display: none;
    width: 19px;
    height: 19px;
    border: 2px solid rgba(255,255,255,.42);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.login-button.loading .button-loader {
    display: block;
}

.login-button.loading .button-text,
.login-button.loading > i {
    display: none;
}

.support-note {
    margin: 23px 0 0;
    color: #8a93a0;
    font-size: .77rem;
    line-height: 1.6;
    text-align: center;
}

.page-footer {
    margin-top: 30px;
    color: #929ba7;
    font-size: .75rem;
}

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

@media (max-width: 980px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        min-height: 100vh;
        padding-top: 26px;
    }

    .mobile-brand {
        display: grid;
        place-items: center;
        width: 190px;
        height: 138px;
        margin-bottom: 14px;
        overflow: visible;
    }

    .mobile-brand img {
        display: block;
        width: 200px;
        height: 200px;
        object-fit: contain;
    }
}

@media (max-width: 520px) {
    .form-panel {
        justify-content: flex-start;
        padding: 22px 15px;
    }

    .login-card {
        padding: 27px 20px;
        border-radius: 21px;
    }

    .login-heading {
        margin-bottom: 24px;
    }

    .options-row {
        align-items: flex-start;
    }

    .secure-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* v115 - resilient mobile login / iPhone safe-area repair */
html,
body,
.login-page,
.form-panel {
    min-height: 100dvh;
}

.alert-message.is-warning {
    border-color: #f0d58a;
    color: #8a5b00;
    background: #fff9e8;
}

@media (max-width: 980px) {
    .form-panel {
        padding-top: calc(18px + env(safe-area-inset-top, 0px));
        padding-right: calc(22px + env(safe-area-inset-right, 0px));
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        padding-left: calc(22px + env(safe-area-inset-left, 0px));
    }

    .mobile-brand {
        width: 176px;
        height: 104px;
        margin: 0 0 12px;
        overflow: hidden;
    }

    .mobile-brand img {
        width: 176px;
        height: 176px;
        transform: translateY(-27px);
    }
}

@media (max-width: 520px) {
    .form-panel {
        justify-content: flex-start;
        padding-top: calc(14px + env(safe-area-inset-top, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
        padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
    }

    .mobile-brand {
        width: 160px;
        height: 96px;
        margin-bottom: 10px;
    }

    .mobile-brand img {
        width: 160px;
        height: 160px;
        transform: translateY(-24px);
    }

    .login-card {
        width: 100%;
        padding: 24px 20px 26px;
        border-radius: 20px;
    }

    .login-heading h2 {
        font-size: clamp(1.8rem, 8vw, 2.25rem);
    }

    .page-footer {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}
