.login-page {
    min-width: 320px;
    min-height: 100vh;
    background: #F4F6F9;
}

.login-page__main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.login-shell {
    width: min(1120px, 100%);
    min-height: 690px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-modal);
    background: var(--color-surface);
    box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
}

.login-brand-panel {
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 72px 38px;
    border-right: 1px solid var(--color-border);
    background: #FAFBFD;
}

.login-brand-panel__content {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

.login-brand-panel__logo {
    display: block;
    width: 118px;
    height: auto;
    margin: 0 auto;
    user-select: none;
}

.login-brand-panel__title {
    margin: 18px 0 12px;
    color: var(--color-text-strong);
    font-size: 34px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.035em;
    text-align: center;
}

.login-brand-panel__description {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.75;
    font-weight: 400;
    letter-spacing: -0.01em;
    text-align: center;
}

.login-rail-illustration {
    position: relative;
    z-index: 0;
    width: 100%;
    margin-top: 30px;
    text-align: center;
}

.login-rail-illustration img {
    display: block;
    width: min(100%, 405px);
    height: auto;
    margin: 0 auto;
    user-select: none;
    pointer-events: none;
}

.login-brand-panel__system-credit {
    position: relative;
    z-index: 1;
    margin: auto 0 0;
    padding-top: 24px;
    text-align: center;
}

.login-brand-panel__system-credit p {
    margin: 0;
}

.login-brand-panel__system-name {
    color: #667085;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.login-brand-panel__developer {
    margin-top: 2px !important;
    color: #98A2B3;
    font-size: 10px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.login-form-panel {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 72px;
    background: var(--color-surface);
}

.login-form-panel__inner {
    width: min(100%, 384px);
}

.login-form-header {
    margin-bottom: 34px;
}

.login-form-header h2 {
    margin: 0;
    color: var(--color-text-strong);
    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.login-form-header p {
    margin: 10px 0 0;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: var(--radius-control);
    font-size: 13px;
    line-height: 1.55;
}

.login-alert--danger {
    border-color: #F2CACA;
    background: var(--color-danger-soft);
    color: #9E2F2F;
}

.login-alert__icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--color-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.login-form {
    margin: 0;
}

.login-field + .login-field {
    margin-top: 22px;
}

.login-field label {
    display: inline-block;
    margin-bottom: 9px;
    color: var(--color-text-strong);
    font-size: 14px;
    font-weight: 700;
}

.login-control {
    position: relative;
}

.login-control__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    display: inline-flex;
    width: 19px;
    height: 19px;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    color: #586272;
    pointer-events: none;
}

.login-control__icon img {
    display: block;
    width: 15px;
    height: 18px;
    object-fit: contain;
}

.login-password-toggle svg,
.login-modal__close svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-control input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 45px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-control);
    background: #fff;
    color: var(--color-text-strong);
    font-size: 14px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-control input::placeholder {
    color: #9CA3AF;
}

.login-control input:hover {
    border-color: #B8C0CB;
}

.login-control input:focus {
    border-color: var(--color-brand);
    box-shadow: var(--focus-ring);
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    padding: 7px;
    transform: translateY(-50%);
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: #596273;
    cursor: pointer;
}

.login-password-toggle:hover {
    background: var(--color-surface-muted);
    color: var(--color-text-strong);
}

.login-password-toggle__show {
    display: none;
}

.login-password-toggle__hide {
    display: block;
}

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

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

.login-capslock {
    display: none;
    margin: 8px 0 0;
    padding: 8px 10px;
    border: 1px solid #F1D19A;
    border-radius: var(--radius-control);
    background: var(--color-warning-soft);
    color: #8D4E00;
    font-size: 12px;
    line-height: 1.45;
}

.login-capslock.is-visible {
    display: block;
}

.login-support-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.login-support-link {
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: var(--color-brand-strong);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.login-support-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 28px;
    border: 1px solid var(--color-brand-strong);
    border-radius: var(--radius-control);
    background: var(--color-brand-strong);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}

.login-submit:hover {
    border-color: #4668AA;
    background: #4668AA;
}

.login-submit:active {
    background: #405F9C;
}

.login-modal[hidden] {
    display: none;
}

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 41, 55, 0.54);
}

.login-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-modal);
    background: #fff;
    box-shadow: var(--floating-shadow);
}

.login-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--color-border);
}

.login-modal__eyebrow {
    margin: 0 0 3px;
    color: var(--color-brand-strong);
    font-size: 12px;
    font-weight: 700;
}

.login-modal__header h2 {
    margin: 0;
    color: var(--color-text-strong);
    font-size: 19px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-modal__close {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}

.login-modal__close:hover {
    background: var(--color-surface-muted);
    color: var(--color-text-strong);
}

.login-modal__body {
    padding: 22px 24px;
}

.login-modal__notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid #D7E3F5;
    border-radius: var(--radius-panel);
    background: var(--color-info-soft);
}

.login-modal__notice-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.login-modal__notice strong {
    display: block;
    color: var(--color-text-strong);
    font-size: 14px;
    line-height: 1.5;
}

.login-modal__notice p {
    margin: 7px 0 0;
    color: var(--color-text);
    font-size: 13px;
    line-height: 1.7;
}

.login-modal__actions {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px 22px;
    border-top: 1px solid var(--color-border);
}

.login-modal__confirm {
    min-width: 92px;
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid var(--color-brand-strong);
    border-radius: var(--radius-control);
    background: var(--color-brand-strong);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.login-modal__confirm:hover {
    background: #4668AA;
}

body.is-login-modal-open {
    overflow: hidden;
}

@media (max-width: 980px) {
    .login-page__main {
        align-items: flex-start;
        padding: 24px;
    }

    .login-shell {
        width: min(680px, 100%);
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        min-height: 310px;
        padding: 42px 48px 28px;
        border-right: 0;
        border-bottom: 1px solid var(--color-border);
    }

    .login-rail-illustration {
        position: absolute;
        right: 24px;
        bottom: 38px;
        width: 48%;
        opacity: 0.62;
    }

    .login-brand-panel__system-credit {
        text-align: left;
    }

    .login-form-panel {
        padding: 48px;
    }
}

@media (max-width: 640px) {
    .login-page__main {
        padding: 0;
        background: #fff;
    }

    .login-shell {
        width: 100%;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-brand-panel {
        min-height: auto;
        padding: 32px 24px 28px;
    }

    .login-brand-panel__logo {
        width: 108px;
    }

    .login-brand-panel__title {
        margin-top: 14px;
        font-size: 28px;
    }

    .login-rail-illustration {
        display: none;
    }

    .login-brand-panel__system-credit {
        display: none;
    }

    .login-form-panel {
        padding: 38px 24px 48px;
    }

    .login-form-panel__inner {
        width: 100%;
    }

    .login-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .login-modal__dialog {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-control input,
    .login-submit {
        transition: none;
    }
}
