:root {
    --blue: #183567;
    --blue-deep: #10264c;
    --blue-soft: #23477e;
    --green: #8dcc19;
    --green-dark: #66a70f;
    --yellow: #ffbf12;
    --ink: #172033;
    --muted: #687387;
    --line: #dfe6ee;
    --surface: #ffffff;
    --page: #eef3f6;
    --danger: #b42318;
    --danger-bg: #fff4f2;
    --danger-line: #ffd1ca;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: Calibri, Candara, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

.login-page {
    position: relative;
    display: grid;
    place-items: center;
    overflow-x: hidden;
    padding: 38px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        linear-gradient(145deg, #f7f9fb 0%, #e9f0f3 58%, #edf3e7 100%);
    background-size: 38px 38px, 38px 38px, auto;
}

.page-glow {
    position: fixed;
    z-index: 0;
    width: 390px;
    height: 390px;
    border-radius: 50%;
    filter: blur(8px);
    pointer-events: none;
}

.page-glow--green {
    top: -190px;
    right: -80px;
    background: radial-gradient(circle, rgba(141, 204, 25, 0.22), transparent 68%);
}

.page-glow--yellow {
    bottom: -230px;
    left: -90px;
    background: radial-gradient(circle, rgba(255, 191, 18, 0.17), transparent 68%);
}

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(450px, 1.06fr) minmax(390px, 0.94fr);
    width: min(1080px, 100%);
    min-height: min(680px, calc(100vh - 76px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 30px;
    background: var(--surface);
    box-shadow:
        0 30px 80px rgba(18, 38, 62, 0.16),
        0 6px 18px rgba(18, 38, 62, 0.08);
}

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    overflow: hidden;
    padding: clamp(40px, 5vw, 64px);
    color: #ffffff;
    background:
        radial-gradient(circle at 88% 12%, rgba(141, 204, 25, 0.23), transparent 30%),
        linear-gradient(145deg, var(--blue-soft), var(--blue-deep) 72%);
}

.brand-panel::before,
.brand-panel::after {
    position: absolute;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
    pointer-events: none;
}

.brand-panel::before {
    top: -130px;
    right: -170px;
    width: 430px;
    height: 430px;
}

.brand-panel::after {
    right: -80px;
    bottom: -150px;
    width: 360px;
    height: 360px;
}

.brand-panel__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.brand-logo-wrap {
    display: grid;
    place-items: center;
    width: 236px;
    height: 116px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 18px 36px rgba(4, 19, 45, 0.22);
}

.brand-logo {
    display: block;
    width: calc(100% - 14px);
    height: auto;
    max-width: none;
    transform: translateY(-20%);
}

.brand-copy {
    display: grid;
    gap: 16px;
    margin-top: clamp(56px, 8vh, 90px);
}

.brand-kicker,
.eyebrow {
    color: var(--green);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.brand-kicker {
    display: inline-flex;
    gap: 9px;
    align-items: center;
}

.brand-kicker__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 5px rgba(141, 204, 25, 0.14);
}

.brand-copy h1,
.form-heading h2 {
    margin: 0;
}

.brand-copy h1 {
    max-width: 440px;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.brand-copy p {
    max-width: 430px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.98rem;
    line-height: 1.7;
}

.brand-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: auto;
    padding-top: 44px;
}

.brand-feature {
    display: flex;
    gap: 11px;
    align-items: center;
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
}

.brand-feature__icon {
    display: grid;
    flex: 0 0 36px;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    color: var(--green);
    background: rgba(141, 204, 25, 0.13);
}

.brand-feature__icon svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.brand-feature > span:last-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.brand-feature strong {
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-feature small {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-road {
    position: absolute;
    z-index: 1;
    right: -70px;
    bottom: 72px;
    left: -70px;
    height: 2px;
    transform: rotate(-8deg);
    opacity: 0.1;
}

.brand-road::before {
    position: absolute;
    inset: 0;
    content: "";
    background: #fff;
}

.brand-road span {
    position: absolute;
    top: -1px;
    width: 34px;
    height: 4px;
    background: var(--yellow);
}

.brand-road span:nth-child(1) {
    left: 22%;
}

.brand-road span:nth-child(2) {
    left: 49%;
}

.brand-road span:nth-child(3) {
    left: 76%;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: clamp(42px, 6vw, 78px);
    background:
        radial-gradient(circle at 100% 0, rgba(141, 204, 25, 0.08), transparent 28%),
        #ffffff;
}

.login-card {
    display: grid;
    gap: 19px;
    width: min(380px, 100%);
}

.form-heading {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.form-heading h2 {
    color: var(--blue);
    font-size: clamp(1.85rem, 3vw, 2.25rem);
    line-height: 1.14;
    letter-spacing: -0.035em;
}

.form-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.alert {
    display: grid;
    grid-template-columns: 26px 1fr 24px;
    gap: 11px;
    align-items: start;
    padding: 12px 13px;
    border: 1px solid var(--danger-line);
    border-radius: 13px;
    color: var(--danger);
    background: var(--danger-bg);
    box-shadow: 0 8px 22px rgba(180, 35, 24, 0.07);
    font-size: 0.8rem;
    line-height: 1.45;
}

.alert-icon {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    color: #fff;
    background: var(--danger);
}

.alert-icon svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.alert-content {
    display: grid;
    gap: 2px;
}

.alert-content strong {
    color: #7a1b14;
    font-size: 0.81rem;
}

.alert-close {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 7px;
    color: #8b2b22;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.alert-close:hover {
    background: rgba(180, 35, 24, 0.09);
}

.field {
    display: grid;
    gap: 8px;
}

.field__label {
    color: #33415b;
    font-size: 0.79rem;
    font-weight: 750;
}

.field__control {
    position: relative;
    display: block;
}

.field__icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 16px;
    width: 19px;
    transform: translateY(-50%);
    fill: none;
    stroke: #8792a5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    pointer-events: none;
    transition: stroke 180ms ease;
}

.field input {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 0 46px;
    color: var(--ink);
    background: #f9fbfc;
    font-size: 0.89rem;
    outline: none;
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease,
        transform 180ms ease;
}

.field input::placeholder {
    color: #98a1af;
}

.field__control:focus-within input {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(141, 204, 25, 0.14);
}

.field__control:focus-within .field__icon {
    stroke: var(--green-dark);
}

.password-toggle {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 11px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    color: #7c8799;
    background: transparent;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease;
}

.password-toggle:hover {
    color: var(--blue);
    background: #edf2f6;
}

.password-toggle svg {
    position: absolute;
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open {
    display: none;
}

.password-toggle.is-visible .eye-closed {
    display: block;
}

.submit-button {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 56px;
    margin-top: 5px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #91d120 0%, #67ac10 100%);
    box-shadow: 0 12px 24px rgba(102, 167, 15, 0.24);
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.submit-button::before {
    position: absolute;
    inset: 0;
    content: "";
    transform: translateX(-110%);
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.22), transparent 80%);
    transition: transform 520ms ease;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(102, 167, 15, 0.3);
    filter: saturate(1.08);
}

.submit-button:hover::before {
    transform: translateX(110%);
}

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

.submit-button:focus-visible,
.password-toggle:focus-visible,
.alert-close:focus-visible {
    outline: 3px solid rgba(24, 53, 103, 0.25);
    outline-offset: 2px;
}

.button-label {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    transition: opacity 120ms ease, transform 180ms ease;
}

.button-label svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.1;
    transition: transform 180ms ease;
}

.submit-button:hover .button-label svg {
    transform: translateX(3px);
}

.button-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-copy {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.loading-copy::after {
    content: "";
    animation: loadingDots 1.2s steps(4, end) infinite;
}

.login-card.is-loading .button-label {
    transform: translateY(5px);
    opacity: 0;
    transition: none;
}

.login-card.is-loading .button-loader {
    display: flex;
}

.login-card.is-loading .submit-button {
    pointer-events: none;
}

.login-card.is-loading .submit-button::before {
    display: none;
}

.secure-note {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    color: #7a8595;
    font-size: 0.72rem;
}

.secure-note svg {
    width: 16px;
    fill: none;
    stroke: var(--green-dark);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

@keyframes loadingDots {
    0% {
        content: "";
    }
    25% {
        content: ".";
    }
    50% {
        content: "..";
    }
    75%,
    100% {
        content: "...";
    }
}

@media (max-width: 900px) {
    .login-page {
        padding: 24px;
    }

    .login-shell {
        grid-template-columns: minmax(340px, 0.92fr) minmax(380px, 1.08fr);
        min-height: min(640px, calc(100vh - 48px));
    }

    .brand-panel {
        padding: 38px;
    }

    .brand-copy h1 {
        font-size: 2rem;
    }

    .brand-features {
        grid-template-columns: 1fr;
    }

    .brand-feature:nth-child(2) {
        display: none;
    }

    .login-panel {
        padding: 42px;
    }
}

@media (max-width: 720px) {
    .login-page {
        display: block;
        padding: 0;
        background: #fff;
    }

    .page-glow {
        display: none;
    }

    .login-shell {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .brand-panel {
        flex: 0 0 auto;
        min-height: 250px;
        padding: 28px 24px 34px;
        border-radius: 0 0 30px 30px;
    }

    .brand-logo-wrap {
        width: 174px;
        height: 82px;
        border-radius: 14px;
    }

    .brand-logo {
        width: calc(100% - 12px);
        height: auto;
    }

    .brand-copy {
        gap: 11px;
        margin-top: 27px;
    }

    .brand-copy h1 {
        max-width: 350px;
        font-size: 1.7rem;
        line-height: 1.12;
    }

    .brand-copy p {
        display: none;
    }

    .brand-features,
    .brand-road {
        display: none;
    }

    .login-panel {
        flex: 1;
        place-items: start center;
        padding: 38px 24px 34px;
        background: #fff;
    }

    .login-card {
        width: min(420px, 100%);
    }

    .form-heading {
        margin-bottom: 4px;
    }

    .form-heading h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 390px) {
    .brand-panel {
        min-height: 225px;
        padding: 22px 20px 28px;
    }

    .brand-logo-wrap {
        width: 154px;
        height: 70px;
    }

    .brand-logo {
        width: calc(100% - 10px);
        height: auto;
    }

    .brand-copy {
        margin-top: 22px;
    }

    .brand-copy h1 {
        font-size: 1.5rem;
    }

    .login-panel {
        padding: 30px 20px;
    }

    .form-heading h2 {
        font-size: 1.58rem;
    }

}

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