/* =====================================================
   FIX: .feedback2 на странице контактов имеет width:93% + margin-left:~17%
   (=110% ширины) — это уводит страницу вправо на ~190px.
   Сбрасываем блок до ширины контейнера; !important гарантирует
   приоритет над CSS шаблона независимо от порядка подключения.
   ===================================================== */
.feedback2 {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    padding: 24px 16px 48px !important;
    overflow-x: clip;
}

/* AJAX-обёртка Битрикса #comp_* внутри .feedback2 */
.feedback2 > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}/* =====================================================

   Форма обратной связи SIMPLE_FORM_3 — шаблон richback
   Учитывая вёрстку сайта: фикс-сайдбар слева, узкая контент-колонка,
   обёртки без border-box → все размеры считаем сами.
   ===================================================== */

/* 🛡️ Страховка от горизонтального скролла: блок формы не может
   расширить страницу ни при каких внутренних min-content */
.feedback2 {
    width: 100%;
    max-width: 100%;
    overflow-x: clip; /* clip, а не hidden — не ломает position:sticky сайта */
}

/* Карточка формы: резиновая, центрируется в контент-колонке страницы */
.feedback-form {
    box-sizing: border-box;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 28px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    font-family: inherit; /* шрифты сайта, не свои */
}

/* 🛡️ Ключевая правка: все дети формы — border-box и min-width:0,
   чтобы grid/flex не наследовал внутреннюю ширину input'ов */
.feedback-form *,
.feedback-form *::before,
.feedback-form *::after {
    box-sizing: border-box;
    min-width: 0;
}

.feedback-form__header {
    margin-bottom: 28px;
    text-align: center;
}

.feedback-form__title {
    font-size: 26px;
    font-weight: 700;
    color: #282F3B;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.feedback-form__description {
    font-size: 15px;
    color: #68717E;
    line-height: 1.5;
    margin: 0;
}

/* Сетка полей: 2 колонки на десктопе, но колонки резиновые (minmax(0,1fr)),
   а не 1fr — это и убирает min-content распирание */
.feedback-form__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.form-field__label {
    font-size: 14px;
    font-weight: 600;
    color: #282F3B;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}

.form-field__required {
    color: #E53935;
    font-size: 15px;
}

.form-field__input,
.form-field__textarea {
    width: 100%;
    min-width: 0;           /* 🛡️ input больше не диктует ширину колонке */
    font: inherit;
    font-size: 15px;
    padding: 11px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #F6F7F8;    /* как поля поиска на сайте */
    color: #282F3B;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.form-field__input:focus,
.form-field__textarea:focus {
    outline: none;
    border-color: #43A047;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.12);
}

.form-field__input::placeholder,
.form-field__textarea::placeholder {
    color: #9AA3AD;
}

.form-field__textarea {
    resize: vertical;
    min-height: 120px;
    max-height: 320px;
}

.feedback-form__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.feedback-form__submit {
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #43A047;    /* фирменный зелёный сайта */
    border: none;
    border-radius: 10px;
    padding: 13px 40px;
    cursor: pointer;
    transition: background .2s ease, transform .1s ease, box-shadow .2s ease;
    width: 100%;
    max-width: 320px;
}

.feedback-form__submit:hover {
    background: #388E3C;
    box-shadow: 0 4px 12px rgba(67, 160, 71, 0.3);
}

.feedback-form__submit:active {
    transform: translateY(1px);
    box-shadow: none;
}

.feedback-form__privacy {
    font-size: 13px;
    color: #68717E;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

.feedback-form__privacy-link {
    color: #43A047;
    text-decoration: none;
}

.feedback-form__privacy-link:hover {
    text-decoration: underline;
}

/* Ошибки и уведомления */
.form-errors {
    box-sizing: border-box;
    max-width: 640px;
    margin: 0 auto 20px auto;
    background: #FDECEA;
    border: 1px solid #F5B7B4;
    border-radius: 10px;
    padding: 14px 18px;
    color: #B71C1C;
    font-size: 14px;
    line-height: 1.5;
}

.form-note {
    box-sizing: border-box;
    max-width: 640px;
    margin: 0 auto 20px auto;
    background: #E8F5E9;
    border: 1px solid #A5D6A7;
    border-radius: 10px;
    padding: 14px 18px;
    color: #1B5E20;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* Иконка успеха (result.php) */
.feedback-form__success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.feedback-form__success-icon svg {
    animation: rbSuccessPulse .6s ease-out;
}

@keyframes rbSuccessPulse {
    0%   { transform: scale(0);   opacity: 0; }
    50%  { transform: scale(1.1); }
    100% { transform: scale(1);   opacity: 1; }
}

/* =====================================================
   Адаптив: на узких экранах (и в узкой контент-колонке
   рядом с фикс-сайдбаром) — одна колонка полей
   ===================================================== */
@media (max-width: 860px) {
    .feedback-form {
        padding: 24px 18px;
    }

    .feedback-form__title {
        font-size: 22px;
    }

    .feedback-form__fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .feedback-form__submit {
        max-width: 100%;
    }
}
.form-field__file {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font: inherit;
    font-size: 14px;
    color: #282F3B;
    padding: 10px 12px;
    border: 1px dashed #C7CCD1;
    border-radius: 10px;
    background: #F6F7F8;
    cursor: pointer;
}

.form-field__file:hover {
    border-color: #43A047;
    background: #fff;
}