:root {
    color-scheme: light;

    --page-bg: #f4f6f8;
    --surface: #ffffff;
    --surface-subtle: #f8f9fb;
    --text: #16181d;
    --text-soft: #69717c;
    --text-muted: #969da7;
    --border: #dfe3e8;
    --border-strong: #c9ced6;
    --focus: #0056fe;
    --button: #0056fe;
    --button-hover: #0047d6;
    --button-active: #003bb5;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --danger-border: #fecdca;
    --success: #067647;
    --success-bg: #ecfdf3;
    --success-border: #abefc6;

    --radius-card: 18px;
    --radius-control: 10px;
    --shadow-card: 0 18px 50px rgba(24, 32, 44, .08), 0 2px 8px rgba(24, 32, 44, .04);
}

* {
    box-sizing: border-box;
}

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

html {
    background: var(--page-bg);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        linear-gradient(180deg, #ffffff 0, var(--page-bg) 46%, #f1f3f5 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

.login-shell {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 20px;
}

.login-shell::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 3px;
    background: #0056fe;
    pointer-events: none;
}

.login-card {
    width: min(100%, 390px);
    padding: 38px 38px 24px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(210, 215, 222, .82);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.login-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 66px;
    margin: 0 0 30px;
}

.login-logo {
    display: block;
    width: 148px;
    max-width: 58%;
    height: auto;
    object-fit: contain;
}

.login-form {
    display: grid;
    gap: 18px;
}

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

.field label {
    color: #333841;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: .01em;
}

.field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    outline: none;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 450;
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease,
        background-color 120ms ease;
}

.field input:hover {
    border-color: var(--border-strong);
}

.field input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(0, 86, 254, .16);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 9999s ease-out;
}

.feedback {
    display: none;
    min-height: 0;
    margin-top: -2px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.45;
}

.feedback:not(:empty) {
    display: block;
}

.feedback.is-error,
.feedback.error {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

.feedback.is-success,
.feedback.success {
    color: var(--success);
    background: var(--success-bg);
    border-color: var(--success-border);
}

.submit-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    margin-top: 2px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-control);
    background: var(--button);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .015em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
    transition:
        transform 100ms ease,
        background-color 120ms ease,
        box-shadow 120ms ease;
}

.submit-button:hover:not(:disabled) {
    background: var(--button-hover);
    box-shadow: 0 4px 12px rgba(0, 86, 254, .22);
}

.submit-button:active:not(:disabled) {
    transform: translateY(1px);
    background: var(--button-active);
    box-shadow: none;
}

.submit-button:focus-visible {
    outline: 3px solid rgba(0, 86, 254, .22);
    outline-offset: 2px;
}

.submit-button:disabled {
    cursor: wait;
    opacity: .72;
}

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

.submit-button.is-loading .button-label,
.submit-button[aria-busy="true"] .button-label {
    display: none;
}

.submit-button.is-loading .button-loader,
.submit-button[aria-busy="true"] .button-loader {
    display: inline-block;
}

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

.star-env-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 22px;
    user-select: none;
}

.star-env-switch__option,
.star-env-switch__separator {
    color: #adb2ba;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .015em;
}

.star-env-switch__option {
    text-decoration: none;
    transition: color 120ms ease;
}

.star-env-switch__option:hover,
.star-env-switch__option:focus-visible {
    color: #656c76;
}

.star-env-switch__option.is-active {
    color: #7c838d;
}

.star-env-switch__separator {
    color: #d0d4d9;
}

.access-dialog {
    width: min(calc(100vw - 32px), 380px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 24px 70px rgba(18, 24, 34, .18);
}

.access-dialog::backdrop {
    background: rgba(29, 33, 39, .24);
    backdrop-filter: blur(2px);
}

.access-dialog__body {
    padding: 24px 24px 22px;
}

.access-dialog__title {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.access-dialog__text {
    margin: 0;
    color: var(--text-soft);
    font-size: 12.5px;
    line-height: 1.55;
}

.access-dialog__actions {
    display: flex;
    justify-content: flex-end;
    padding: 14px 18px 18px;
    border-top: 1px solid #edf0f2;
}

.access-dialog__button {
    min-width: 84px;
    height: 38px;
    padding: 0 15px;
    border: 0;
    border-radius: 9px;
    background: #0056fe;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
}

.access-dialog__button:hover {
    background: #0047d6;
}

@media (max-width: 520px) {
    .login-shell {
        align-items: center;
        padding: 22px 16px;
    }

    .login-card {
        width: 100%;
        padding: 32px 24px 22px;
        border-radius: 16px;
        box-shadow: 0 14px 38px rgba(24, 32, 44, .07);
    }

    .login-brand {
        margin-bottom: 26px;
    }

    .login-logo {
        width: 138px;
    }
}

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