@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    --page-bg: #010a1f;
    --neon: #2f7bff;
    --neon-soft: rgba(47, 123, 255, 0.55);
    --input-bg: rgba(3, 12, 34, 0.85);
    --input-border: rgba(90, 140, 255, 0.45);
    --text: #f2f5ff;
    --text-muted: #a9b3cc;
    --link: #3d8bff;
    --error: #ff6b7a;
    --stage-w: min(max(100vw, 177.68vh), 1.12 * min(100vw, 177.68vh));
}

::selection {
    color: #fff;
    background: rgba(47, 123, 255, 0.6);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    min-height: 100vh;
    overflow: hidden;
    background: var(--page-bg);
    color: var(--text);
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-stage {
    position: relative;
    flex-shrink: 0;
    width: var(--stage-w);
    aspect-ratio: 1672 / 941;
    font-size: calc(var(--stage-w) / 104.5);
    background: url("../images/login_bg.jpg") center / 100% 100% no-repeat;
}

.login-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 3em 1.5em var(--page-bg);
}

.login-panel {
    position: absolute;
    z-index: 1;
    font-size: 0.76em;
    left: 50%;
    top: 43%;
    transform: translate(-50%, -50%);
    width: 29em;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-login {
    width: 100%;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.4em;
}

.login-brand__word {
    width: 11em;
}

.login-brand__sub {
    margin-top: 0.3em;
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
}

.login-welcome {
    text-align: center;
    margin-bottom: 1.2em;
}

.login-welcome__title {
    margin: 0 0 0.35em;
    font-size: 2.1em;
    font-weight: 600;
    color: var(--text);
}

.login-welcome__text {
    margin: 0;
    font-size: 1em;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}

.login-msg {
    margin-bottom: 0.8em;
    text-align: center;
    font-size: 0.9em;
    color: var(--error);
}

.login-msg em {
    font-style: normal;
    display: block;
}

.login-msg:empty {
    display: none;
}

.login__label {
    display: block;
    margin: 0 0 0.4em;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text);
}

.login__field {
    position: relative;
    margin-bottom: 1em;
}

.login__icon {
    position: absolute;
    left: 1.15em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
    color: #c9d3ea;
    pointer-events: none;
}

.login__input {
    width: 100%;
    height: 3.1em;
    padding: 0 1em 0 3.4em;
    font: inherit;
    font-size: 1em;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0.6em;
    outline: none;
    box-shadow: 0 0 0.9em rgba(47, 123, 255, 0.18);
    transition:
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        background-color 0.35s ease;
}

.login__input--eye {
    padding-right: 3.2em;
}

.login__field:hover .login__input,
.login__input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 1.1em var(--neon-soft);
}

.login__input:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 100em #06122e inset;
    caret-color: var(--text);
}

.eye {
    position: absolute;
    right: 1.1em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
    color: #c9d3ea;
}

.eye:hover {
    color: #fff;
}

.login__forgot {
    display: inline-block;
    margin: -0.2em 0 1.2em;
    font-size: 0.95em;
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.login__forgot:hover {
    color: #7fb0ff;
}

.login__submit {
    display: block;
    width: 100%;
    height: 3.4em;
    font: inherit;
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #fff;
    background: linear-gradient(180deg, #3b8cff 0%, #1f5fe6 100%);
    border: 1px solid rgba(140, 185, 255, 0.7);
    border-radius: 0.6em;
    box-shadow:
        0 0 1.4em rgba(47, 123, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition:
        filter 0.15s,
        box-shadow 0.15s;
}

.login__submit:hover {
    filter: brightness(1.1);
    box-shadow:
        0 0 2em rgba(47, 123, 255, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.login__submit:active {
    filter: brightness(0.95);
}

.login__footer {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin-top: 3.2em;
    font-size: 0.9em;
    color: #d5dcef;
}

.login__footer img {
    width: 6.5em;
    display: block;
}

@media (max-aspect-ratio: 4/3), (max-width: 760px) {
    body {
        overflow: auto;
        background: var(--page-bg) url("../images/login_bg.jpg") center / cover
            no-repeat fixed;
    }

    .login-stage {
        width: 100%;
        min-height: 100vh;
        aspect-ratio: auto;
        font-size: 15px;
        background: none;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px 16px;
    }

    .login-stage::after {
        display: none;
    }

    .login-panel {
        position: static;
        transform: none;
        width: 100%;
        max-width: 28em;
        padding: 2em 1.6em 1.6em;
        background: rgba(2, 10, 30, 0.78);
        border: 1px solid var(--neon-soft);
        border-radius: 1.4em;
        box-shadow: 0 0 2.5em rgba(47, 123, 255, 0.45);
        backdrop-filter: blur(6px);
    }
}
