/*
|--------------------------------------------------------------------------
| login.css
| Страница /login
|--------------------------------------------------------------------------
*/

.login-page {
    --login-surface: var(--surface, #ffffff);
    --login-text: var(--text, #172033);
    --login-muted: var(--text-soft, #64748b);
    --login-faint: var(--text-faint, #94a3b8);
    --login-border: var(--border, #d9e0ea);
    --login-primary: var(--primary, #2563eb);
    --login-primary-hover: var(--primary-hover, #1d4ed8);

    display: grid;
    place-items: center;

    width: 100%;
    min-height: calc(100dvh - 160px);
    padding: 28px 0 42px;

    color: var(--login-text);
}

.login-page,
.login-page *,
.login-page *::before,
.login-page *::after {
    box-sizing: border-box;
}

.login-page__layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(380px, 0.92fr);

    width: min(100%, 1080px);
    overflow: hidden;

    border: 1px solid var(--login-border);
    border-radius: 21px;

    background: var(--login-surface);

    box-shadow: 0 18px 48px rgb(15 23 42 / 10%);
}

/* Левая колонка */

.login-page__welcome {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    min-height: 590px;
    padding: clamp(28px, 4vw, 42px);

    background:
        radial-gradient(
            circle at 16% 16%,
            rgb(147 197 253 / 27%),
            transparent 34%
        ),
        radial-gradient(
            circle at 94% 90%,
            rgb(59 130 246 / 30%),
            transparent 38%
        ),
        linear-gradient(
            140deg,
            #172554 5%,
            #1d4ed8 100%
        );

    color: #ffffff;
}

.login-page__brand {
    position: relative;
    z-index: 1;

    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 10px;

    color: #ffffff;

    font-size: 1.24rem;
    font-weight: 850;
    letter-spacing: -0.035em;
    line-height: 1.2;
    text-decoration: none;
}

.login-page__brand:hover {
    color: #dbeafe;
}

.login-page__brand-icon {
    display: grid;
    place-items: center;

    width: 36px;
    height: 36px;

    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 11px;

    background: rgb(255 255 255 / 14%);

    font-size: 1.2rem;
    line-height: 1;
}

.login-page__welcome-content {
    position: relative;
    z-index: 1;

    max-width: 440px;
    margin: auto 0;
    padding: 45px 0;
}

.login-page__welcome-eyebrow {
    margin: 0 0 12px;

    color: #bfdbfe;

    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    line-height: 1.4;
    text-transform: uppercase;
}

.login-page__welcome-content h1 {
    margin: 0;

    color: #ffffff;

    font-size: clamp(2.15rem, 4vw, 3.1rem);
    font-weight: 850;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.login-page__welcome-description {
    margin: 17px 0 0;

    color: #e0edff;

    font-size: 0.98rem;
    line-height: 1.7;
}

.login-page__benefits {
    display: grid;
    gap: 13px;

    margin: 28px 0 0;
    padding: 0;

    list-style: none;
}

.login-page__benefits li {
    display: flex;
    align-items: center;
    gap: 10px;

    color: #f4f8ff;

    font-size: 0.87rem;
    line-height: 1.45;
}

.login-page__benefits li > span {
    display: grid;
    flex: 0 0 23px;
    place-items: center;

    width: 23px;
    height: 23px;

    border-radius: 50%;
    background: rgb(255 255 255 / 18%);
    color: #ffffff;

    font-size: 0.75rem;
    font-weight: 800;
}

.login-page__decoration {
    position: absolute;
    z-index: 0;
    right: -42px;
    bottom: -96px;

    color: rgb(255 255 255 / 9%);

    font-size: 270px;
    line-height: 1;

    pointer-events: none;
    transform: rotate(12deg);
}

/* Правая колонка */

.login-page__form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-width: 0;
    padding: clamp(26px, 4vw, 48px);

    background: var(--login-surface);
}

.login-page__form-header {
    margin-bottom: 24px;
}

.login-page__form-eyebrow {
    margin: 0 0 8px;

    color: var(--login-primary);

    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.4;
    text-transform: uppercase;
}

.login-page__form-header h2 {
    margin: 0;

    color: var(--login-text);

    font-size: clamp(1.7rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.login-page__form-header p:not(
    .login-page__form-eyebrow
) {
    margin: 9px 0 0;

    color: var(--login-muted);

    font-size: 0.9rem;
    line-height: 1.6;
}

/* Уведомления */

.login-page__alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin: 0 0 17px;
    padding: 12px 13px;

    border: 1px solid transparent;
    border-radius: 10px;

    font-size: 0.86rem;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

.login-page__alert > span:first-child {
    display: grid;
    flex: 0 0 22px;
    place-items: center;

    width: 22px;
    height: 22px;

    border-radius: 50%;

    font-size: 0.76rem;
    font-weight: 800;
}

.login-page__alert--error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.login-page__alert--error > span:first-child {
    background: #ef4444;
    color: #ffffff;
}

.login-page__alert--success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.login-page__alert--success > span:first-child {
    background: #22c55e;
    color: #ffffff;
}

/* Форма */

.login-page__form {
    display: grid;
    gap: 17px;
}

.login-page__field {
    display: grid;
    gap: 8px;

    min-width: 0;
}

.login-page__field > span {
    color: var(--login-text);

    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.4;
}

.login-page__field input {
    display: block;

    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;

    border: 1px solid var(--login-border);
    border-radius: 9px;

    background: var(--login-surface);
    color: var(--login-text);

    font: inherit;
    font-size: 0.91rem;
}

.login-page__field input::placeholder {
    color: var(--login-faint);
}

.login-page__field input:focus-visible {
    border-color: var(--login-primary);
    outline: 2px solid var(--login-primary);
    outline-offset: 2px;
}

.login-page__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: 100%;
    min-height: 46px;
    margin-top: 3px;
    padding: 10px 15px;

    border: 1px solid var(--login-primary);
    border-radius: 9px;

    background: var(--login-primary);
    color: #ffffff;

    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.3;

    cursor: pointer;

    transition:
        background-color 150ms ease,
        border-color 150ms ease;
}

.login-page__submit:hover {
    border-color: var(--login-primary-hover);
    background: var(--login-primary-hover);
}

.login-page__submit:focus-visible {
    outline: 2px solid var(--login-primary);
    outline-offset: 3px;
}

/* Разделитель и Steam */

.login-page__divider {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 23px 0;

    color: var(--login-muted);

    font-size: 0.77rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.login-page__divider::before,
.login-page__divider::after {
    flex: 1;

    height: 1px;
    background: var(--login-border);

    content: "";
}

.login-page__steam-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 47px;
    padding: 9px 12px;

    border: 1px solid var(--login-border);
    border-radius: 9px;

    background: var(--login-surface);
    color: var(--login-text);

    font-size: 0.89rem;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;

    transition:
        border-color 150ms ease,
        background-color 150ms ease;
}

.login-page__steam-button:hover {
    border-color: var(--login-primary);

    background: var(
        --bg-soft,
        #eff6ff
    );
    color: var(--login-primary);
}

.login-page__steam-symbol {
    display: grid;
    flex: 0 0 25px;
    place-items: center;

    width: 25px;
    height: 25px;

    border-radius: 7px;

    background: var(--login-text);
    color: var(--login-surface);

    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.login-page__steam-arrow {
    margin-left: auto;

    font-size: 1rem;
}

.login-page__steam-note {
    margin: 10px 0 0;

    color: var(--login-muted);

    font-size: 0.75rem;
    line-height: 1.5;
}

/* Регистрация и возврат */

.login-page__register {
    margin: 22px 0 0;

    color: var(--login-muted);

    font-size: 0.84rem;
    line-height: 1.5;
    text-align: center;
}

.login-page__register a {
    color: var(--login-primary);

    font-weight: 800;
    text-decoration: none;
}

.login-page__register a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-page__back {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 7px;

    margin-top: 21px;

    color: var(--login-muted);

    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

.login-page__back:hover {
    color: var(--login-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-page__brand:focus-visible,
.login-page__steam-button:focus-visible,
.login-page__register a:focus-visible,
.login-page__back:focus-visible {
    outline: 2px solid var(--login-primary);
    outline-offset: 3px;
}

/* Планшеты и телефоны */

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

    .login-page__welcome {
        min-height: 0;
        padding: 25px 28px;
    }

    .login-page__welcome-content {
        max-width: none;
        margin: 23px 0 0;
        padding: 0;
    }

    .login-page__welcome-content h1 {
        font-size: clamp(1.8rem, 5vw, 2.35rem);
    }

    .login-page__benefits,
    .login-page__decoration {
        display: none;
    }

    .login-page__form-panel {
        padding: 29px 28px 32px;
    }
}

@media (max-width: 480px) {
    .login-page {
        min-height: 0;
        padding: 14px 0 28px;
    }

    .login-page__layout {
        border-radius: 16px;
    }

    .login-page__welcome {
        padding: 22px 20px;
    }

    .login-page__welcome-description {
        font-size: 0.88rem;
    }

    .login-page__form-panel {
        padding: 25px 20px 29px;
    }

    .login-page__form-header {
        margin-bottom: 21px;
    }
}

/* Тёмная тема */

html.dark .login-page,
html[data-theme="dark"] .login-page,
body[data-theme="dark"] .login-page {
    --login-surface: var(--surface, #172333);
    --login-text: var(--text, #f1f5f9);
    --login-muted: var(--text-soft, #b2c1d3);
    --login-faint: var(--text-faint, #91a4b9);
    --login-border: var(--border, #43536a);
    --login-primary: var(--primary, #60a5fa);
    --login-primary-hover: var(
        --primary-hover,
        #3b82f6
    );
}

html.dark .login-page__layout,
html[data-theme="dark"] .login-page__layout,
body[data-theme="dark"] .login-page__layout {
    box-shadow: none;
}

html.dark .login-page__alert--error,
html[data-theme="dark"] .login-page__alert--error,
body[data-theme="dark"] .login-page__alert--error {
    border-color: #991b1b;
    background: #450a0a;
    color: #fecaca;
}

html.dark .login-page__alert--success,
html[data-theme="dark"] .login-page__alert--success,
body[data-theme="dark"] .login-page__alert--success {
    border-color: #166534;
    background: #052e16;
    color: #bbf7d0;
}

@media (prefers-reduced-motion: reduce) {
    .login-page *,
    .login-page *::before,
    .login-page *::after {
        transition-duration: 0s;
        animation-duration: 0s;
    }
}
