/*
 * Стили форм tod-forms, перенесённых с CF7 (список форм — includes/tod-forms.php,
 * herzl_tod_cf7_forms()). Всем этим формам фильтр tod_forms_wrapper_classes
 * добавляет класс .herzl-tod-form.
 *
 * 1. Общий вид полей, ошибок и галочек — как в эталонной форме hero_consult
 *    (.hero-form-block__form-card, css/builder-blocks.css).
 * 2. Раскладки: отступы, порядок блоков, кнопка, цвет текста согласий —
 *    по месту, где стоит форма.
 */

/* =====================================================================
   1. Общий вид (как hero_consult)
   ===================================================================== */

.herzl-tod-form .tod-form {
    margin: 0;
}

.herzl-tod-form .tod-form__group {
    position: relative;
    flex: none;
    gap: 0;
}

.herzl-tod-form .tod-form__label {
    display: none;
}

/* Перебивает и общие правила темы для полей в попапах (.form__group input, .popup-wrapper input) */
.herzl-tod-form .tod-form__input {
    width: 100%;
    height: 54px;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid #DDD;
    border-radius: 16px;
    outline: none;
    background: #F6F6F6;
    box-shadow: none;
    color: #1E2023;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: normal;
}

.herzl-tod-form .tod-form__input::placeholder {
    color: #999;
}

.herzl-tod-form .tod-form__input:hover {
    background: #F1F1F1;
}

.herzl-tod-form .tod-form__input:focus {
    background: #fff;
    border-color: #FB5446;
    box-shadow: 0 0 0 3px rgba(251, 84, 70, .12);
}

.herzl-tod-form .tod-form__input--invalid,
.herzl-tod-form .tod-form__input--invalid:hover {
    border-color: #F9423A;
    background: #FFF3F2;
}

/* Иконка пользователя в поле имени */
.herzl-tod-form .tod-form__group--name .tod-form__input {
    padding-left: 46px;
}

.herzl-tod-form .tod-form__group--name::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 21px;
    height: 16px;
    background: url(../images/icons/hero-form-user.svg) no-repeat center / contain;
    pointer-events: none;
    z-index: 1;
}

/* Текст ошибки — маленькая плашка внутри поля (absolute, форма не «прыгает») */
.herzl-tod-form .tod-form__group .tod-form__error {
    position: absolute;
    left: 15px;
    right: 15px;
    top: 2px;
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
    color: #F9423A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* ---- Галочки: кастомная галочка на CSS, ошибка — только цветом рамки ---- */

.herzl-tod-form .tod-form__checkbox-group {
    border: none;
}

.herzl-tod-form .tod-form__checkbox-row {
    position: relative;
    margin: 0 0 12px;
}

.herzl-tod-form .tod-form__checkbox-row:last-child {
    margin-bottom: 0;
}

.herzl-tod-form .tod-form__checkbox-row .tod-form__error {
    display: none;
}

.herzl-tod-form .tod-form__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1.35;
    text-align: left;
    color: #666;
}

.herzl-tod-form .tod-form__checkbox:has(input.tod-form__input--invalid) {
    background: transparent;
}

.herzl-tod-form .tod-form__checkbox a {
    color: #F9423A;
    text-decoration: underline;
}

.herzl-tod-form .tod-form__checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
    position: relative;
    top: 1px;
    border-radius: 6px;
    border: 1.5px solid #D6D6D6;
    outline: none;
    background-color: #fff;
    background-image: none;
    cursor: pointer;
    transition: border-color .2s, background-color .2s;
    animation: none;
}

.herzl-tod-form .tod-form__checkbox input[type="checkbox"]:hover {
    border-color: #B7B7B7;
}

.herzl-tod-form .tod-form__checkbox input[type="checkbox"]:checked {
    background-color: #FB5446;
    border-color: #FB5446;
}

.herzl-tod-form .tod-form__checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.herzl-tod-form .tod-form__checkbox input[type="checkbox"].tod-form__input--invalid {
    border-color: #F9423A;
    background-color: #fff;
}

/* Сообщение после отправки */
.herzl-tod-form .tod-form__status {
    padding: 0;
    border-radius: 0;
    background: none;
    font-size: 13px;
    text-align: left;
}

.herzl-tod-form .tod-form__status--success {
    color: #54aa12;
}

.herzl-tod-form .tod-form__status--error {
    color: #dc3232;
}

/* =====================================================================
   2. Раскладки
   ===================================================================== */

/* ---- Попапы: #callback-header, #callback-v2, #hidden__files-popup, #order (footer.php) ----
   Порядок как был в CF7: поля, кнопка, затем галочки. */

.popup-tod-form {
    padding: 0 0 20px;
}

.popup-tod-form .tod-form {
    display: flex;
    flex-direction: column;
}

.popup-tod-form .tod-form__row {
    order: 1;
    flex-direction: column;
    gap: 11px;
    margin: 0 0 11px;
}

.popup-tod-form .tod-form__actions {
    order: 2;
    display: block;
    margin: 0 0 11px;
}

.popup-tod-form .tod-form__checkbox-group {
    order: 3;
    margin: 0;
    padding: 20px 0 0;
}

.popup-tod-form .tod-form__status {
    order: 4;
    margin: 5px 0 0;
}

/* Кнопка как .popup-wrapper button (у #order — такая же) */
.popup-tod-form .tod-form__submit {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 1px 6px;
    border: none;
    border-radius: 16px;
    background-color: #FB5446;
    color: #FFFEFE;
    font-family: "Noto Sans";
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    transition: background-color .2s;
}

.popup-tod-form .tod-form__submit:hover {
    background-color: #e6483a;
}

/* ---- Тёмные блоки: белый текст согласий и общая кнопка ----
   want_citizenship ([form-custom]), баннер «Планируете получить гражданство…»,
   section-consultation */

.consultation-form--custom .herzl-tod-form .tod-form__checkbox,
.banner__form_wrap .herzl-tod-form .tod-form__checkbox,
.consultation-form__footer .herzl-tod-form .tod-form__checkbox,
.consultation-form--custom .herzl-tod-form .tod-form__checkbox a,
.banner__form_wrap .herzl-tod-form .tod-form__checkbox a,
.consultation-form__footer .herzl-tod-form .tod-form__checkbox a {
    color: #fff;
}

.consultation-form--custom .herzl-tod-form .tod-form__actions,
.banner__form_wrap .herzl-tod-form .tod-form__actions,
.consultation-form__footer .herzl-tod-form .tod-form__actions {
    display: block;
}

/* Кнопка как .consultation-form .btn */
.consultation-form--custom .herzl-tod-form .tod-form__submit,
.banner__form_wrap .herzl-tod-form .tod-form__submit,
.consultation-form__footer .herzl-tod-form .tod-form__submit {
    display: inline-block;
    width: 100%;
    height: 50px;
    padding: 13px 28px;
    border: none;
    border-radius: 16px;
    background-color: #FB5446;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.consultation-form--custom .herzl-tod-form .tod-form__submit:hover,
.banner__form_wrap .herzl-tod-form .tod-form__submit:hover,
.consultation-form__footer .herzl-tod-form .tod-form__submit:hover {
    background-color: #e63e30;
}

/* want_citizenship — consultation-form-custom.php, шорткод [form-custom].
   Порядок как в CF7: поля, галочки, кнопка. Сверху 15px — как у CF7
   (отступ скрытого .screen-reader-response p), снизу 20px — пустой .wpcf7-response-output. */
.consultation-form--custom .herzl-tod-form {
    padding: 15px 0 20px;
}

/* section_consult — template-parts/section-consultation.php. Как want_citizenship,
   но сверху без отступа (его поглощает margin-bottom заголовка). */
.consultation-form__footer .herzl-tod-form {
    padding: 0 0 20px;
}

.consultation-form--custom .herzl-tod-form .tod-form__row,
.consultation-form__footer .herzl-tod-form .tod-form__row {
    flex-direction: column;
    gap: 11px;
    margin: 0 0 11px;
}

.consultation-form--custom .herzl-tod-form .tod-form__checkbox-group,
.consultation-form__footer .herzl-tod-form .tod-form__checkbox-group {
    margin: 0 0 12px;
    padding: 20px 0 0;
}

.consultation-form--custom .herzl-tod-form .tod-form__status,
.consultation-form__footer .herzl-tod-form .tod-form__status {
    margin: 20px 0 -10px;
}

/* Баннер «Планируете получить гражданство Израиля?» (.banner__text-form_section):
   contacts, about, category (блог), category-2 (услуги), price-v3, page-partners,
   authors, single-post_author, faq. Порядок как в CF7: поля, кнопка, галочки. */
.banner__form_wrap .herzl-tod-form {
    padding: 16px 0 20px;
}

.banner__form_wrap .herzl-tod-form .tod-form {
    display: flex;
    flex-direction: column;
}

.banner__form_wrap .herzl-tod-form .tod-form__row {
    order: 1;
    flex-direction: column;
    gap: 11px;
    margin: 0 0 11px;
}

.banner__form_wrap .herzl-tod-form .tod-form__actions {
    order: 2;
    margin: 0 0 11px;
}

.banner__form_wrap .herzl-tod-form .tod-form__checkbox-group {
    order: 3;
    margin: 0;
    padding: 20px 0 0;
}

.banner__form_wrap .herzl-tod-form .tod-form__status {
    order: 4;
    margin: 20px 0 -10px;
}
