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

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

    display: grid;
    place-items: center;

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

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

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

.register-page__layout {
    display: grid;
    grid-template-columns:
        minmax(0, 0.95fr)
        minmax(410px, 1.05fr);

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

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

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

/* Приветствие */

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

    display: flex;
    flex-direction: column;

    min-height: 690px;
    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;
}

.register-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;
}

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

.register-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;
}

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

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

.register-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;
}

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

    color: #ffffff;

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

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

    color: #e0edff;

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

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

    margin: 28px 0 0;
    padding: 0;

    list-style: none;
}

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

    color: #f4f8ff;

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

.register-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;
}

.register-page__decoration {
    position: absolute;
    z-index: 0;
    right: -40px;
    bottom: -95px;

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

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

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

/* Форма */

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

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

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

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

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

    color: var(--register-primary);

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

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

    color: var(--register-text);

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

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

    color: var(--register-muted);

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

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

.register-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;
}

.register-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;
}

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

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

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

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

/* Поля */

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

.register-page__field {
    display: grid;
    gap: 7px;

    min-width: 0;
}

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

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

.register-page__field input:not(
    [type="checkbox"]
) {
    display: block;

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

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

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

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

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

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

.register-page__password-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* Согласие */

.register-page__consent {
    display: grid;
    gap: 11px;

    margin-top: 3px;
    padding: 15px;

    border: 1px solid var(--register-border);
    border-radius: 11px;

    background: var(--register-surface-soft);
}

.register-page__consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    color: var(--register-text);

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

    cursor: pointer;
}

.register-page__consent-row input[type="checkbox"] {
    appearance: auto;
    position: static;
    display: block;
    flex: 0 0 18px;

    width: 18px;
    min-width: 18px;
    max-width: 18px;
    height: 18px;
    min-height: 18px;

    margin: 2px 0 0;
    padding: 0;

    border: 0;
    border-radius: 0;

    background: transparent;
    box-shadow: none;

    accent-color: var(--register-primary);
    transform: none;
    cursor: pointer;
}

.register-page__consent-row > span {
    flex: 1 1 auto;
    min-width: 0;
}

.register-page__consent-row:focus-within {
    border-radius: 4px;
    outline: 2px solid var(--register-primary);
    outline-offset: 4px;
}

.register-page__consent-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: fit-content;
    max-width: 100%;
    min-height: 38px;
    padding: 8px 11px;

    border: 1px solid var(--register-primary);
    border-radius: 8px;

    background: transparent;
    color: var(--register-primary);

    font-size: 0.8rem;
    font-weight: 750;
    line-height: 1.4;
    text-decoration: none;
}

.register-page__consent-link:hover {
    background: var(--register-primary);
    color: #ffffff;
}

.register-page__consent small {
    color: var(--register-muted);

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

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

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

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

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

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

    cursor: pointer;
}

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

/* Закрытая регистрация */

.register-page__closed {
    display: flex;
    align-items: flex-start;
    gap: 11px;

    padding: 14px;

    border: 1px solid #fde68a;
    border-radius: 10px;

    background: #fffbeb;
    color: #92400e;
}

.register-page__closed > span {
    flex: 0 0 auto;
}

.register-page__closed p {
    margin: 0;

    font-size: 0.85rem;
    line-height: 1.55;
}

/* Steam */

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

    margin: 23px 0;

    color: var(--register-muted);

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

.register-page__divider::before,
.register-page__divider::after {
    flex: 1;
    height: 1px;

    background: var(--register-border);
    content: "";
}

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

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

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

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

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

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

    background: var(--register-surface-soft);
    color: var(--register-primary);
}

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

    width: 25px;
    height: 25px;

    border-radius: 7px;

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

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

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

    font-size: 1rem;
}

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

    color: var(--register-muted);

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

/* Ссылки */

.register-page__login {
    margin: 22px 0 0;

    color: var(--register-muted);

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

.register-page__login a {
    color: var(--register-primary);

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

.register-page__login a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

    margin-top: 21px;

    color: var(--register-muted);

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

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

.register-page__brand:focus-visible,
.register-page__field input:focus-visible,
.register-page__consent-link:focus-visible,
.register-page__submit:focus-visible,
.register-page__steam-button:focus-visible,
.register-page__login a:focus-visible,
.register-page__back:focus-visible {
    outline: 2px solid var(--register-primary);
    outline-offset: 3px;
}

/* Адаптация */

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

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

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

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

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

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

@media (max-width: 550px) {
    .register-page__password-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .register-page__consent-link {
        width: 100%;
        text-align: center;
    }
}

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

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

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

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

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

    .register-page__consent {
        padding: 13px;
    }
}

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

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

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

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

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

html.dark .register-page__closed,
html[data-theme="dark"] .register-page__closed,
body[data-theme="dark"] .register-page__closed {
    border-color: #92400e;
    background: #3b2b13;
    color: #fde68a;
}

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