body, .container-wrapper, .admin-panel, .content-block,
.card, .btn, .modal-content, h1, h2, h3, h4, h5, h6 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container-wrapper {
    max-width: 1200px;  /* ИСПРАВЛЕНО: как в логине */
    margin: 5px auto;
    padding: 0 15px 80px 15px;
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
}

/* ФОРМА РЕГИСТРАЦИИ - КАК КАРТОЧКА, КАК В ЛОГИНЕ */
.register-form {
    background: white;
    padding: 30px 35px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 600px;      /* Немного шире чем логин, т.к. полей больше */
    margin: 20px auto 40px auto;  /* Отступы как в логине */
    transition: all 0.3s ease;
}

.form-title {
    color: #343a40;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
}

h3.form-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

.btn-submit {
    width: 100%;
    padding: 10px;
    font-weight: 500;
}

.captcha-check {
    margin: 20px 0;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
}
.password-wrapper {
    position: relative;
}
.password-wrapper input {
    padding-right: 40px;
}

/* ========== ВСЕ ПОЛЯ ВВОДА - ВСЕГДА ВИДИМЫЕ ========== */

.form-control,
.phone-input,
.form-select,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
select,
textarea {
    border: 2px solid #6c757d !important;
    background-color: #fefefe !important;
    transition: all 0.2s ease-in-out !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
}

.form-control:focus,
.phone-input:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: #0d6efd !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
}

.form-select {
    border: 2px solid #6c757d !important;
    background-color: #fefefe !important;
    cursor: pointer;
}

.form-select:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25) !important;
}

/* ========== ЧЕКБОКСЫ ========== */

.form-check-input {
    width: 1.2em !important;
    height: 1.2em !important;
    margin-top: 0.15em !important;
    border: 2px solid #6c757d !important;
    background-color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
}

.form-check-input:hover {
    border-color: #0d6efd !important;
    background-color: #e8f0fe !important;
}

.form-check-input:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
}

.form-check-input:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

/* ========== МЕТКИ И КОНТЕЙНЕРЫ ========== */

.form-label {
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 8px !important;
    font-size: 0.9rem;
}

.form-check-label {
    font-weight: 500 !important;
    color: #2c3e50 !important;
    margin-left: 5px !important;
}

.captcha-check {
    background-color: #f5f7fa !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    border: 1px solid #dee2e6 !important;
    margin: 15px 0 !important;
}

.form-text {
    color: #6c757d !important;
    font-size: 0.75rem !important;
    margin-top: 5px !important;
}

/* ========== КНОПКА ОТПРАВКИ ========== */

.btn-submit {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%) !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 12px !important;
    transition: all 0.2s ease !important;
    border-radius: 8px;
    font-size: 1rem;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3) !important;
}

.btn-submit:active {
    transform: translateY(0) !important;
}

/* ========== АЛЕРТЫ ========== */

.alert {
    border-radius: 10px !important;
    border-left: 4px solid !important;
    padding: 12px 15px !important;
    margin-bottom: 20px !important;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #f8d7da !important;
    border-left-color: #dc3545 !important;
    color: #721c24 !important;
}

.alert-info {
    background-color: #d1ecf1 !important;
    border-left-color: #17a2b8 !important;
    color: #0c5460 !important;
}

/* ========== КАСТОМНЫЙ SELECT ========== */

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fefefe;
    border: 2px solid #6c757d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.custom-select-trigger:hover {
    border-color: #0d6efd;
}

.custom-select-trigger.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.custom-select-trigger .selected-value {
    color: #2c3e50;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-trigger .arrow {
    margin-left: 10px;
    transition: transform 0.2s;
    color: #6c757d;
}

.custom-select-trigger.active .arrow {
    transform: rotate(180deg);
}

.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #0d6efd;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: opacity 0.15s ease-in-out;
    opacity: 0;
    -webkit-overflow-scrolling: touch;
}

.custom-dropdown.show {
    display: block;
    opacity: 1;
}

.custom-dropdown-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    white-space: normal;
    word-break: break-word;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.custom-dropdown-option:last-child {
    border-bottom: none;
}

.custom-dropdown-option:hover {
    background: #e8f0fe;
}

.custom-dropdown-option.selected {
    background: #0d6efd;
    color: white;
}

.custom-dropdown-search {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.custom-dropdown-search input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #6c757d;
    border-radius: 6px;
    font-size: 14px;
}

.custom-dropdown-search input:focus {
    border-color: #0d6efd;
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* ========== ПЛАНШЕТЫ (768px - 991px) ========== */

@media (min-width: 768px) and (max-width: 991px) {
    body {
        background-color: #f0f2f5;
    }

    .container-wrapper {
        max-width: 1200px;
        width: 100%;
        margin: 0 auto;
        padding: 0 15px 90px 15px !important;
    }

    .register-form {
        max-width: 550px;
        padding: 25px 30px;
        margin: 20px auto 40px auto;
    }

    .form-title {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }

    h3.form-title {
        font-size: 1.1rem;
    }

    .custom-dropdown-option {
        padding: 12px 14px !important;
        min-height: 44px;
    }

    .custom-dropdown-search input {
        font-size: 15px !important;
        padding: 10px 10px 10px 32px !important;
    }
}

/* ========== МОБИЛЬНЫЕ (до 767px) ========== */

@media (max-width: 767px) {
    body {
        background-color: #f0f2f5;
    }

    .container-wrapper {
        max-width: 1200px;
        width: 100%;
        margin: 0 auto;
        padding: 0 15px 120px 15px !important;
        min-height: calc(100vh - 140px);
    }

    .register-form {
        max-width: 500px;
        padding: 20px 24px;
        border-radius: 16px;
        margin: 15px auto 30px auto;
    }

    .form-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    h3.form-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .mb-3 {
        margin-bottom: 14px !important;
    }

    .form-label {
        font-size: 0.85rem;
        margin-bottom: 6px !important;
    }

    .form-control,
    .phone-input,
    .form-select,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        padding: 8px 12px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }

    .password-toggle {
        right: 10px;
    }

    .password-toggle i {
        font-size: 1rem;
    }

    .captcha-check {
        padding: 10px 12px !important;
        margin: 10px 0 !important;
    }

    .form-check-input {
        width: 1.1em !important;
        height: 1.1em !important;
        margin-top: 0.1em !important;
    }

    .form-check-label {
        font-size: 0.85rem !important;
        margin-left: 3px !important;
    }

    .form-text {
        font-size: 0.7rem !important;
    }

    .btn-submit {
        padding: 10px !important;
        font-size: 0.95rem !important;
        margin-bottom: 0 !important;
    }

    .alert {
        padding: 10px 12px !important;
        font-size: 0.85rem;
        border-radius: 8px !important;
    }

    .alert ul {
        padding-left: 20px;
    }

    /* Кастомный select на мобильных */
    .custom-select-trigger {
        min-height: 44px !important;
        padding: 10px 12px !important;
    }

    .custom-select-trigger .selected-value {
        font-size: 14px !important;
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.4 !important;
    }

    .custom-dropdown {
        max-height: 220px !important;
        max-height: 45vh !important;
        border-radius: 12px !important;
    }

    .custom-dropdown-option {
        padding: 14px 12px !important;
        font-size: 14px !important;
        min-height: 48px;
    }

    .custom-dropdown-search input {
        font-size: 16px !important;
        padding: 10px !important;
    }

    /* Улучшения для поиска */
    .custom-dropdown-search {
        position: relative;
        padding: 10px;
    }

    .custom-dropdown-search input {
        font-size: 16px !important;
        background-color: #fff !important;
        border: 1.5px solid #6c757d !important;
        border-radius: 8px !important;
        padding: 12px 12px 12px 35px !important;
        -webkit-appearance: none;
        appearance: none;
    }

    .custom-dropdown-search::before {
        content: "";
        position: absolute;
        left: 18px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 14px;
        color: #6c757d;
        pointer-events: none;
        z-index: 2;
    }
}

/* ========== ОЧЕНЬ МАЛЕНЬКИЕ ТЕЛЕФОНЫ (до 480px) ========== */

@media (max-width: 480px) {
    .container-wrapper {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 12px 140px 12px !important;
        min-height: calc(100vh - 120px);
    }

    .register-form {
        max-width: 94%;
        padding: 18px 20px;
        margin: 12px auto 25px auto;
        border-radius: 14px;
    }

    .form-title {
        font-size: 1.2rem;
        margin-bottom: 14px;
    }

    h3.form-title {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .mb-3 {
        margin-bottom: 12px !important;
    }

    .form-label {
        font-size: 0.8rem;
        margin-bottom: 5px !important;
    }

    .form-control,
    .phone-input,
    .form-select,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    select {
        padding: 7px 10px !important;
        font-size: 13px !important;
        border-width: 1.5px !important;
        border-radius: 8px !important;
    }

    .captcha-check {
        padding: 8px 10px !important;
    }

    .form-check-label {
        font-size: 0.8rem !important;
    }

    .btn-submit {
        padding: 10px !important;
        font-size: 0.9rem !important;
    }

    .alert-info {
        font-size: 0.75rem;
        padding: 8px 10px !important;
    }

    .alert-info strong {
        font-size: 0.8rem;
    }

    .captcha-check a {
        font-size: 0.8rem;
    }

    /* Кастомный select */
    .custom-select-trigger {
        min-height: 48px !important;
        padding: 12px 10px !important;
    }

    .custom-select-trigger .selected-value {
        font-size: 15px !important;
        line-height: 1.4 !important;
    }

    .custom-dropdown {
        max-height: 180px !important;
        max-height: 40vh !important;
    }

    .custom-dropdown-option {
        padding: 16px 12px !important;
        font-size: 14px !important;
        min-height: 52px;
    }

    .custom-dropdown-search {
        padding: 8px;
    }

    .custom-dropdown-search input {
        padding: 12px 12px 12px 35px !important;
        font-size: 16px !important;
        min-height: 48px;
    }
}

/* ОЧЕНЬ МАЛЕНЬКИЕ ТЕЛЕФОНЫ (до 360px) */
@media (max-width: 360px) {
    .register-form {
        max-width: 92%;
        padding: 14px 16px;
        margin: 10px auto 20px auto;
        border-radius: 12px;
    }

    .form-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    h3.form-title {
        font-size: 0.9rem;
    }

    .form-control,
    .phone-input,
    .form-select,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"] {
        padding: 6px 8px !important;
        font-size: 12px !important;
    }

    .btn-submit {
        padding: 8px !important;
        font-size: 0.85rem !important;
    }
}

/* ========== АЛЬБОМНАЯ ОРИЕНТАЦИЯ ========== */

@media (max-width: 767px) and (orientation: landscape) {
    .container-wrapper {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 15px 80px 15px !important;
        min-height: auto;
    }

    .register-form {
        max-width: 500px;
        padding: 12px 22px;
        margin: 10px auto 20px auto;
    }

    .mb-3 {
        margin-bottom: 10px !important;
    }

    .form-title {
        margin-bottom: 10px;
        font-size: 1.1rem;
    }

    h3.form-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .form-text {
        display: none;
    }

    .captcha-check {
        padding: 5px 10px !important;
    }

    .custom-dropdown {
        max-height: 160px !important;
    }
}

/* ========== RETINA ЭКРАНЫ ========== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .form-control,
    .phone-input,
    .form-select {
        border-width: 1.5px !important;
    }
}

/* ========== iOS FIX ========== */

@supports (-webkit-touch-callout: none) {
    .form-select {
        font-size: 16px !important;
    }
}


/* ========== ВЫДЕЛЕНИЕ ОБЯЗАТЕЛЬНЫХ ПОЛЕЙ ========== */

/* Легенда обязательных полей */
.required-legend {
    background: #f8f9fa;
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    border-left: 4px solid #dc3545;
    font-size: 0.85rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.required-legend .required-star {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.1rem;
}

/* ========== КРАСНАЯ ЗВЁЗДОЧКА ========== */
.required-star {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.2rem;
    margin-left: 2px;
    display: inline-block;
}

/* ========== МЕТКА ОБЯЗАТЕЛЬНОГО ПОЛЯ - ЖИРНЫЙ ШРИФТ ========== */
.form-label.required-label {
    font-weight: 800 !important;
    color: #1a1a2e !important;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

/* ========== КРАСНАЯ РАМКА ДЛЯ ОБЯЗАТЕЛЬНЫХ ПОЛЕЙ ========== */
.form-control.required-field,
.phone-input.required-field,
.form-select.required-field {
    border: 2px solid #dc3545 !important;
    background-color: #fffcfc !important;
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.1) !important;
    transition: all 0.2s ease !important;
}

/* Красная рамка при фокусе */
.form-control.required-field:focus,
.phone-input.required-field:focus,
.form-select.required-field:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2) !important;
    background-color: #fff8f8 !important;
}

/* Красная рамка при валидном заполнении (меняем на зелёную) */
.form-control.required-field:valid:not(:placeholder-shown),
.phone-input.required-field:valid:not(:placeholder-shown),
.form-select.required-field:valid:not(:placeholder-shown) {
    border-color: #198754 !important;
    background-color: #f8fff8 !important;
    box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.1) !important;
}

.form-control.required-field:valid:not(:placeholder-shown):focus,
.phone-input.required-field:valid:not(:placeholder-shown):focus,
.form-select.required-field:valid:not(:placeholder-shown):focus {
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.2) !important;
}

/* ========== ВЫДЕЛЕНИЕ ЧЕКБОКСОВ ========== */
.captcha-check.required-check {
    border: 2px solid #dc3545 !important;
    background-color: #fffcfc !important;
    border-radius: 8px !important;
    padding: 12px 15px !important;
}

.captcha-check.required-check .form-check-label {
    font-weight: 600 !important;
}

/* Адаптация для мобильных */
@media (max-width: 767px) {
    .form-label.required-label {
        font-size: 0.88rem !important;
    }

    .required-star {
        font-size: 1rem;
    }

    .required-legend {
        font-size: 0.78rem;
        padding: 6px 12px;
    }
}



/* ========== КАПЧА С ПОЛЗУНКОМ ========== */

.captcha-slider-container {
    background-color: #f5f7fa !important;
    padding: 20px 20px 15px !important;
    border-radius: 12px !important;
    border: 2px solid #dc3545 !important;
    margin: 15px 0 !important;
}

.slider-wrapper {
    position: relative;
    padding: 10px 0 5px 0;
    width: 100%;
}

/* Шкала с цифрами */
.slider-scale {
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
    margin-bottom: 2px;
    position: relative;
}

.scale-mark {
    font-size: 17px;
    font-weight: 700;
    color: #495057;
    width: 20px;
    text-align: center;
    position: relative;
}

/* Линии-разделители между цифрами */
.slider-scale::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 2px;
    background: #ced4da;
    transform: translateY(-50%);
    z-index: 0;
}

.scale-mark {
    background: #f5f7fa;
    padding: 0 4px;
    z-index: 1;
}

/* Сам ползунок */
.captcha-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #0d6efd 0%, #0d6efd 0%, #dee2e6 0%, #dee2e6 100%);
    border-radius: 3px;
    outline: none;
    margin: 8px 0;
    cursor: pointer;
}

.captcha-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
    transition: all 0.15s ease;
}

.captcha-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 12px rgba(13, 110, 253, 0.6);
}

.captcha-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
}

.captcha-slider::-moz-range-track {
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
}

/* Отображение текущего значения */
.slider-value-display {
    text-align: center;
    margin-top: 5px;
}

.slider-value-display span {
    display: inline-block;
    font-size: 20px;
    font-weight: 800;
    color: #0d6efd;
    background: white;
    padding: 2px 16px;
    border-radius: 8px;
    border: 2px solid #0d6efd;
    min-width: 40px;
}

/* Ошибка для слайдера */
.captcha-slider.captcha-error-slider::-webkit-slider-thumb {
    background: #dc3545 !important;
    box-shadow: 0 2px 12px rgba(220, 53, 69, 0.5) !important;
}

.captcha-slider.captcha-error-slider::-moz-range-thumb {
    background: #dc3545 !important;
    box-shadow: 0 2px 12px rgba(220, 53, 69, 0.5) !important;
}

.captcha-slider.captcha-error-slider {
    background: linear-gradient(to right, #dc3545 0%, #dc3545 0%, #dee2e6 0%, #dee2e6 100%) !important;
}

/* ========== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ========== */

@media (max-width: 767px) {
    .captcha-slider-container {
        padding: 16px 16px 12px !important;
    }

    .scale-mark {
        font-size: 15px;
        width: 16px;
    }

    .slider-scale {
        padding: 0 2px;
    }

    .slider-scale::before {
        left: 6px;
        right: 6px;
    }

    .captcha-slider::-webkit-slider-thumb {
        width: 26px;
        height: 26px;
    }

    .captcha-slider::-moz-range-thumb {
        width: 26px;
        height: 26px;
    }

    .slider-value-display span {
        font-size: 18px;
        padding: 2px 14px;
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .captcha-slider-container {
        padding: 12px 12px 10px !important;
    }

    .scale-mark {
        font-size: 14px;
        width: 14px;
    }

    .slider-scale {
        padding: 0 0px;
    }

    .slider-scale::before {
        left: 4px;
        right: 4px;
    }

    .captcha-slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    .captcha-slider::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }

    .slider-value-display span {
        font-size: 16px;
        padding: 2px 12px;
        min-width: 32px;
    }
}