* {
    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: 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;
}

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

.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 #E5E7EB;
    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: #E5E7EB;
    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);
}

/* 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) {
    .registration-page::before {
        width: 0;
    }

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

    .registration-page {
        padding: 20px 16px;
        min-height: 100vh;
        flex-direction: column;
        align-items: stretch;
        padding-top: 60px;
    }

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

    .registration-form-card {
        padding: 28px 24px 28px;
    }

    .back-button {
        position: absolute;
        top: 20px;
        left: 16px;
        width: 40px;
        height: 40px;
        z-index: 10;
        order: 0;
    }

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

    .brand-header {
        position: absolute;
        top: 20px;
        right: 16px;
        margin-bottom: 0;
        justify-content: center;
        z-index: 10;
        order: 0;
    }

    .logo-img {
        width: 140px;
        height: auto;
        max-width: 100%;
    }

    .registration-form-container {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        margin-top: 0;
        max-width: 100%;
        width: 100%;
        order: 2;
    }

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

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

/* Адаптивность для маленьких мобильных устройств */
@media (max-width: 480px) {
    .registration-page {
        padding: 16px;
        padding-top: 60px;
    }

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

    .registration-form-card {
        padding: 24px 20px 24px;
    }

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

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

    .brand-header {
        top: 16px;
        right: 16px;
    }

    .logo-img {
        width: 120px;
        height: auto;
        max-width: calc(100vw - 80px);
    }

    .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: 16px;
        padding-top: 60px;
        min-height: 100vh;
    }

    .back-button {
        top: 16px;
        left: 16px;
        width: 36px;
        height: 36px;
    }

    .brand-header {
        top: 16px;
        right: 16px;
    }

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