/**
 * Формы по ТЗ «Доработка форм обратной связи» (28.10.2026):
 *   .pvf--dealer  «Стать дилером» (/dealer/), Figma 1:3070;
 *   .pvf--opt     «Получите оптовое предложение», Figma 1:3119, 1:3649, 1:3166;
 *   .pvf-help     «Чем мы можем вам помочь?» перед подвалом, Figma 1:2792,
 *                 1:2869, 1:2945, 1:3008.
 * Размеры и цвета сняты из макета: секция 1420, скругление 24, отступ 40,
 * колонка 760 (в подвале 820); поля 48, кнопки 48, вкладки 56; заголовок
 * Manrope 30, текст Inter 15-16.
 *
 * Мобильных макетов нет - по решению заказчика адаптив сделан по образцу
 * прежних форм сайта (kp2__form): с 1024 фото уходит под затемнение, с 768
 * поля в одну колонку.
 */

/* ---------- общая секция-баннер (формы 1 и 2) ---------- */

.pvf {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 40px;
  border-radius: 24px;
  background: linear-gradient(107.5deg, #064A69 1.25%, #2A779A 99.65%);
  color: #fff;
  font-family: Inter, sans-serif;
}

/* Фон, фото и менеджер обрезаются по скруглению здесь, а не на самой
   секции: открытый список регионов должен выходить за её нижний край */
.pvf__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

/* Фото справа: с 660px от левого края до конца секции */
.pvf__photo {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 660px;
  background-size: cover;
  background-position: center;
}

.pvf__photo--dealer {
  background-image: linear-gradient(89deg, rgba(22, 94, 127, 0) 71.65%, #165E7F 99.57%), url(/local/forms/img/dealer-bg.webp);
}

.pvf__photo--opt {
  background-image: linear-gradient(89deg, #165E7F .43%, rgba(22, 94, 127, 0) 27.17%), url(/local/forms/img/opt-bg.webp);
}

/* Тёмная заливка слева направо - на ней лежит текст */
.pvf__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #064A69 52.78%, rgba(6, 74, 105, 0) 100%);
  pointer-events: none;
}

/* Менеджер на баннере «Стать дилером»: колонка 520 у правого края,
   фигура 366x458 - выше секции, низ обрезается, как в макете */
.pvf__man {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  overflow: hidden;
  pointer-events: none;
}

.pvf__man img {
  position: absolute;
  top: 0;
  left: 77px;
  width: 366px;
  height: 458px;
  max-width: none;
  object-fit: cover;
}

.pvf__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 760px;
  max-width: 100%;
}

.pvf__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pvf__title {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.1;
  color: #fff;
}

.pvf__text {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  color: rgba(255, 255, 255, .7);
}

/* ---------- форма ---------- */

.pvf__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pvf__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pvf__row {
  display: flex;
  gap: 10px;
}

.pvf__field {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
}

.pvf__input,
.pvf__select-trigger {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 12px 20px;
  border: 1px solid #fff;
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, .4);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  box-shadow: none;
  transition: background .3s, border-color .3s, box-shadow .3s;
}

.pvf__input::placeholder {
  color: rgba(255, 255, 255, .7);
  opacity: 1;
}

.pvf__input:focus {
  box-shadow: inset 0 0 0 1px #fff;
}

/* Незаполненное обязательное поле после попытки отправки */
.pvf__field.is-invalid .pvf__input,
.pvf__field.is-invalid .pvf__select-trigger {
  border-color: #FF5A5A;
  box-shadow: inset 0 0 0 1px #FF5A5A;
}

/* ---------- выпадающие списки: регион и цель обращения ---------- */

.pvf__select {
  position: relative;
  width: 100%;
  height: 100%;
}

.pvf__select-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.pvf__select-trigger:hover {
  background: rgba(255, 255, 255, .5);
}

/* После клика браузер рисует по кнопке рамку фокуса - в макете её нет.
   Для клавиатуры (:focus-visible) подсветку оставляем */
.pvf__select-trigger:focus {
  outline: none;
}

.pvf__select-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Поле поиска внутри триггера региона. Перебиваем :hover/:focus - иначе
   общие правила сайта для полей рисуют ему свою рамку и фон. */
.pvf__select-trigger .pvf__select-search,
.pvf__select-trigger .pvf__select-search:hover,
.pvf__select-trigger .pvf__select-search:focus,
.pvf__select-trigger .pvf__select-search:active {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: #fff;
  font: inherit;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* В макете подсказка «Выберите регион» белая, а не полупрозрачная */
.pvf__select-trigger .pvf__select-search::placeholder {
  color: #fff;
  opacity: 1;
}

.pvf__select-text {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, .7);
}

/* Иконки - SVG из макета маской, цвет задаётся фоном: так одна картинка
   служит и белой, и тёмно-синей (активная вкладка, открытый список) */
.pvf__icon {
  flex: 0 0 auto;
  display: inline-block;
  background-color: #fff;
  -webkit-mask: var(--pvf-icon) center / contain no-repeat;
  mask: var(--pvf-icon) center / contain no-repeat;
}

.pvf__icon--loc {
  width: 16px;
  height: 16px;
  --pvf-icon: url(/local/forms/img/loc.svg);
}

.pvf__icon--arrow {
  width: 17px;
  height: 12px;
  margin-left: auto;
  --pvf-icon: url(/local/forms/img/triangle.svg);
  transform: rotate(180deg);
  transition: transform .3s;
}

/* Список цели открыт или вариант выбран - поле белое, как в макете */
.pvf__select--goal.is-open .pvf__select-trigger,
.pvf__select--goal.is-filled .pvf__select-trigger {
  background: #fff;
}

.pvf__select--goal.is-open .pvf__select-text,
.pvf__select--goal.is-filled .pvf__select-text {
  color: #2B2B2B;
}

.pvf__select--goal.is-open .pvf__icon--arrow,
.pvf__select--goal.is-filled .pvf__icon--arrow {
  width: 18px;
  height: 13px;
  background-color: #064A69;
  --pvf-icon: url(/local/forms/img/arrow-down.svg);
  transform: none;
}

.pvf__select--goal.is-open .pvf__icon--arrow {
  transform: rotate(180deg);
}

.pvf__select--region.is-open .pvf__select-trigger {
  box-shadow: inset 0 0 0 1px #fff;
}

.pvf__menu {
  position: absolute;
  top: calc(100% + 3px);
  left: -1px;
  z-index: 20;
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 13px rgba(30, 55, 91, .14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .2s, visibility .2s, transform .2s;
}

.pvf__select.is-open .pvf__menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.pvf__menu-list {
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #064A69 #F5F7FB;
}

/* Варианты разделены линией, как в макете: 5px - линия - 5px */
.pvf__option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #2B2B2B;
  font-family: Manrope, sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.pvf__option + .pvf__option {
  position: relative;
  margin-top: 11px;
}

.pvf__option + .pvf__option::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(43, 43, 43, .2);
}

.pvf__option:hover,
.pvf__option:focus-visible,
.pvf__option.is-selected {
  outline: none;
  background: #F5F7FB;
  color: #064A69;
}

.pvf__option--empty {
  opacity: .6;
  cursor: default;
}

/* ---------- согласие и кнопка ---------- */

.pvf__row--submit {
  align-items: center;
}

.pvf__agree {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.pvf__agree input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.pvf__agree-box {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid #F5F7FB;
  border-radius: 2px;
  transition: background .2s, border-color .2s;
}

.pvf__agree-box svg {
  opacity: 0;
  transition: opacity .15s;
}

.pvf__agree input:checked + .pvf__agree-box {
  background: #77B94C;
  border-color: #77B94C;
}

.pvf__agree input:checked + .pvf__agree-box svg {
  opacity: 1;
}

.pvf__agree input:focus-visible + .pvf__agree-box {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.pvf__agree.is-invalid .pvf__agree-box {
  border-color: #FF5A5A;
}

.pvf__agree-text {
  color: #F5F7FB;
  font-size: 15px;
  font-weight: 400;
  line-height: normal;
}

.pvf__agree-text a {
  color: #F5F7FB;
  text-decoration: underline;
}

.pvf__agree-text a:hover {
  color: #fff;
}

.pvf__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin: 0;
  padding: 0 40px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .3s;
}

.pvf__btn:hover,
.pvf__btn:focus {
  color: #fff;
  text-decoration: none;
}

.pvf__btn--green {
  background: #77B94C;
}

.pvf__btn--green:hover {
  background: #64A03F;
}

.pvf__btn--blue {
  background: #179BD7;
}

.pvf__btn--blue:hover {
  background: #064A69;
}

.pvf__submit {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 20px;
}

/* ---------- строка «Для розничной покупки» ---------- */

.pvf__retail {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 67px;
  margin-top: 10px;   /* + 20 от формы = 30, как в макете */
  padding: 14px 14px 14px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .2);
}

.pvf__retail-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: url(/local/forms/img/cart.svg) left 1.67px / 39.4px 38.3px no-repeat;
}

.pvf__retail-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
}

.pvf__retail-title {
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
}

.pvf__retail-subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(255, 255, 255, .7);
}

/* Розничный сценарий: строки с согласием и кнопкой нет, заявка не уходит.
   Во вкладке подвала строка розницы появляется только в этом сценарии. */
.pvf__form.is-retail .pvf__row--submit,
.pvf__retail--only-retail {
  display: none;
}

.pvf__form.is-retail .pvf__retail--only-retail {
  display: flex;
  margin-top: 0;
}

/* honeypot - скрыт от людей, но остаётся в разметке для ботов */
.pvf__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- «Чем мы можем вам помочь?» ---------- */

/* z-index - чтобы открытый список регионов лёг поверх подвала, а не под него */
.pvf-help {
  position: relative;
  z-index: 2;
  padding: 40px 0;
  background: linear-gradient(111deg, #064A69 1.25%, #2A779A 99.65%);
  color: #fff;
  font-family: Inter, sans-serif;
}

.pvf-help__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Фото вкладки: правые 830 из 1920. Неактивные - display:none, тогда
   браузер и не скачивает их, пока вкладку не открыли */
.pvf-help__photo {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 43.23%;
  display: none;
  background-size: cover;
  background-position: center;
}

.pvf-help[data-tab="opt"] .pvf-help__photo--opt,
.pvf-help[data-tab="dealer"] .pvf-help__photo--dealer,
.pvf-help[data-tab="consult"] .pvf-help__photo--consult,
.pvf-help[data-tab="home"] .pvf-help__photo--home {
  display: block;
}

.pvf-help__photo--opt {
  background-image: linear-gradient(90deg, #084D6C .36%, rgba(8, 77, 108, 0) 57.65%), url(/local/forms/img/tab-opt-bg.webp);
}

.pvf-help__photo--dealer {
  background-image: linear-gradient(90deg, #084D6C .36%, rgba(8, 77, 108, 0) 57.65%), url(/local/forms/img/tab-dealer-bg.webp);
}

.pvf-help__photo--consult {
  background-image: linear-gradient(90deg, #084D6C .36%, rgba(8, 77, 108, 0) 57.65%), url(/local/forms/img/tab-consult-bg.webp);
}

.pvf-help__photo--home {
  background-image: linear-gradient(90deg, #084D6C 0%, rgba(8, 77, 108, 0) 30.9%), url(/local/forms/img/tab-home-bg.webp);
}

.pvf-help__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(89.4deg, #064A69 55.95%, rgba(6, 74, 105, 0) 99.89%);
  pointer-events: none;
}

.pvf-help .container {
  position: relative;
  z-index: 1;
}

.pvf-help__content {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 820px;
  max-width: 100%;
}

.pvf-help__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* В подвале ряды полей идут через 14, а не через 10 */
.pvf-help .pvf__fields {
  gap: 14px;
}

.pvf-help__tabs {
  display: flex;
  gap: 10px;
}

.pvf-help__tab {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  height: 56px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 18px;
  text-align: left;
  cursor: pointer;
  transition: background .3s, color .3s;
}

.pvf-help__tab:hover {
  background: rgba(255, 255, 255, .3);
}

.pvf-help__tab:focus {
  outline: none;
}

.pvf-help__tab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.pvf-help__tab.is-active {
  border-width: 2px;
  background: rgba(255, 255, 255, .7);
  color: #064A69;
  cursor: default;
}

.pvf-help__tab.is-active .pvf__icon {
  background-color: #064A69;
}

.pvf-help__tab-text {
  min-width: 0;
}

.pvf-help__tab .pvf__icon {
  width: 20px;
  height: 20px;
}

.pvf__icon--opt {
  --pvf-icon: url(/local/forms/img/ic-opt.svg);
}

.pvf__icon--dealer {
  --pvf-icon: url(/local/forms/img/ic-dealer.svg);
}

.pvf__icon--consult {
  --pvf-icon: url(/local/forms/img/ic-consult.svg);
}

.pvf__icon--home {
  --pvf-icon: url(/local/forms/img/ic-home.svg);
}

/* Вкладки «Консультация» и «Частный объект»: плашка высотой как форма */
.pvf-help__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  min-height: 169px;
  padding: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .2);
}

.pvf-help__person {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pvf-help__avatar {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.pvf-help__card-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pvf-help__card-title {
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
}

.pvf-help__card-text {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  color: rgba(255, 255, 255, .7);
}

.pvf-help__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pvf-help__pane[hidden] {
  display: none;
}

/* ---------- адаптив ---------- */

@media screen and (max-width: 1280px) {
  .pvf__man {
    width: 420px;
  }

  .pvf__man img {
    left: auto;
    right: 20px;
  }
}

/* Колонка с формой растягивается во всю ширину - фото и менеджер уходят
   под затемнение, иначе светлая часть фото оказывается под текстом
   (так же сделано в прежней форме kp2__form) */
@media screen and (max-width: 1024px) {
  .pvf__man {
    display: none;
  }

  .pvf__photo {
    left: 0;
  }

  .pvf__shade,
  .pvf-help__shade {
    background: linear-gradient(180deg, rgba(6, 74, 105, .92) 0%, rgba(6, 74, 105, .78) 100%);
  }

  .pvf-help__photo {
    width: 100%;
  }

  .pvf__content,
  .pvf-help__content {
    width: 100%;
  }
}

@media screen and (max-width: 768px) {
  .pvf {
    padding: 25px;
    border-radius: 16px;
  }

  .pvf-help {
    padding: 30px 0;
  }

  .pvf__title {
    font-size: 24px;
  }

  .pvf__row {
    flex-direction: column;
  }

  .pvf__field {
    flex: 0 0 48px;
  }

  .pvf__row--submit {
    align-items: stretch;
    gap: 14px;
  }

  .pvf__agree,
  .pvf__submit {
    flex: 0 0 auto;
  }

  /* Вкладки - сеткой 2 на 2 */
  .pvf-help__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .pvf-help__tab {
    min-height: 56px;
    height: auto;
  }

  .pvf__retail {
    flex-wrap: wrap;
    padding: 14px;
  }

  .pvf__retail .pvf__btn {
    width: 100%;
  }

  .pvf-help__card {
    min-height: 0;
  }
}

@media screen and (max-width: 480px) {
  .pvf {
    padding: 20px;
  }

  .pvf__title {
    font-size: 20px;
  }

  .pvf__text,
  .pvf__agree-text,
  .pvf-help__tab {
    font-size: 14px;
  }

  .pvf__retail-title,
  .pvf-help__card-title {
    font-size: 16px;
  }

  .pvf__retail-subtitle,
  .pvf-help__card-text {
    font-size: 14px;
  }

  .pvf__btn {
    width: 100%;
    padding: 0 20px;
    font-size: 14px;
  }

  .pvf-help__tab {
    padding: 8px 10px;
  }
}
