/* Модальная форма: ошибки, адаптив, не перебиваем btn-cta / form-control темы */

#callbackModal .modal-dialog {
    max-width: min(calc(100vw - 1.5rem), 28rem);
}

.callback-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.modal-body .callback-form-wrapper {
    max-width: none;
    margin: 0;
}

/* ——— Блок ошибок (яркая красная подсветка) ——— */
.callback-form .callback-errors {
    margin-bottom: 0.75rem;
    outline: none;
}

.callback-form .callback-errors.callback-errors--visible {
    animation: callback-errors-in 0.28s ease-out;
}

@keyframes callback-errors-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .callback-form .callback-errors.callback-errors--visible {
        animation: none;
    }
}

.callback-form .callback-form-errors {
    position: relative;
    overflow: hidden;
    border-radius: 0.6rem;
    border: 1px solid rgba(220, 53, 69, 0.55);
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 45%, #fff0f0 100%);
    box-shadow:
        0 0 0 1px rgba(220, 53, 69, 0.12),
        0 10px 28px rgba(220, 53, 69, 0.18);
}

.callback-form .callback-form-errors__accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #dc3545 0%, #b02a37 100%);
    border-radius: 0.6rem 0 0 0.6rem;
}

.callback-form .callback-form-errors__body {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem 0.85rem 1.1rem;
}

.callback-form .callback-form-errors__icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 1.15rem;
    color: #dc3545;
    line-height: 1;
}

.callback-form .callback-form-errors__list {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.45;
    color: #842029;
}

.callback-form .callback-form-errors__item {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.35rem;
}

.callback-form .callback-form-errors__item:last-child {
    margin-bottom: 0;
}

.callback-form .callback-form-errors__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #dc3545;
}

/* Поля с ошибкой */
.callback-form--modal-minimal .form-control.is-invalid,
.callback-form--modal-minimal .form-select.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.2);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.callback-form--modal-minimal .form-check-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.2);
}

.callback-form--modal-minimal .callback-form-check.form-check--invalid {
    padding: 0.65rem 0.75rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    border-radius: 0.5rem;
    background: rgba(220, 53, 69, 0.06);
    border: 1px dashed rgba(220, 53, 69, 0.45);
}

.callback-form--modal-minimal .callback-form-check.form-check--invalid .form-check-label {
    color: #842029;
}

/* Удобные зоны нажатия (touch) */
.callback-form--modal-minimal .form-control,
.callback-form--modal-minimal .form-select {
    min-height: 2.75rem;
    font-size: 1rem;
}

.callback-form--modal-minimal textarea.form-control {
    min-height: 5.5rem;
}

.callback-form--modal-minimal .form-check {
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

.callback-form--modal-minimal .form-check-input {
    width: 1.15em;
    height: 1.15em;
    margin-top: 0.2em;
}

.callback-form--modal-minimal .form-check-label {
    line-height: 1.4;
    padding-top: 0.05rem;
}

.callback-form--modal-minimal button[type="submit"] {
    min-height: 2.85rem;
    font-size: 1rem;
}

@media (min-width: 576px) {
    .callback-form--modal-minimal .form-control,
    .callback-form--modal-minimal .form-select {
        font-size: 1.02rem;
    }

    .callback-form--modal-minimal button[type="submit"] {
        min-height: 3rem;
        font-size: 1.05rem;
    }
}

/* Успех */
.callback-form-success {
    border-radius: 0.6rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    color: #0f5132;
    border: 1px solid rgba(25, 135, 84, 0.2);
}

.callback-form button[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.smart-captcha {
    min-height: 100px;
}

@media (max-width: 575.98px) {
    .callback-form-wrapper {
        padding-left: 0;
        padding-right: 0;
    }

    .modal-body .callback-form-wrapper {
        padding-left: 0;
        padding-right: 0;
    }

    .callback-form .callback-form-errors__body {
        padding: 0.75rem 0.85rem 0.75rem 1rem;
    }

    .callback-form .callback-form-errors__list {
        font-size: 0.9rem;
    }
}
