:root {
    color-scheme: dark;
    --background: #070c13;
    --surface: #0c141e;
    --field: #101925;
    --text: #edf5fa;
    --muted: #99adbf;
    --border: #213347;
    --field-border: rgba(72, 186, 255, 0.3);
    --accent: #48baff;
    --button-text: #040d13;
    --focus-ring: rgba(72, 186, 255, 0.28);
    --error: #ff9c9c;
    font-family: Inter, Arial, Helvetica, sans-serif;
}

:root[data-theme="light"] {
    color-scheme: light;
    --background: #f5f7fa;
    --surface: #ffffff;
    --field: #e8eaef;
    --text: #1a1d21;
    --muted: #6b7280;
    --border: #e5e7eb;
    --field-border: #d1d5db;
    --accent: #2563eb;
    --button-text: #040d13;
    --focus-ring: rgba(37, 99, 235, 0.2);
    --error: #b42318;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);
}

button,
input {
    font: inherit;
}

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

a {
    color: var(--accent);
    text-underline-offset: 0.18em;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.login-header {
    position: fixed;
    z-index: 2;
    top: 28px;
    right: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}

.brand-emblem {
    position: relative;
    width: 28px;
    height: 28px;
    overflow: hidden;
    flex: 0 0 28px;
}

.brand-emblem img {
    position: absolute;
    top: 0;
    left: 0;
    width: 77.78px;
    height: 28px;
    max-width: none;
}

:root[data-theme="light"] .brand-emblem {
    filter: grayscale(1) contrast(1.2);
}

.brand-name {
    margin-left: 8px;
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
}

.brand-module {
    margin-left: 12px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    line-height: 13px;
}

:root[data-theme="light"] .brand-module {
    color: #334155;
}

.theme-toggle {
    display: flex;
    width: 44px;
    height: 24px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--field);
    padding: 2px;
    cursor: pointer;
}

.theme-toggle__side {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 9px;
}

.theme-toggle__side--leading {
    background: var(--accent);
}

.theme-toggle__side--trailing {
    background: transparent;
}

:root[data-theme="light"] .theme-toggle {
    background: #ffffff;
}

:root[data-theme="light"] .theme-toggle__side--leading {
    background: #fde68a;
}

:root[data-theme="light"] .theme-toggle__side--trailing {
    background: #e5e7eb;
}

.theme-icon {
    width: 12px;
    height: 12px;
}

.theme-icon--light,
:root[data-theme="light"] .theme-icon--dark {
    display: none;
}

:root[data-theme="light"] .theme-icon--light {
    display: block;
}

.login-stage {
    display: grid;
    min-height: 100vh;
    min-height: 100svh;
    place-items: center;
    padding: 96px 24px 92px;
}

.login-stack {
    display: flex;
    width: min(440px, 100%);
    flex-direction: column;
    align-items: center;
    transform: translateY(74px);
}

.login-card {
    width: 100%;
    min-height: 432px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    padding: 28px 36px 26px;
}

.login-card h1 {
    margin: 0 0 18px;
    font-size: 28px;
    font-weight: 600;
    line-height: 34px;
}

.login-form,
.login-fields,
.login-fields label {
    display: flex;
    flex-direction: column;
}

.login-fields {
    gap: 12px;
}

.login-fields label > span {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 16px;
}

.login-fields input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--field-border);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    padding: 0 16px;
    font-size: 15px;
    line-height: 18px;
}

.login-fields input::placeholder {
    color: var(--muted);
    opacity: 1;
}

:root[data-theme="light"] .login-fields input::placeholder {
    color: #9ca3af;
}

.sign-in-button {
    width: 100%;
    height: 52px;
    margin-top: 22px;
    border: 0;
    border-radius: 10px;
    background: #48baff;
    color: var(--button-text);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    line-height: 18px;
}

.sign-in-button:hover {
    background: #69c6ff;
}

.sign-in-button:active {
    background: #2c9ee4;
}

.sign-in-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.form-status {
    min-height: 16px;
    margin: 8px 0 -24px;
    color: var(--error);
    font-size: 12px;
    line-height: 16px;
    text-align: center;
}

.forgot-credentials {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    line-height: 15px;
    transform: translateY(-4px);
}

.login-legal-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 18px;
    font-size: 13px;
    line-height: 16px;
}

.security-note {
    width: 368px;
    margin: 30px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 15px;
}

.login-footer {
    position: fixed;
    bottom: 31px;
    left: 48px;
    color: var(--muted);
    font-size: 11px;
    line-height: 13px;
}

noscript {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    color: var(--error);
    text-align: center;
}

@media (max-width: 560px) {
    .login-stage {
        align-items: start;
        padding: 222px 24px 72px;
    }

    .login-card {
        min-height: 422px;
        padding: 28px 24px 20px;
    }

    .login-stack {
        transform: none;
    }

    .login-legal-links {
        width: 100%;
        gap: 24px;
        margin-top: 30px;
        font-size: 12px;
        line-height: 15px;
    }

    .security-note {
        width: 100%;
        margin-top: 13px;
        padding-inline: 24px;
    }

    .login-footer {
        position: absolute;
        bottom: 31px;
        left: 24px;
    }
}

@media (max-height: 780px) {
    .login-stage {
        align-items: start;
        padding-top: 112px;
    }

    .login-stack {
        transform: none;
    }

    .login-footer {
        position: absolute;
    }
}

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