/**
 * Страница «Добавить компанию»: #contact-form-section (разметка в БД).
 * Акцент — как у темы: --pgt-hero-accent (#00c1b2 в style_2min.css).
 */

#contact-form-section {
  --acf-accent: var(--pgt-hero-accent, #00c1b2);
  --acf-border: #ced4da;
  --acf-text: #212529;
  --acf-muted: #6c757d;
  --acf-card-bg: #f8f9fa;
  --acf-radius: 0.375rem;
  box-sizing: border-box;
  color: var(--acf-text);
  font-size: 0.9375rem;
  line-height: 1.5;
}

#contact-form-section *,
#contact-form-section *::before,
#contact-form-section *::after {
  box-sizing: inherit;
}

/*
 * Заголовок .sec-head-container: на ширину viewport, как на остальных страницах.
 * Разметка часто внутри #blog-page > .container — без выноса полоса фона (.sec-head-style::after) визуально уже контента.
 * Тот же приём, что .white-bg > .container > .sec-head-container в pgt-discount-grid.css.
 */
#contact-form-section .sec-head-container {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
}

/* --- Заголовок страницы (если #page-name-sec на той же странице) --- */
#blog-page.page:has(#contact-form-section) #page-name-sec .container,
#blog-page.page:has(#contact-form-section) #page-name-sec .container-fluid {
  padding-top: clamp(1.25rem, 3vw, 2rem);
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
}

#blog-page.page:has(#contact-form-section) #page-name-sec h1,
#blog-page.page:has(#contact-form-section) #page-name-sec h2,
#blog-page.page:has(#contact-form-section) #page-name-sec .page-title {
  letter-spacing: 0.02em;
}

/* --- Форма: отступ снизу; сверху без зазора --- */
#blog-page.page:has(#contact-form-section) #contact-form-section {
  padding-top: 0;
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

#contact-form-section > .container,
#contact-form-section > .container-fluid {
  max-width: 100%;
}

#contact-form-section form {
  margin: 0;
}

/* Новая сетка чанка relayout: контакты | файлы | опции+отправка; ниже 4 колонки каталога */
#contact-form-section form.add-company-form {
  width: 100%;
  max-width: 100%;
}

#contact-form-section .contact-form-container {
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 0;
}

#contact-form-section .add-company-col-uploads h3,
#contact-form-section .add-company-col-actions h3 {
  font-size: 1.05rem;
  margin-top: 1rem;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

#contact-form-section .add-company-col-uploads h3:first-child,
#contact-form-section .add-company-col-actions h3:first-child {
  margin-top: 0;
}

#contact-form-section .add-company-col-actions #submit {
  margin-top: 1.1rem;
}

@media (min-width: 992px) {
  #contact-form-section .add-company-row-catalog .add-company-catalog-col {
    background: var(--acf-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--acf-radius);
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    min-height: 100%;
  }

  #contact-form-section .add-company-row-top > [class*="col-"] {
    background: var(--acf-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--acf-radius);
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  }
}

@media (min-width: 576px) {
  /*
   * Две колонки: производители автоматики/комплектация; регион + производители ворот (короткие подписи).
   * Товарные позиции без мультиколонки — одна колонка на всю ширину ячейки.
   */
  #contact-form-section .add-company-catalog-col:has(input[name="vendors[]"]),
  #contact-form-section .add-company-catalog-col:has(input[name="region[]"]) {
    column-count: 2;
    column-gap: 0.85rem;
    column-fill: balance;
  }

  #contact-form-section .add-company-catalog-col:has(input[name="vendors[]"]) > h3,
  #contact-form-section .add-company-catalog-col:has(input[name="vendors[]"]) > h4,
  #contact-form-section .add-company-catalog-col:has(input[name="region[]"]) > h3,
  #contact-form-section .add-company-catalog-col:has(input[name="region[]"]) > h4 {
    column-span: all;
    break-inside: avoid;
  }

  #contact-form-section .add-company-catalog-col:has(input[name="vendors[]"]) > input[type="hidden"],
  #contact-form-section .add-company-catalog-col:has(input[name="region[]"]) > input[type="hidden"] {
    column-span: all;
  }

  #contact-form-section .add-company-catalog-col:has(input[name="vendors[]"]) > p,
  #contact-form-section .add-company-catalog-col:has(input[name="region[]"]) > p {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /*
   * В одной ячейке с регионом/брендами (multicol): «Автоматика для ворот», «Шлагбаумы…».
   * Обёртка в чанке .acf-addcompany-goodies-single — блок на всю ширину ячейки, внутри одна колонка.
   */
  #contact-form-section .add-company-catalog-col .acf-addcompany-goodies-single {
    column-span: all;
    break-inside: avoid;
    column-count: 1;
    display: flow-root;
  }
}

/* Honeypot в чанке: <input class="subject" name="subject"> без подписи — не показываем пользователю */
#contact-form-section input.subject[name="subject"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Редко: таблица сразу в #contact-form-section без .container */
#contact-form-section > table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

#contact-form-section > table > tbody > tr > td,
#contact-form-section > table > tr > td {
  vertical-align: top;
  padding: 0 0.75rem;
}

#contact-form-section > table > tbody > tr > td:first-child,
#contact-form-section > table > tr > td:first-child {
  padding-left: 0;
}

#contact-form-section > table > tbody > tr > td:last-child,
#contact-form-section > table > tr > td:last-child {
  padding-right: 0;
}

@media (max-width: 991.98px) {
  #contact-form-section > table,
  #contact-form-section > table tbody,
  #contact-form-section > table tr,
  #contact-form-section > table td {
    display: block;
    width: 100% !important;
    height: auto !important;
  }

  #contact-form-section > table tr {
    margin-bottom: 1.75rem;
  }

  #contact-form-section > table > tbody > tr > td,
  #contact-form-section > table > tr > td {
    padding: 0 0 1.5rem !important;
  }
}

@media (min-width: 992px) {
  #contact-form-section > table > tbody > tr > td,
  #contact-form-section > table > tr > td {
    background: var(--acf-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--acf-radius);
    padding: 1rem 1.1rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  }

  #contact-form-section > table {
    border-collapse: separate;
    border-spacing: 0.75rem 0;
  }

  #contact-form-section > table > tbody > tr > td:first-child,
  #contact-form-section > table > tr > td:first-child {
    padding-left: 1.1rem !important;
  }

  #contact-form-section > table > tbody > tr > td:last-child,
  #contact-form-section > table > tr > td:last-child {
    padding-right: 1.1rem !important;
  }
}

/* Трёхколоночная таблица внутри контейнера (типичная вёрстка страницы) */
#contact-form-section .container table,
#contact-form-section .container-fluid table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

#contact-form-section .container table > tbody > tr > td,
#contact-form-section .container table > tr > td,
#contact-form-section .container-fluid table > tbody > tr > td,
#contact-form-section .container-fluid table > tr > td {
  vertical-align: top;
  padding: 0 0.75rem;
}

#contact-form-section .container table > tbody > tr > td:first-child,
#contact-form-section .container table > tr > td:first-child,
#contact-form-section .container-fluid table > tbody > tr > td:first-child,
#contact-form-section .container-fluid table > tr > td:first-child {
  padding-left: 0;
}

#contact-form-section .container table > tbody > tr > td:last-child,
#contact-form-section .container table > tr > td:last-child,
#contact-form-section .container-fluid table > tbody > tr > td:last-child,
#contact-form-section .container-fluid table > tr > td:last-child {
  padding-right: 0;
}

@media (max-width: 991.98px) {
  #contact-form-section .container table,
  #contact-form-section .container-fluid table,
  #contact-form-section .container tbody,
  #contact-form-section .container-fluid tbody,
  #contact-form-section .container tr,
  #contact-form-section .container-fluid tr,
  #contact-form-section .container td,
  #contact-form-section .container-fluid td {
    display: block;
    width: 100% !important;
    height: auto !important;
  }

  #contact-form-section .container tr,
  #contact-form-section .container-fluid tr {
    margin-bottom: 1.75rem;
  }

  #contact-form-section .container table > tbody > tr > td,
  #contact-form-section .container table > tr > td,
  #contact-form-section .container-fluid table > tbody > tr > td,
  #contact-form-section .container-fluid table > tr > td {
    padding: 0 0 1.5rem !important;
  }
}

/* Подзаголовки категорий в ячейках */
#contact-form-section > table td > b,
#contact-form-section > table td > strong,
#contact-form-section .container td > b,
#contact-form-section .container td > strong,
#contact-form-section .container-fluid td > b,
#contact-form-section .container-fluid td > strong {
  display: block;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--acf-text);
  line-height: 1.35;
}

#contact-form-section > table td > b:first-child,
#contact-form-section > table td > strong:first-child,
#contact-form-section .container td > b:first-child,
#contact-form-section .container td > strong:first-child,
#contact-form-section .container-fluid td > b:first-child,
#contact-form-section .container-fluid td > strong:first-child {
  margin-top: 0;
}

/* Блок «Товарные позиции» и похожие абзацы-заголовки */
/* Тема задаёт `.page p { text-align: justify }` — в форме подписи чекбоксов выравниваем влево */
#contact-form-section p {
  margin: 0 0 0.75rem;
  text-align: left;
  text-justify: auto;
}

#contact-form-section > table td > p:first-child > b,
#contact-form-section > table td > p:first-child > strong,
#contact-form-section .container td > p:first-child > b,
#contact-form-section .container td > p:first-child > strong,
#contact-form-section .container-fluid td > p:first-child > b,
#contact-form-section .container-fluid td > p:first-child > strong {
  font-size: 0.9375rem;
  text-transform: none;
  letter-spacing: 0;
}

/* Карточки: оборачиваем визуально группы чекбоксов (лёгкий фон у ячейки на md+) */
@media (min-width: 992px) {
  #contact-form-section .container table > tbody > tr > td,
  #contact-form-section .container table > tr > td,
  #contact-form-section .container-fluid table > tbody > tr > td,
  #contact-form-section .container-fluid table > tr > td {
    background: var(--acf-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--acf-radius);
    padding: 1rem 1.1rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  }

  #contact-form-section .container table > tbody > tr > td + td,
  #contact-form-section .container table > tr > td + td,
  #contact-form-section .container-fluid table > tbody > tr > td + td,
  #contact-form-section .container-fluid table > tr > td + td {
    margin-left: 0;
  }

  #contact-form-section .container table,
  #contact-form-section .container-fluid table {
    border-collapse: separate;
    border-spacing: 0.75rem 0;
  }

  #contact-form-section .container table > tbody > tr > td:first-child,
  #contact-form-section .container table > tr > td:first-child,
  #contact-form-section .container-fluid table > tbody > tr > td:first-child,
  #contact-form-section .container-fluid table > tr > td:first-child {
    padding-left: 1.1rem !important;
  }

  #contact-form-section .container table > tbody > tr > td:last-child,
  #contact-form-section .container table > tr > td:last-child,
  #contact-form-section .container-fluid table > tbody > tr > td:last-child,
  #contact-form-section .container-fluid table > tr > td:last-child {
    padding-right: 1.1rem !important;
  }
}

/* Текстовые поля */
#contact-form-section input[type="text"],
#contact-form-section input[type="email"],
#contact-form-section input[type="tel"],
#contact-form-section input[type="url"],
#contact-form-section input[type="number"],
#contact-form-section input:not([type]) {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.65rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--acf-text);
  background-color: #fff;
  border: 1px solid var(--acf-border);
  border-radius: var(--acf-radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#contact-form-section textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 7rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--acf-text);
  background-color: #fff;
  border: 1px solid var(--acf-border);
  border-radius: var(--acf-radius);
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#contact-form-section input[type="text"]:hover,
#contact-form-section input[type="email"]:hover,
#contact-form-section input[type="tel"]:hover,
#contact-form-section input[type="url"]:hover,
#contact-form-section input[type="number"]:hover,
#contact-form-section input:not([type]):hover,
#contact-form-section textarea:hover {
  border-color: #adb5bd;
}

#contact-form-section input[type="text"]:focus,
#contact-form-section input[type="email"]:focus,
#contact-form-section input[type="tel"]:focus,
#contact-form-section input[type="url"]:focus,
#contact-form-section input[type="number"]:focus,
#contact-form-section input:not([type]):focus,
#contact-form-section textarea:focus {
  border-color: var(--acf-accent);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 193, 178, 0.22);
}

#contact-form-section input:focus-visible,
#contact-form-section textarea:focus-visible,
#contact-form-section select:focus-visible {
  outline: 2px solid var(--acf-accent);
  outline-offset: 2px;
}

/* Чекбоксы: крупнее зона, акцент темы */
#contact-form-section input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.35rem 0.5rem 0.35rem 0;
  vertical-align: middle;
  flex-shrink: 0;
  accent-color: var(--acf-accent);
  cursor: pointer;
}

#contact-form-section label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0 0 0.2rem;
  padding: 0.35rem 0.4rem 0.35rem 0.15rem;
  max-width: 100%;
  text-align: left;
  text-justify: auto;
  cursor: pointer;
  line-height: 1.45;
  border-radius: calc(var(--acf-radius) - 2px);
  transition: background-color 0.12s ease;
}

#contact-form-section label:hover {
  background-color: rgba(0, 193, 178, 0.06);
}

/* Строка «текст + чекбокс» без label (legacy): чуть воздуха между br и следующей строкой */
#contact-form-section > table td,
#contact-form-section .container td,
#contact-form-section .container-fluid td {
  line-height: 1.55;
}

/* --- Колонки 2–3: компактные списки чекбоксов (1–3 логических колонки по ширине) --- */
@media (min-width: 576px) {
  /*
   * Чанк tpl.AjaxForm.addCompany: колонки формы — прямые .col-md-4 у form или внутри .row.
   * Раньше был column-width: в узкой col-md-4 получался один столбик; для производителей нужны ровно 2.
   */
  /* nth-of-type: между тегами в чанке бывают текстовые узлы — nth-child ломается */
  #contact-form-section #contact-form > div.col-md-4:nth-of-type(2),
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(2),
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(2),
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(2) {
    column-count: 2;
    column-gap: 1rem;
    column-fill: balance;
  }

  #contact-form-section #contact-form > div.col-md-4:nth-of-type(3),
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(3),
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(3),
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(3) {
    column-count: 2;
    column-gap: 1rem;
    column-fill: balance;
  }

  #contact-form-section #contact-form > div.col-md-4:nth-of-type(2) > h3,
  #contact-form-section #contact-form > div.col-md-4:nth-of-type(2) > h4,
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(2) > h3,
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(2) > h4,
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(2) > h3,
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(2) > h4,
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(2) > h3,
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(2) > h4 {
    column-span: all;
    break-inside: avoid;
  }

  #contact-form-section #contact-form > div.col-md-4:nth-of-type(2) > input[type="hidden"],
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(2) > input[type="hidden"],
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(2) > input[type="hidden"],
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(2) > input[type="hidden"] {
    column-span: all;
  }

  #contact-form-section #contact-form > div.col-md-4:nth-of-type(2) > p,
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(2) > p,
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(2) > p,
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(2) > p {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #contact-form-section #contact-form > div.col-md-4:nth-of-type(3) > h3,
  #contact-form-section #contact-form > div.col-md-4:nth-of-type(3) > input[type="file"],
  #contact-form-section #contact-form > div.col-md-4:nth-of-type(3) > p:has(input[type="file"]),
  #contact-form-section #contact-form > div.col-md-4:nth-of-type(3) > div#submit,
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(3) > h3,
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(3) > input[type="file"],
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(3) > p:has(input[type="file"]),
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(3) > div#submit,
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(3) > h3,
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(3) > input[type="file"],
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(3) > p:has(input[type="file"]),
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(3) > div#submit,
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(3) > h3,
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(3) > input[type="file"],
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(3) > p:has(input[type="file"]),
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(3) > div#submit {
    column-span: all;
    break-inside: avoid;
  }

  #contact-form-section #contact-form > div.col-md-4:nth-of-type(3) > input[type="hidden"],
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(3) > input[type="hidden"],
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(3) > input[type="hidden"],
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(3) > input[type="hidden"] {
    column-span: all;
  }

  #contact-form-section #contact-form > div.col-md-4:nth-of-type(3) > p,
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(3) > p,
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(3) > p,
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(3) > p {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #contact-form-section #contact-form > div.col-md-4:nth-of-type(2) br,
  #contact-form-section #contact-form > div.col-md-4:nth-of-type(3) br,
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(2) br,
  #contact-form-section #contact-form > .row > div.col-md-4:nth-of-type(3) br,
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(2) br,
  .contact-form-container #contact-form > div.col-md-4:nth-of-type(3) br,
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(2) br,
  .contact-form-container #contact-form > .row > div.col-md-4:nth-of-type(3) br {
    display: none;
  }

  #contact-form-section > table > tbody > tr > td:nth-child(2),
  #contact-form-section > table > tr > td:nth-child(2),
  #contact-form-section .container table > tbody > tr > td:nth-child(2),
  #contact-form-section .container table > tr > td:nth-child(2),
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(2),
  #contact-form-section .container-fluid table > tr > td:nth-child(2) {
    column-count: 2;
    column-gap: 1rem;
    column-fill: balance;
  }

  #contact-form-section > table > tbody > tr > td:nth-child(3),
  #contact-form-section > table > tr > td:nth-child(3),
  #contact-form-section .container table > tbody > tr > td:nth-child(3),
  #contact-form-section .container table > tr > td:nth-child(3),
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(3),
  #contact-form-section .container-fluid table > tr > td:nth-child(3) {
    column-count: 2;
    column-gap: 1rem;
    column-fill: balance;
  }

  /* Заголовки секций и блоки на всю ширину ячейки */
  #contact-form-section > table > tbody > tr > td:nth-child(2) > b,
  #contact-form-section > table > tbody > tr > td:nth-child(2) > strong,
  #contact-form-section > table > tbody > tr > td:nth-child(2) > p,
  #contact-form-section > table > tr > td:nth-child(2) > b,
  #contact-form-section > table > tr > td:nth-child(2) > strong,
  #contact-form-section > table > tr > td:nth-child(2) > p,
  #contact-form-section .container table > tbody > tr > td:nth-child(2) > b,
  #contact-form-section .container table > tbody > tr > td:nth-child(2) > strong,
  #contact-form-section .container table > tbody > tr > td:nth-child(2) > p,
  #contact-form-section .container table > tr > td:nth-child(2) > b,
  #contact-form-section .container table > tr > td:nth-child(2) > strong,
  #contact-form-section .container table > tr > td:nth-child(2) > p,
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(2) > b,
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(2) > strong,
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(2) > p,
  #contact-form-section .container-fluid table > tr > td:nth-child(2) > b,
  #contact-form-section .container-fluid table > tr > td:nth-child(2) > strong,
  #contact-form-section .container-fluid table > tr > td:nth-child(2) > p,
  #contact-form-section > table > tbody > tr > td:nth-child(3) > b,
  #contact-form-section > table > tbody > tr > td:nth-child(3) > strong,
  #contact-form-section > table > tbody > tr > td:nth-child(3) > p,
  #contact-form-section > table > tr > td:nth-child(3) > b,
  #contact-form-section > table > tr > td:nth-child(3) > strong,
  #contact-form-section > table > tr > td:nth-child(3) > p,
  #contact-form-section .container table > tbody > tr > td:nth-child(3) > b,
  #contact-form-section .container table > tbody > tr > td:nth-child(3) > strong,
  #contact-form-section .container table > tbody > tr > td:nth-child(3) > p,
  #contact-form-section .container table > tr > td:nth-child(3) > b,
  #contact-form-section .container table > tr > td:nth-child(3) > strong,
  #contact-form-section .container table > tr > td:nth-child(3) > p,
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(3) > b,
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(3) > strong,
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(3) > p,
  #contact-form-section .container-fluid table > tr > td:nth-child(3) > b,
  #contact-form-section .container-fluid table > tr > td:nth-child(3) > strong,
  #contact-form-section .container-fluid table > tr > td:nth-child(3) > p {
    column-span: all;
    break-inside: avoid;
  }

  /* Файлы и отправка — на всю ширину колонки формы */
  #contact-form-section > table > tbody > tr > td:nth-child(3) > input[type="file"],
  #contact-form-section > table > tr > td:nth-child(3) > input[type="file"],
  #contact-form-section .container table > tbody > tr > td:nth-child(3) > input[type="file"],
  #contact-form-section .container table > tr > td:nth-child(3) > input[type="file"],
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(3) > input[type="file"],
  #contact-form-section .container-fluid table > tr > td:nth-child(3) > input[type="file"],
  #contact-form-section > table > tbody > tr > td:nth-child(3) > input[type="submit"],
  #contact-form-section > table > tr > td:nth-child(3) > input[type="submit"],
  #contact-form-section .container table > tbody > tr > td:nth-child(3) > input[type="submit"],
  #contact-form-section .container table > tr > td:nth-child(3) > input[type="submit"],
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(3) > input[type="submit"],
  #contact-form-section .container-fluid table > tr > td:nth-child(3) > input[type="submit"],
  #contact-form-section > table > tbody > tr > td:nth-child(3) > button[type="submit"],
  #contact-form-section > table > tr > td:nth-child(3) > button[type="submit"],
  #contact-form-section .container table > tbody > tr > td:nth-child(3) > button[type="submit"],
  #contact-form-section .container table > tr > td:nth-child(3) > button[type="submit"],
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(3) > button[type="submit"],
  #contact-form-section .container-fluid table > tr > td:nth-child(3) > button[type="submit"] {
    column-span: all;
  }

  /* Меньше «дыр» от <br> в многоколоночном потоке */
  #contact-form-section > table > tbody > tr > td:nth-child(2) br,
  #contact-form-section > table > tr > td:nth-child(2) br,
  #contact-form-section .container table > tbody > tr > td:nth-child(2) br,
  #contact-form-section .container table > tr > td:nth-child(2) br,
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(2) br,
  #contact-form-section .container-fluid table > tr > td:nth-child(2) br,
  #contact-form-section > table > tbody > tr > td:nth-child(3) br,
  #contact-form-section > table > tr > td:nth-child(3) br,
  #contact-form-section .container table > tbody > tr > td:nth-child(3) br,
  #contact-form-section .container table > tr > td:nth-child(3) br,
  #contact-form-section .container-fluid table > tbody > tr > td:nth-child(3) br,
  #contact-form-section .container-fluid table > tr > td:nth-child(3) br {
    display: none;
  }
}

/* Файлы */
#contact-form-section input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0.35rem 0 1rem;
  font-size: 0.875rem;
  color: var(--acf-muted);
}

#contact-form-section input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--acf-text);
  background: #fff;
  border: 1px solid var(--acf-accent);
  border-radius: var(--acf-radius);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

#contact-form-section input[type="file"]::file-selector-button:hover {
  background: rgba(0, 193, 178, 0.12);
}

/* Подписи к файлам */
#contact-form-section > table td > br + input[type="file"],
#contact-form-section .container td > br + input[type="file"],
#contact-form-section .container-fluid td > br + input[type="file"] {
  margin-top: 0.5rem;
}

/* Кнопка отправки */
#contact-form-section input[type="submit"],
#contact-form-section button[type="submit"] {
  display: inline-block;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 2.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff !important;
  background-color: var(--acf-accent) !important;
  border: 2px solid var(--acf-accent) !important;
  border-radius: var(--acf-radius);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 193, 178, 0.35);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

#contact-form-section input[type="submit"]:hover,
#contact-form-section button[type="submit"]:hover {
  filter: brightness(0.95);
  box-shadow: 0 3px 10px rgba(0, 193, 178, 0.45);
}

#contact-form-section input[type="submit"]:active,
#contact-form-section button[type="submit"]:active {
  transform: translateY(1px);
}

#contact-form-section input[type="submit"]:focus-visible,
#contact-form-section button[type="submit"]:focus-visible {
  outline: 2px solid var(--acf-accent);
  outline-offset: 3px;
}

/* AjaxForm / FormIt сообщения и ошибки полей */
#contact-form-section .alert {
  border-radius: var(--acf-radius);
  margin-bottom: 1rem;
}

/* Пустые слоты FormIt / пустые div.error после удаления иконки из чанка */
#contact-form-section span[class*="error"]:empty,
#contact-form-section span[class^="error_"]:empty,
#contact-form-section div.error:empty,
#contact-form-section span.error:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  background: none !important;
}

/* Текст ошибки без «красной плашки» (только строка под полем) */
#contact-form-section span[class*="error"]:not(:empty),
#contact-form-section span[class^="error_"]:not(:empty),
#contact-form-section .error:not(:empty),
#contact-form-section div.error:not(:empty) {
  display: block;
  margin-top: 0.2rem;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #b02a37;
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Bootstrap 5: убрать красную обводку/иконку у полей на этой странице */
#contact-form-section .form-control.is-invalid,
#contact-form-section .form-select.is-invalid,
#contact-form-section input.is-invalid,
#contact-form-section textarea.is-invalid,
#contact-form-section select.is-invalid {
  border-color: var(--acf-border) !important;
  background-image: none !important;
  padding-right: 0.75rem !important;
  box-shadow: none !important;
}

#contact-form-section .invalid-feedback,
#contact-form-section .valid-feedback {
  display: none !important;
}

#contact-form-section .form-control.is-invalid:focus,
#contact-form-section input.is-invalid:focus,
#contact-form-section textarea.is-invalid:focus,
#contact-form-section select.is-invalid:focus {
  border-color: var(--acf-accent) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 193, 178, 0.22) !important;
}

/* Нативная :invalid у required до фокуса — без «красной рамки», остаётся обычная граница */
#contact-form-section input[required]:invalid:not(:focus),
#contact-form-section textarea[required]:invalid:not(:focus),
#contact-form-section select[required]:invalid:not(:focus) {
  border-color: var(--acf-border);
  box-shadow: none;
}
