.register-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.register-back {
    position: absolute;
    top: 22px;
    left: 24px;
    color: #788491;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.16s ease;
}

.register-back:hover {
    color: #b3beca;
}

.register-card {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: #0c1117;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.register-title {
    margin: 0;
    color: #f4f7fb;
    font-size: 25px;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.register-subtitle {
    margin: 7px 0 22px;
    color: #7f8b98;
    font-size: 13px;
    line-height: 1.5;
}

.register-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid transparent;
    border-radius: 10px;
}

.register-alert--error {
    color: #ff7b82;
    background: rgba(255, 82, 91, 0.09);
    border-color: rgba(255, 82, 91, 0.13);
}

.register-alert--success {
    color: #8fbeff;
    background: rgba(47, 140, 255, 0.1);
    border-color: rgba(47, 140, 255, 0.14);
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.register-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.register-field--group-start {
    margin-top: 4px;
}

.register-field .login-input {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    color: #eef3f8;
    font-size: 14px;
    background: #0a0f14;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.register-field .login-input::placeholder {
    color: #68737f;
}

.register-field .login-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.register-field .login-input:focus {
    background: #0b1118;
    border-color: rgba(47, 140, 255, 0.85);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.1);
}

.register-field-error {
    padding-left: 2px;
    color: #ff747c;
    font-size: 11px;
    line-height: 1.4;
}

.register-password-field {
    position: relative;
}

.register-password-field .login-input {
    padding-right: 48px;
}

.register-password-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #7e8996;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 0.16s ease, background 0.16s ease;
}

.register-password-toggle:hover {
    color: #72adf7;
    background: rgba(47, 140, 255, 0.1);
}

.register-password-toggle:focus-visible {
    outline: 2px solid rgba(47, 140, 255, 0.85);
    outline-offset: -2px;
}

.register-password-toggle__icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.register-password-toggle__icon--hide {
    display: none;
}

.register-password-toggle[aria-pressed="true"] .register-password-toggle__icon--show {
    display: none;
}

.register-password-toggle[aria-pressed="true"] .register-password-toggle__icon--hide {
    display: block;
}

.register-consents {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 8px 0 3px;
}

.register-consent-group {
    display: flex;
    flex-direction: column;
}

.register-consent {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    width: 100%;
    padding: 8px;
    color: #b9c3ce;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    gap: 10px;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.register-consent:hover {
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.05);
}

.register-consent:has(input[type="checkbox"]:focus-visible) {
    border-color: rgba(47, 140, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.08);
}

.register-consent input[type="checkbox"] {
    position: relative;
    display: grid;
    place-content: center;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.register-consent input[type="checkbox"]::after {
    width: 4px;
    height: 8px;
    margin-top: -2px;
    content: "";
    border: solid #fff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg) scale(0.35);
    transition: opacity 0.1s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.register-consent input[type="checkbox"]:checked {
    background: #318bf4;
    border-color: #318bf4;
    box-shadow: 0 3px 10px rgba(49, 139, 244, 0.24);
}

.register-consent input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.register-consent input[type="checkbox"]:active {
    transform: scale(0.9);
}

.register-consent input[type="checkbox"]:focus-visible {
    outline: none;
}

.register-consent__copy {
    display: block;
    font-size: 12px;
    line-height: 1.5;
}

.register-consent__label {
    color: inherit;
    cursor: pointer;
}

.register-consent__label::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
    border-radius: 10px;
}

.register-consent a {
    position: relative;
    z-index: 2;
    color: #72adf7;
    text-decoration: none;
    transition: color 0.15s ease;
}

.register-consent a:hover {
    color: #a6cbff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.register-consent-error {
    margin: 1px 8px 0 36px;
    color: #ff747c;
    font-size: 11px;
    line-height: 1.4;
}

.register-submit {
    height: 44px;
    margin-top: 6px;
    padding: 0 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    background: #318bf4;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(47, 140, 255, 0.12);
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.register-submit:hover {
    background: #4096fa;
    box-shadow: 0 6px 18px rgba(47, 140, 255, 0.18);
}

.register-submit:active {
    transform: translateY(1px);
}

.register-submit:focus-visible {
    outline: 2px solid #8fc0ff;
    outline-offset: 3px;
}

.register-footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    color: #788491;
    font-size: 12.5px;
    gap: 6px;
}

.register-footer a {
    color: #72adf7;
    text-decoration: none;
}

.register-footer a:hover {
    color: #9cc7ff;
}

@media (max-width: 600px) {
    .register-page {
        align-items: flex-start;
        padding: 72px 14px 24px;
    }

    .register-back {
        top: 20px;
        left: 18px;
    }

    .register-card {
        padding: 22px 20px;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .register-page *,
    .register-page *::before,
    .register-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.register-consent__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 12px;
    line-height: 1.45;
    gap: 2px;
}

.register-consent__label {
    color: #c9d2dc;
    font-weight: 500;
    cursor: pointer;
}

.register-consent__description {
    color: #778491;
    font-size: 11px;
}

.register-consent__legal {
    margin-top: 2px;
    color: #657b92 !important;
    font-size: 10.5px;
    text-decoration: none !important;
}

.register-consent__legal:hover {
    color: #8aa8c8 !important;
    text-decoration: underline !important;
}

/* ========================================
   LIGHT THEME — REGISTER
   Палитра согласована со страницей авторизации.
   Тёмная тема остаётся без изменений.
   ======================================== */

body[data-site-theme="white"] .register-page {
    --register-accent: #2f8cff;
    --register-accent-hover: #1f6fe0;
    --register-text: #172033;
    --register-muted: #667085;
    --register-border: #e2e8f0;

    position: relative;
    box-sizing: border-box;
    min-height: 100dvh;
    background: #f7f9fc;
    color: var(--register-text);
}

/* Ссылка на авторизацию */
body[data-site-theme="white"] .register-back {
    color: var(--register-muted);
}

body[data-site-theme="white"] .register-back:hover,
body[data-site-theme="white"] .register-back:focus-visible {
    color: var(--register-accent-hover);
}

/* Основная карточка */
body[data-site-theme="white"] .register-card {
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #e8ecf2;
    box-shadow: 0 12px 40px rgba(25, 40, 65, 0.07);
}

body[data-site-theme="white"] .register-title {
    color: var(--register-text);
}

body[data-site-theme="white"] .register-subtitle {
    color: var(--register-muted);
}

/* Ошибки, информационные сообщения и подтверждения */
body[data-site-theme="white"] .register-alert--error {
    color: #b42318;
    background: #fff5f4;
    border-color: #ffd6d2;
}

body[data-site-theme="white"] .register-alert--success {
    color: #067647;
    background: #ecfdf3;
    border-color: #abefc6;
}

body[data-site-theme="white"] .register-field-error,
body[data-site-theme="white"] .register-consent-error {
    color: #b42318;
}

/* Поля регистрации: никнейм, email, имя, фамилия, пароли */
body[data-site-theme="white"] .register-field .login-input {
    color: var(--register-text);
    background: #f9fafc;
    border: 1px solid var(--register-border);
    caret-color: var(--register-accent);
    color-scheme: light;
}

body[data-site-theme="white"] .register-field .login-input::placeholder {
    color: #929bac;
    opacity: 1;
}

body[data-site-theme="white"] .register-field .login-input:hover:not(:focus) {
    border-color: #cbd5e1;
}

body[data-site-theme="white"] .register-field .login-input:focus {
    color: var(--register-text);
    background: #ffffff;
    border-color: var(--register-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.11);
}

body[data-site-theme="white"] .register-field .login-input[aria-invalid="true"] {
    border-color: #e58c86;
}

body[data-site-theme="white"] .register-field .login-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.10);
}

/* Предотвращаем тёмную заливку autofill в Chrome / Safari */
body[data-site-theme="white"] .register-field .login-input:-webkit-autofill,
body[data-site-theme="white"] .register-field .login-input:-webkit-autofill:hover,
body[data-site-theme="white"] .register-field .login-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #172033;
    -webkit-box-shadow: 0 0 0 1000px #f9fafc inset;
    caret-color: #172033;
}

/* Кнопка показа пароля */
body[data-site-theme="white"] .register-password-toggle {
    color: #7c8798;
}

body[data-site-theme="white"] .register-password-toggle:hover {
    color: var(--register-accent-hover);
    background: #eaf3ff;
}

body[data-site-theme="white"] .register-password-toggle:focus-visible {
    outline-color: var(--register-accent);
}

/* Блоки согласий и чекбоксы */
body[data-site-theme="white"] .register-consent {
    color: #475467;
}

body[data-site-theme="white"] .register-consent:hover {
    background: #f8fafc;
    border-color: #e8edf4;
}

body[data-site-theme="white"] .register-consent:has(input[type="checkbox"]:focus-visible) {
    border-color: rgba(47, 140, 255, 0.38);
    box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.08);
}

body[data-site-theme="white"] .register-consent input[type="checkbox"] {
    background: #ffffff;
    border-color: #b8c4d2;
}

body[data-site-theme="white"] .register-consent input[type="checkbox"]:hover:not(:checked) {
    border-color: #8f9eaf;
}

body[data-site-theme="white"] .register-consent input[type="checkbox"]:checked {
    background: var(--register-accent);
    border-color: var(--register-accent);
    box-shadow: 0 3px 10px rgba(47, 140, 255, 0.18);
}

body[data-site-theme="white"] .register-consent input[type="checkbox"]:checked::after {
    border-color: #ffffff;
}

body[data-site-theme="white"] .register-consent__label {
    color: #344054;
}

body[data-site-theme="white"] .register-consent__description {
    color: var(--register-muted);
}

body[data-site-theme="white"] .register-consent a,
body[data-site-theme="white"] .register-consent__legal {
    color: #1769d1 !important;
    text-decoration: none;
}

body[data-site-theme="white"] .register-consent a:hover,
body[data-site-theme="white"] .register-consent a:focus-visible,
body[data-site-theme="white"] .register-consent__legal:hover {
    color: #0d4ea6 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

/* Отправка формы */
body[data-site-theme="white"] .register-submit {
    color: #ffffff;
    background: var(--register-accent);
    box-shadow: 0 4px 14px rgba(47, 140, 255, 0.12);
}

body[data-site-theme="white"] .register-submit:hover {
    background: var(--register-accent-hover);
    box-shadow: 0 6px 18px rgba(47, 140, 255, 0.16);
}

body[data-site-theme="white"] .register-submit:focus-visible {
    outline-color: rgba(47, 140, 255, 0.4);
}

/* Ссылка «Уже есть аккаунт?» */
body[data-site-theme="white"] .register-footer {
    color: var(--register-muted);
}

body[data-site-theme="white"] .register-footer a {
    color: #1769d1;
}

body[data-site-theme="white"] .register-footer a:hover,
body[data-site-theme="white"] .register-footer a:focus-visible {
    color: #0d4ea6;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Узкие экраны */
@media (max-width: 600px) {
    body[data-site-theme="white"] .register-page {
        padding: 72px 14px 28px;
    }

    body[data-site-theme="white"] .register-back {
        top: 20px;
        left: 16px;
    }

    body[data-site-theme="white"] .register-card {
        box-shadow: 0 8px 28px rgba(25, 40, 65, 0.06);
    }
}

@media (max-width: 360px) {
    body[data-site-theme="white"] .register-card {
        padding: 20px 16px;
    }

    body[data-site-theme="white"] .register-footer {
        flex-wrap: wrap;
        text-align: center;
        row-gap: 3px;
    }
}
