:root {
    color-scheme: light;
    --ink: #16213a;
    --muted: #69758d;
    --line: #dfe5ef;
    --surface: #ffffff;
    --surface-soft: #f5f7fb;
    --primary: #6658d9;
    --primary-dark: #4c3fc2;
    --cyan: #25b7c7;
    --danger: #c83c55;
    --danger-soft: #fff1f3;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
}

body {
    background: var(--surface-soft);
    color: var(--ink);
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(390px, 0.92fr) minmax(500px, 1.08fr);
}

.brand-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(24, 30, 70, 0.2), transparent 48%),
        linear-gradient(145deg, #5146bd 0%, #6658d9 46%, #238da9 100%);
    color: #fff;
}

.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom right, black, transparent 78%);
}

.brand-panel__content {
    position: relative;
    min-height: 100%;
    padding: clamp(36px, 5vw, 76px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 56px;
}

.brand-panel__glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
    opacity: .26;
    pointer-events: none;
}

.brand-panel__glow--one {
    width: 380px;
    height: 380px;
    top: -160px;
    right: -160px;
    background: #54e3de;
}

.brand-panel__glow--two {
    width: 300px;
    height: 300px;
    bottom: -130px;
    left: -80px;
    background: #9d7dff;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    width: fit-content;
    color: inherit;
    text-decoration: none;
}

.brand__logo-wrap {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 18px;
    background: rgba(255,255,255,.93);
    box-shadow: 0 18px 38px rgba(28, 22, 87, .2);
}

.brand__logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.1rem;
    letter-spacing: .16em;
}

.brand small {
    margin-top: 4px;
    color: rgba(255,255,255,.76);
    font-size: .78rem;
}

.form-panel {
    display: grid;
    place-items: center;
    padding: clamp(26px, 6vw, 92px);
    background:
        radial-gradient(circle at 88% 12%, rgba(102,88,217,.1), transparent 24%),
        radial-gradient(circle at 8% 88%, rgba(37,183,199,.1), transparent 26%),
        var(--surface-soft);
}

.login-card {
    width: min(100%, 480px);
    padding: clamp(28px, 4vw, 48px);
    border: 1px solid rgba(211, 219, 233, .82);
    border-radius: 28px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 32px 80px rgba(30, 42, 77, .12);
    backdrop-filter: blur(12px);
}

.mobile-brand {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 13px;
    width: fit-content;
    margin: 0 auto 26px;
    color: var(--ink);
    text-decoration: none;
}

.mobile-brand__logo-wrap {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    border: 1px solid rgba(102, 88, 217, .16);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(45, 50, 88, .12);
}

.mobile-brand__logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.mobile-brand__copy {
    min-width: 0;
    text-align: left;
}

.mobile-brand__copy strong,
.mobile-brand__copy small {
    display: block;
}

.mobile-brand__copy strong {
    color: var(--ink);
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.25;
}

.mobile-brand__copy small {
    margin-top: 4px;
    color: var(--muted);
    font-size: .69rem;
    line-height: 1.35;
}

.login-card__header h2 {
    margin: 0;
    font-size: clamp(1.85rem, 3vw, 2.35rem);
    letter-spacing: -.035em;
}

.login-card__header p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 25px 0 0;
    padding: 13px 15px;
    border-radius: 13px;
    font-size: .88rem;
    line-height: 1.45;
}

.alert svg {
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    margin-top: 1px;
}

.alert--error {
    border: 1px solid #ffd2da;
    background: var(--danger-soft);
    color: #9b2940;
}

.alert--error svg {
    fill: var(--danger);
}

.login-form {
    margin-top: 31px;
}

.field-group + .field-group {
    margin-top: 20px;
}

.field-group label {
    display: block;
    margin: 0 0 8px;
    color: #303c55;
    font-size: .86rem;
    font-weight: 700;
}

.input-shell {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.input-shell:focus-within {
    border-color: rgba(102,88,217,.72);
    box-shadow: 0 0 0 4px rgba(102,88,217,.12);
}

.input-shell--error {
    border-color: #e88496;
}

.input-shell > svg {
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    fill: #8c97ab;
}

.input-shell input {
    min-width: 0;
    flex: 1;
    height: 52px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.input-shell input::placeholder {
    color: #a0a9ba;
}

.password-toggle {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #7e899e;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: #f0f2f7;
    outline: 0;
}

.password-toggle svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.password-toggle__hide,
.password-toggle[aria-pressed="true"] .password-toggle__show {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle__hide {
    display: block;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.form-options--single {
    justify-content: flex-end;
}

.password-help {
    color: #7b879b;
    font-size: .78rem;
    text-align: right;
}

.submit-button {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-top: 28px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #586fdb 58%, #278eaa);
    color: #fff;
    font-weight: 750;
    box-shadow: 0 16px 30px rgba(92, 80, 202, .25);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 34px rgba(92, 80, 202, .31);
    filter: saturate(1.05);
}

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

.submit-button:focus-visible {
    outline: 4px solid rgba(102,88,217,.2);
    outline-offset: 3px;
}

.submit-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.login-card__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    color: #8993a6;
    font-size: .75rem;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2ab789;
    box-shadow: 0 0 0 4px rgba(42,183,137,.12);
}

.separator {
    color: #c0c7d3;
}

@media (max-width: 960px) {
    .login-page {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .login-card {
        max-width: 100%;
        min-width: 0;
    }

    .mobile-brand {
        display: flex;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .mobile-brand__copy {
        flex: 0 1 auto;
        max-width: calc(100% - 71px);
    }

    .mobile-brand__copy strong,
    .mobile-brand__copy small {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 560px) {
    .form-panel {
        align-items: stretch;
        padding: 0;
        background: #fff;
    }

    .login-card {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 28px 28px 32px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .mobile-brand {
        margin-bottom: 24px;
    }

    .mobile-brand__logo-wrap {
        width: 54px;
        height: 54px;
        flex-basis: 54px;
        border-radius: 17px;
    }

    .mobile-brand__logo {
        width: 42px;
        height: 42px;
    }

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

    .password-help {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
