* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    min-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

.registration-page {
    position: relative;
    width: 100%;
    min-width: 100%;
    min-height: 100vh;
    /* height: 100vh; - убираем жесткую высоту, чтобы контент мог растягивать страницу */
    display: flex;
    overflow-y: auto;
    /* Разрешаем скролл */
    overflow-x: hidden;
    margin: 0;
    background: var(--auth-page-background, linear-gradient(195.99deg, #52A0FF 11.14%, #0068E8 91.56%));
}

.registration-page::before {
    display: none;
}

.registration-page::after {
    display: none;
}

.registration-page>* {
    position: relative;
    z-index: 1;
}

/* Кнопка назад */
.back-button {
    position: absolute;
    top: 49px;
    left: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    z-index: 10;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(82, 160, 255, 0.2);
}

.back-button:hover {
    transform: scale(1.05);
}

/* Логотип и бренд */
.brand-header {
    position: absolute;
    top: 49px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 250px;
    height: auto;
    object-fit: contain;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 14px;
    color: white;
    text-transform: lowercase;
    margin: 0;
    line-height: 1.2;
}

/* Форма регистрации */
.registration-form-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 100px auto 40px;
    padding: 0 20px;
    z-index: 10;
}

/* ПК: форма пошире, двухколоночная раскладка */
@media (min-width: 768px) {
    .registration-form-container {
        max-width: 640px;
    }
}

/* На больших мониторах — ещё пошире */
@media (min-width: 1400px) {
    .registration-form-container {
        max-width: 700px;
    }
}

/* Карточка формы — светлый блок в стиле Lenza для читаемости */
.registration-form-card {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 40px 36px 36px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.registration-card-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1.25;
    color: #111827;
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.registration-card-subtitle {
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #6B7280;
    margin: 0 0 28px 0;
    line-height: 1.4;
}

.registration-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Строка полей: на ПК — две колонки, на мобильных — в столбик */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

.reg-inn-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.reg-inn-only-row {
    max-width: 100%;
}

@media (min-width: 768px) {
    .reg-inn-only-row {
        grid-template-columns: 1fr;
    }
}

.reg-inn-input {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.reg-inn-status {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.35;
    color: #6B7280;
}

.reg-inn-status[hidden] {
    display: none !important;
}

.reg-inn-status--loading {
    color: #0068E8;
}

.reg-inn-hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.35;
    color: #6B7280;
}

.reg-inn-hint[hidden] {
    display: none !important;
}

.reg-inn-field-error {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #991B1B;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.reg-inn-field-error a {
    color: #0068E8;
    font-weight: 600;
    text-decoration: underline;
}

.reg-company-details {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.45s ease, opacity 0.35s ease, margin-top 0.35s ease;
    margin-top: 0;
}

.reg-company-details--visible {
    max-height: 1200px;
    opacity: 1;
    margin-top: 20px;
}

.reg-company-details[hidden]:not(.reg-company-details--visible) {
    display: none !important;
}

.form-group--full {
    grid-column: 1 / -1;
}

#reg-kpp-wrap[hidden] {
    display: none !important;
}

.reg-ogrn-kpp-row--ip-only {
    grid-template-columns: 1fr;
}

.reg-ogrn-hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.35;
    color: #6B7280;
}

/* Шаг 2: БИК → раскрытие банковских реквизитов */
.reg-bik-only-row {
    max-width: 100%;
}

@media (min-width: 768px) {
    .reg-bik-only-row {
        grid-template-columns: 1fr;
    }
}

.reg-bik-row {
    display: flex;
    align-items: stretch;
}

.reg-bik-input {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.reg-bik-hint,
.reg-rs-hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.35;
    color: #6B7280;
}

.reg-bik-hint[hidden],
.reg-rs-hint[hidden] {
    display: none !important;
}

.reg-bik-status {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.35;
    color: #6B7280;
}

.reg-bik-status[hidden] {
    display: none !important;
}

.reg-bik-status--loading {
    color: #0068E8;
}

.reg-bik-field-error {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #991B1B;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.reg-bank-manual-btn {
    margin-top: 10px;
    padding: 0;
    border: none;
    background: none;
    color: #0068E8;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.reg-bank-manual-btn:hover {
    color: #0056CC;
}

.reg-bank-manual-btn[hidden] {
    display: none !important;
}

.reg-bank-details {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.45s ease, opacity 0.35s ease, margin-top 0.35s ease;
    margin-top: 0;
}

.reg-bank-details--visible {
    max-height: 1200px;
    opacity: 1;
    margin-top: 20px;
}

.reg-bank-details[hidden]:not(.reg-bank-details--visible) {
    display: none !important;
}

.reg-rs-primary {
    margin-bottom: 20px;
}

.reg-rs-primary__group {
    margin: 0;
}

.reg-rs-primary__label {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.reg-rs-primary__lead {
    margin: 4px 0 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #4B5563;
}

.reg-checking-account-input {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 14px 16px;
    border: 2px solid #52A0FF;
    background: #F8FBFF;
    border-radius: 12px;
}

.reg-checking-account-input:focus {
    border-color: #0068E8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(82, 160, 255, 0.25);
}

.reg-bank-prefilled {
    padding: 16px;
    border-radius: 12px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
}

.reg-bank-prefilled__title {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9CA3AF;
}

.reg-bank-prefilled--manual .reg-bank-prefilled__title {
    text-transform: none;
    font-size: 14px;
    color: #4B5563;
}

.form-input--readonly,
.form-input[readonly]:not(.reg-checking-account-input) {
    background: #F3F4F6 !important;
    border-color: #E5E7EB !important;
    color: #374151;
    cursor: default;
    box-shadow: none;
}

.form-input--readonly:focus,
.form-input[readonly]:not(.reg-checking-account-input):focus {
    border-color: #E5E7EB !important;
    box-shadow: none;
}

.form-label-optional {
    font-weight: 400;
    color: #9CA3AF;
    font-size: 12px;
}

.reg-fill-inn-btn {
    flex-shrink: 0;
    align-self: stretch;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #52A0FF;
    background: #fff;
    color: #0068E8;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(82, 160, 255, 0.2);
}

.reg-fill-inn-btn:hover {
    background: #f0f7ff;
}

.reg-fill-inn-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.reg-fill-inn-btn[aria-busy="true"] {
    cursor: wait;
}

/* Узкий экран: ИНН и кнопка автозаполнения в столбик, удобнее для пальца */
@media (max-width: 560px) {
    .reg-inn-row {
        flex-direction: column;
        align-items: stretch;
    }

    .reg-fill-inn-btn {
        width: 100%;
        min-height: 48px;
        white-space: normal;
        padding: 12px 16px;
        line-height: 1.25;
        text-align: center;
    }
}

.reg-consent-error {
    padding: 12px 14px;
    margin-bottom: 4px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    color: #991B1B;
    background: #FEF2F2;
    border: 1px solid #FECACA;
}

.reg-consent-error[hidden] {
    display: none !important;
}

.reg-success-view {
    text-align: center;
    padding: 8px 0 16px;
}

.reg-success-view__title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #111827;
    margin: 0 0 12px;
    line-height: 1.3;
}

.reg-success-view__text {
    font-size: 15px;
    color: #6B7280;
    line-height: 1.5;
    margin: 0 0 24px;
}

.reg-success-view__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 200px;
}

.reg-success-view[hidden] {
    display: none !important;
}

/* Поле пароля с кнопкой «Показать» (как на странице входа) */
.registration-form-card .password-input-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 10px;
    border: 1px solid #D1D5DB;
    background: #F9FAFB;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.registration-form-card .password-input-wrap:focus-within {
    border-color: #52A0FF;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(82, 160, 255, 0.15);
}

.registration-form-card .password-input-wrap__input {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    flex: 1;
    min-width: 0;
}

.registration-form-card .password-input-wrap__input:focus {
    box-shadow: none !important;
}

.registration-form-card .password-input-wrap:has(.password-input-wrap__input.error) {
    border-color: #EF4444;
    background: #FEF2F2;
}

.registration-form-card .password-toggle-btn {
    flex-shrink: 0;
    padding: 0 14px;
    border: none;
    background: transparent;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #0068E8;
    cursor: pointer;
    align-self: stretch;
    border-left: 1px solid #E5E7EB;
    touch-action: manipulation;
}

.registration-form-card .password-toggle-btn:hover {
    background: #f0f7ff;
}

.reg-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.form-label {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.35;
    color: #374151;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    background: #F9FAFB;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.4;
    color: #111827;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

/* Стили полей внутри карточки (переопределение для светлого фона) */
.registration-form-card .form-label {
    color: #374151;
}

.registration-form-card .form-input {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}

.registration-form-card .form-input::placeholder {
    color: #9CA3AF;
}

.registration-form-card .form-input:focus {
    border-color: #52A0FF;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(82, 160, 255, 0.15);
}

.registration-form-card .form-input:focus-visible,
.registration-form-card select.form-input:focus-visible {
    outline: none;
}

/* Мастер регистрации (шаги) */
.reg-wizard-progress {
    margin-bottom: 16px;
}

.reg-wizard-progress__track {
    height: 4px;
    background: #E5E7EB;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}

.reg-wizard-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #52A0FF, #0068E8);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.reg-wizard-progress__steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 0;
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #9CA3AF;
    text-align: center;
    line-height: 1.25;
}

.reg-wizard-progress__item span {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 2px;
    color: #D1D5DB;
}

.reg-wizard-progress__item--active {
    color: #0068E8;
}

.reg-wizard-progress__item--active span {
    color: #0068E8;
}

.reg-wizard-progress__item--done {
    color: #374151;
}

.reg-wizard-progress__item--done span {
    color: #10B981;
}

.reg-wizard-step-title {
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.reg-step {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.reg-step--active {
    display: flex;
}

.reg-wizard-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
    align-items: stretch;
}

.reg-wizard-btn {
    height: 48px;
    border-radius: 12px;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.reg-wizard-btn--secondary {
    background: #F9FAFB;
    color: #374151;
    border: 1px solid #E5E7EB;
}

.reg-wizard-btn--secondary:hover {
    background: #F3F4F6;
}

.reg-wizard-btn--primary {
    background: linear-gradient(195.99deg, #52A0FF 11.14%, #0068E8 91.56%);
    color: #fff;
}

.reg-wizard-btn--primary:hover {
    filter: brightness(1.05);
}

.reg-wizard-btn--primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    filter: none;
}

.reg-wizard-submit.register-button {
    margin-top: 0;
    grid-column: 2;
}

@media (max-width: 480px) {
    .reg-wizard-progress__steps {
        font-size: 10px;
    }

    .reg-wizard-nav {
        grid-template-columns: 1fr;
    }

    .reg-wizard-submit.register-button {
        grid-column: 1;
    }
}

/* Custom Select Styles */
.custom-select {
    position: relative;
    width: 100%;
}

.select-selected {
    width: 100%;
    height: 38px;
    padding: 0 17px;
    background: transparent;
    border: 1px solid #FFFFFF;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 300;
    font-size: 14px;
    line-height: 38px;
    /* Vertically center text */
    color: #FFFFFF;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.select-selected:after {
    position: absolute;
    content: "";
    top: 50%;
    right: 15px;
    width: 14px;
    height: 8px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L7 7L13 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 100%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.select-selected.select-arrow-active:after {
    transform: translateY(-50%) rotate(180deg);
}

.select-items {
    position: absolute;
    background: rgba(82, 160, 255, 0.95);
    /* Semi-transparent blue */
    border: 1px solid #FFFFFF;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    border-radius: 8px;
    margin-top: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.select-hide {
    display: none;
}

.select-items div {
    color: #FFFFFF;
    padding: 10px 17px;
    cursor: pointer;
    user-select: none;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 300;
    transition: background-color 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.select-items div:last-child {
    border-bottom: none;
}

.select-items div:hover,
.same-as-selected {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Выбор роли — карточки в стиле Lenza (внутри белой карточки) */
.role-picker {
    display: flex;
    gap: 14px;
    width: 100%;
}

.role-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 104px;
    padding: 18px 12px;
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
    font-family: 'Manrope', sans-serif;
    color: #4B5563;
    -webkit-appearance: none;
    appearance: none;
}

.role-option:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.role-option.selected,
.role-option:focus-visible {
    background: #EFF6FF;
    border-color: #52A0FF;
    box-shadow: 0 0 0 3px rgba(82, 160, 255, 0.2);
    color: #1E40AF;
}

.role-option:active {
    transform: scale(0.98);
}

.role-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
}

.role-option.selected .role-icon {
    color: #52A0FF;
}

.role-label {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
    letter-spacing: -0.01em;
}

.registration-form-card .role-option {
    background: #F9FAFB;
    border-color: #E5E7EB;
    color: #4B5563;
}

.registration-form-card .role-option:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.registration-form-card .role-option.selected {
    background: #EFF6FF;
    border-color: #52A0FF;
    color: #1E40AF;
}

.registration-form-card .role-option.selected .role-icon {
    color: #52A0FF;
}

.form-input::placeholder {
    color: #9CA3AF;
}

.form-input:focus {
    border-color: #52A0FF;
    background: #FFFFFF;
}

/* Кнопка регистрации — основной CTA */
.register-button {
    width: 100%;
    height: 50px;
    background: #52A0FF;
    border: none;
    border-radius: 12px;
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.25;
    color: #FFFFFF;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    margin-top: 8px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.register-button:hover {
    background: #3A8FE8;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(82, 160, 255, 0.4);
}

.register-button:active {
    transform: translateY(0);
}

/* Ссылка на вход */
.login-link-container {
    margin-top: 20px;
    text-align: center;
    width: 100%;
}

.login-link-text {
    font-size: 15px;
    color: #6B7280;
    margin: 0;
}

.login-link {
    color: #52A0FF;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.login-link:hover {
    color: #3A8FE8;
    text-decoration: underline;
}

/* Чекбоксы согласий */
.agreements {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #EEF1F5;
}

.agreement-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.agreement-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #D1D5DB;
    border-radius: 5px;
    background: #FFFFFF;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background-color 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

.agreement-checkbox:checked {
    background: #52A0FF;
    border-color: #52A0FF;
}

.agreement-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
}

.agreement-text {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.45;
    color: #4B5563;
}

.agreement-text u {
    text-decoration: underline;
    text-decoration-color: #52A0FF;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .registration-page::before {
        width: 0;
    }

    .registration-page::after {
        width: 100%;
    }

    .registration-page {
        padding: 40px 15px 15px;
    }

    .registration-card-title {
        font-size: 26px;
    }

    .back-button {
        top: 40px;
        left: 15px;
        width: 42px;
        height: 42px;
    }

    .brand-header {
        top: 40px;
        right: 15px;
    }

    .brand-title {
        font-size: 20px;
    }

    .brand-subtitle {
        font-size: 12px;
    }

    .registration-form-container {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        margin-top: 90px;
        max-width: 100%;
        width: 100%;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    html {
        scroll-padding-bottom: 8rem;
    }

    .registration-page::before {
        width: 0;
    }

    .registration-page::after {
        width: 100%;
    }

    .registration-page {
        padding: 20px 16px;
        padding-top: max(56px, calc(env(safe-area-inset-top, 0px) + 44px));
        padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
        min-height: 100vh;
        min-height: 100dvh;
        flex-direction: column;
        align-items: stretch;
    }

    .registration-card-title {
        font-size: 24px;
    }

    .registration-form-card {
        padding: 28px 24px max(28px, env(safe-area-inset-bottom, 0px));
    }

    .back-button {
        position: absolute;
        top: max(12px, env(safe-area-inset-top, 0px));
        left: max(12px, env(safe-area-inset-left, 0px));
        width: 44px;
        height: 44px;
        z-index: 10;
        order: 0;
    }

    .back-button svg {
        width: 22px;
        height: 22px;
    }

    .brand-header {
        position: absolute;
        top: max(12px, env(safe-area-inset-top, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        margin-bottom: 0;
        justify-content: center;
        z-index: 10;
        order: 0;
    }

    .logo-img {
        width: 160px;
        height: auto;
        max-width: min(160px, calc(100vw - 100px));
    }

    .registration-form-container {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        margin-top: 0;
        max-width: 100%;
        width: 100%;
        order: 2;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    }

    .registration-form {
        gap: 24px;
        width: 100%;
    }

    .form-group {
        gap: 10px;
        width: 100%;
    }

    .form-label {
        font-size: 15px;
        font-weight: 500;
        line-height: 1.4;
    }

    .form-input {
        height: 50px;
        padding: 0 16px;
        font-size: 16px;
        /* Предотвращает зум на iOS */
        border-radius: 8px;
        border-color: #94a3b8;
    }

    .registration-form-card .form-input {
        border-color: #94a3b8;
    }

    .registration-form-card .password-input-wrap {
        border-color: #94a3b8;
    }

    .registration-form-card .password-toggle-btn {
        min-width: 52px;
        padding: 0 16px;
        font-size: 14px;
        -webkit-tap-highlight-color: rgba(82, 160, 255, 0.25);
    }

    .reg-wizard-btn {
        min-height: 48px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(82, 160, 255, 0.2);
    }

    .register-button {
        height: 56px;
        font-size: 18px;
        border-radius: 8px;
        margin-top: 8px;
    }

    .agreements {
        gap: 16px;
        margin-top: 8px;
    }

    .agreement-item {
        gap: 10px;
        align-items: flex-start;
    }

    .agreement-checkbox {
        width: 20px;
        height: 20px;
        min-width: 20px;
        margin-top: 2px;
    }

    .agreement-text {
        font-size: 13px;
        line-height: 1.5;
    }

    .login-link-container {
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    }
}

/* Адаптивность для маленьких мобильных устройств */
@media (max-width: 480px) {
    .registration-page {
        padding: 16px;
        padding-top: max(52px, calc(env(safe-area-inset-top, 0px) + 40px));
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }

    .registration-card-title {
        font-size: 22px;
    }

    .registration-form-card {
        padding: 24px 20px max(24px, env(safe-area-inset-bottom, 0px));
    }

    .back-button {
        top: max(10px, env(safe-area-inset-top, 0px));
        left: max(10px, env(safe-area-inset-left, 0px));
        width: 44px;
        height: 44px;
    }

    .back-button svg {
        width: 20px;
        height: 20px;
    }

    .brand-header {
        top: max(10px, env(safe-area-inset-top, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
    }

    .logo-img {
        width: 136px;
        max-width: calc(100vw - 88px);
    }

    .registration-form-container {
        padding: 0;
    }

    .registration-form {
        gap: 20px;
    }

    .role-picker {
        gap: 12px;
    }

    .role-option {
        min-height: 88px;
        padding: 12px 8px;
        border-radius: 12px;
    }

    .role-icon svg {
        width: 36px;
        height: 36px;
    }

    .role-label {
        font-size: 13px;
    }

    .form-group {
        gap: 8px;
    }

    .form-label {
        font-size: 14px;
        font-weight: 500;
    }

    .form-input {
        height: 48px;
        padding: 0 14px;
        font-size: 16px;
    }

    .register-button {
        height: 52px;
        font-size: 17px;
    }

    .agreements {
        gap: 14px;
    }

    .agreement-checkbox {
        width: 18px;
        height: 18px;
        min-width: 18px;
    }

    .agreement-text {
        font-size: 12px;
        line-height: 1.5;
    }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 360px) {
    .registration-card-title {
        font-size: 20px;
    }

    .brand-title {
        font-size: 14px;
    }

    .brand-subtitle {
        font-size: 9px;
    }

    .form-label {
        font-size: 12px;
    }

    .agreement-text {
        font-size: 10px;
    }
}

/* Портретная ориентация для планшетов */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .registration-form-container {
        max-width: 450px;
    }
}

/* Ландшафтная ориентация для мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .registration-page {
        padding: 12px 16px;
        padding-top: max(48px, env(safe-area-inset-top, 0px));
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
        min-height: 100vh;
        min-height: 100dvh;
    }

    .back-button {
        top: max(8px, env(safe-area-inset-top, 0px));
        left: max(8px, env(safe-area-inset-left, 0px));
        width: 44px;
        height: 44px;
    }

    .brand-header {
        top: max(8px, env(safe-area-inset-top, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
    }

    .logo-img {
        width: 120px;
        height: auto;
    }

    .registration-card-title {
        font-size: 22px;
    }

    .registration-form {
        gap: 16px;
    }

    .form-input {
        height: 44px;
        padding: 0 14px;
    }

    .register-button {
        height: 48px;
        font-size: 16px;
    }

    .agreements {
        gap: 12px;
    }
}

/* Подсказки банка — тот же UI, что в профиле (bank-widget.js) */
.company-bank-host {
    position: relative;
}

.company-bank-host .company-inline-input {
    padding-right: 40px;
}

.company-bank-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    z-index: 40;
}

.company-bank-trigger {
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, #334155 50%), linear-gradient(135deg, #334155 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 10px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 30px;
}

.company-bank-toggle {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #334155;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-bank-host--open .company-bank-toggle {
    transform: rotate(180deg);
}

.company-bank-dropdown__search-wrap {
    padding: 10px;
    border-bottom: 1px solid #E2E8F0;
    background: #F8FAFC;
}

.company-bank-dropdown__search {
    width: 100%;
    height: 36px;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 0 12px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    outline: none;
}

.company-bank-dropdown__search:focus {
    border-color: #60A5FA;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.company-bank-dropdown__list {
    max-height: 210px;
    overflow-y: auto;
}

.company-bank-option {
    width: 100%;
    border: none;
    background: transparent;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: #0F172A;
}

.company-bank-option:hover {
    background: #EFF6FF;
}

.company-bank-option__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F1F5F9;
    color: #64748B;
}

.company-bank-option:hover .company-bank-option__icon {
    background: #E0EFFF;
    color: #3B82F6;
}

.company-bank-option__glyph {
    display: block;
    width: 18px;
    height: 18px;
}

.company-bank-option__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-bank-option--empty {
    cursor: default;
    color: #94A3B8;
}