/* =========================
   Конструктор страницы (page-templates/builder.php) — блоки
========================= */

/* ---- Hero + форма заявки ----
   На основе .homepage__hero-block с главной, классы под hero-form-block__*.
   Фото/форма/рейтинги — position:absolute относительно .container. */

/* Отступ сверху для страниц без хлебных крошек над блоком (например, главная) */
.page-builder__block--hero_form_block {
    margin-top: 50px;
}

@media screen and (max-width: 640px) {
    .page-builder__block--hero_form_block {
        margin-top: 0;
    }
}

.hero-form-block {
    overflow-x: clip;
}

.hero-form-block .container {
    max-width: 1220px;
    padding-left: 15px;
    padding-right: 15px;
}

.hero-form-block__box {
    position: relative;
    margin: 0 20px;
    padding: 80px 0 0;
    background-color: #E7DFE0;
    border-radius: 30px;
}

.hero-form-block__box .container {
    position: relative;
}

.hero-form-block__wrapper {
    position: relative;
    z-index: 2;
    padding: 0 0 145px;
}

.hero-form-block__title {
    margin: 0 0 45px;
    max-width: 460px;
}

.hero-form-block__title h1 {
    margin: 0;
    color: #1E2023;
    font-size: 48px;
    font-weight: 800;
    line-height: 48px;
}

.hero-form-block__title h1 span {
    display: block;
    color: #FB5446;
}

.hero-form-block__desc {
    max-width: 460px;
    margin: 0 0 16px;
    font-size: 20px;
    line-height: 1.4;
    color: #212121;
}

.hero-form-block__benefits {
    max-width: 460px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero-form-block__benefits li {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
    font-size: 20px;
    line-height: 1.4;
    color: #212121;
}

.hero-form-block__benefits li img {
    flex: none;
    width: 28px;
    height: 28px;
}

/* Фото — 1:1 .homepage__hero-block__image (right/height + брейкпоинты) */

.hero-form-block__image {
    position: absolute;
    bottom: 0;
    right: 290px;
    height: 530px;
}

.hero-form-block__image img {
    height: 100%;
    width: auto;
}

/* Форма — по границе .container, фикс. ширина 365px */

.hero-form-block__form {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    width: 365px;
}

/* Рейтинги — по левому/правому краю формы, выше границы box */
.hero-form-block__ratings {
    position: absolute;
    top: -120px;
    right: 0;
    width: 365px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-form-block__rating {
    display: block;
    width: 215px;
    height: 74px;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-size: contain;
    transition: .4s;
}

.hero-form-block__rating--yandex {
    background-image: url(../images/ico-yandex-desk@2x.webp);
}

.hero-form-block__rating--google {
    background-image: url(../images/ico-google-desk@2x.webp);
}

.hero-form-block__rating:hover {
    cursor: pointer;
}

.hero-form-block__form-card {
    position: relative;
}

/* ---- tod-forms: карточка консультации ---- */

.hero-form-block__form-card .tod-form-wrapper {
    display: block;
    background: #fff;
    border-radius: 30px;
    padding: 32px 20px;
    box-shadow: 0 4px 12px 0 rgba(33, 11, 11, .15);
}

.hero-form-block__form-card .tod-form {
    margin: 0;
}

.hero-form-block__form-card .tod-form__head {
    margin-bottom: 24px;
}

.hero-form-block__form-card .tod-form__title {
    font-size: 19px;
    line-height: 1.2;
    font-weight: 700;
    color: #1E2023;
}

/* Принудительный перенос + красная 2-я строка — только на мобильном */
.hero-form-block__form-card .tod-form__title br {
    display: none;
}

.hero-form-block__form-card .tod-form__title span {
    color: inherit;
}

.hero-form-block__form-card .tod-form__row {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.hero-form-block__form-card .tod-form__group {
    position: relative;
    gap: 0;
}

.hero-form-block__form-card .tod-form__label {
    display: none;
}

.hero-form-block__form-card .tod-form__input {
    width: 100%;
    height: 54px;
    box-sizing: border-box;
    background: #F6F6F6;
    border: 1px solid #DDD;
    border-radius: 16px;
    padding: 12px 16px 12px 46px;
    font-size: 16px;
    color: #1E2023;
}

.hero-form-block__form-card .tod-form__input::placeholder {
    color: #999;
}

.hero-form-block__form-card .tod-form__input:hover {
    background: #F1F1F1;
}

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

.hero-form-block__form-card .tod-form__input--invalid {
    border-color: #F9423A;
    background: #FFF3F2;
}

/* absolute — чтобы текст ошибки не сдвигал карточку (не "прыгала" форма) */
.hero-form-block__form-card .tod-form__error {
    position: absolute;
    left: 15px;
    right: 0;
    top: 2px;
    margin: 0px;
    font-size: 12px;
    line-height: 1.3;
    color: #F9423A;
}

.hero-form-block__form-card .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;
}

.hero-form-block__form-card .tod-form__group--phone .tod-form__input {
    padding-left: 16px;
}

/* ---- Чекбоксы: кастомная галочка на CSS, без background-image ---- */

.hero-form-block__form-card .tod-form__checkbox-group {
    margin: 0 0 12px;
}

.hero-form-block__form-card .tod-form__checkbox-row {
    position: relative;
    margin-bottom: 12px;
}

.hero-form-block__form-card .tod-form__checkbox-row .tod-form__error {
    display: none;
}

.hero-form-block__form-card .tod-form__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 11px;
    line-height: 1.35;
    color: #666;
}

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

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

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

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

.hero-form-block__form-card .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);
}

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

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

.hero-form-block__form-card .tod-form__actions {
    margin-top: 0;
}

.hero-form-block__form-card .tod-form__submit {
    width: 100%;
    height: 48px;
    background: #FB5446;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #FFFEFE;
}

.hero-form-block__form-card .tod-form__submit:hover {
    background: #e6483a;
}

.hero-form-block__form-card .tod-form__status {
    margin-top: 12px;
}

/* ---- Адаптив 1170–830px ---- */

@media screen and (max-width: 1170px) {
    .hero-form-block__image {
        right: 13%;
        height: 500px;
    }
}

@media screen and (max-width: 960px) {
    .hero-form-block__wrapper {
        padding: 0 0 360px;
    }

    .hero-form-block__form {
        top: auto;
        bottom: 75px;
    }

    .hero-form-block__ratings {
        top: auto;
        bottom: 100%;
        margin-bottom: 24px;
    }

    .hero-form-block__image {
        left: 0;
        height: 420px;
    }
}

/* ---- Мобильная раскладка (≤640px) ---- */

@media screen and (max-width: 640px) {
    .hero-form-block__box {
        margin: 0 15px;
        padding: 64px 20px 32px;
        border-radius: 16px;
    }

    .hero-form-block__box .container {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }

    .hero-form-block__wrapper {
        padding: 0;
    }

    .hero-form-block__title {
        position: relative;
        max-width: 58%;
        margin: 0 0 16px;
    }

    .hero-form-block__title h1 {
        font-size: 28px;
        line-height: 1.15;
    }

    .hero-form-block__desc,
    .hero-form-block__benefits {
        max-width: none;
    }

    .hero-form-block__desc {
        max-width: 70%;
        font-size: 16px;
        margin-bottom: 16px;
    }

    .hero-form-block__desc br {
        display: none;
    }

    .hero-form-block__benefits {
        margin-bottom: 24px;
    }

    .hero-form-block__benefits li {
        font-size: 16px;
        gap: 8px;
    }

    .hero-form-block__benefits li img {
        width: 20px;
        height: 20px;
    }

    /* Окно обрезки — только вокруг фото, отдельно от .hero-form-block__form
       (там рейтинги, которым нужен overflow:visible для вылета за верх box).
       Даёт фото свой overflow:hidden контекст, не задевая рейтинги. */
    .hero-form-block__image-frame {
        position: absolute;
        top: 0;
        right: -20px;
        bottom: 0px;
        width: 100%;
        overflow: hidden;
        border-radius: 16px;
        pointer-events: none;
    }

    /* Крупнее видимой области и сдвинуто вправо — вылезающий край
       обрезается через overflow:hidden у .hero-form-block__image-frame. */
    .hero-form-block__image {
        top: 0;
        right: -10%;
        bottom: auto;
        left: auto;
        width: 65%;
        max-width: 230px;
        height: auto;
        border-radius: 16px;
    }

    .hero-form-block__image img {
        display: block;
        height: auto;
        width: 100%;
        border-radius: 16px;
    }

    .hero-form-block__image::before {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: linear-gradient(to top, #E7DFE0 0%, rgba(231, 223, 224, 0) 45%);
    }

    .hero-form-block__form {
        position: static;
        width: 100%;
    }

    /* width:auto — иначе унаследованный width:365px "перетягивает" right */
    .hero-form-block__ratings {
        position: absolute;
        top: -90px;
        left: 0;
        right: 0;
        width: auto;
        justify-content: space-between;
    }

    .hero-form-block__rating {
        width: 150px;
        height: 52px;
    }

    .hero-form-block__form-card .tod-form__title {
        font-size: 24px;
    }

    .hero-form-block__form-card .tod-form__title br {
        display: inline;
    }

    .hero-form-block__form-card .tod-form__title span {
        color: #F9423A;
    }
}

/* =========================
   Блок «Рекомендация от организации «СОЛОМОН»
   Стили карточки — глобальные (style.css); тут только отступы обёртки
   в контексте конструктора, .recommendation-block__wrapper на главной
   не трогаем.
========================= */

.page-builder__block--recommendation_block .recommendation-block__wrapper {
    padding: 64px 0 50px;
    margin: 0;
}

@media screen and (max-width: 640px) {
    .page-builder__block--recommendation_block .recommendation-block__wrapper .title {
        margin-bottom: 32px;
    }

    .page-builder__block--recommendation_block .recommendation-block__wrapper .title h2 {
        margin-bottom: 0;
    }
}

/* =========================
   CTA-блок «Получите бесплатную консультацию»
========================= */

.herzl-html-consult {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  background: linear-gradient(120deg, #2C47A8 0%, #1B2C61 55%, #111C42 100%);
}
.herzl-html-consult__wrap {
  position: relative;
}
.herzl-html-consult__photo {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 100%;
  width: auto;
  max-width: 360px;
  pointer-events: none;
}
.herzl-html-consult__photo picture {
  display: block;
  height: 100%;
}
.herzl-html-consult__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom right;
}
.herzl-html-consult__photo-mobile {
  display: none;
}
.herzl-html-consult__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 64px 380px 64px 0;
}
.herzl-html-consult__title {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.15;
  color: #FFFFFF;
  margin: 0 0 12px;
  overflow-wrap: break-word;
}
.herzl-html-consult__br {
  display: none;
}
.herzl-html-consult__subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  overflow-wrap: break-word;
}
.herzl-html-consult__mobile-btn {
  display: none;
}

/* ---- Форма (tod-forms, id: consult_cta) ----
   .tod-form: имя/телефон/кнопка в 1 строку, чекбоксы ниже — через grid;
   .tod-form__row → display:contents, чтобы поля стали ячейками сетки. */

.herzl-html-consult__form .tod-form-wrapper {
  display: block;
}

.herzl-html-consult__form .tod-form {
  position: relative;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  grid-template-areas:
    "name phone submit"
    "consents consents consents";
  column-gap: 16px;
  row-gap: 28px;
}

.herzl-html-consult__form .tod-form__row {
  display: contents;
}

.herzl-html-consult__form .tod-form__group {
  position: relative;
  min-width: 0;
}

.herzl-html-consult__form .tod-form__group--name {
  grid-area: name;
}

.herzl-html-consult__form .tod-form__group--phone {
  grid-area: phone;
}

.herzl-html-consult__form .tod-form__label {
  display: none;
}

.herzl-html-consult__form .tod-form__input {
  width: 100%;
  box-sizing: border-box;
  height: 56px;
  background: #FFFFFF;
  border: none;
  border-radius: 16px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 16px;
  color: #1C1D21;
}

.herzl-html-consult__form .tod-form__input::placeholder {
  color: #87949B;
}

.herzl-html-consult__form .tod-form__input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.6);
}

.herzl-html-consult__form .tod-form__input--invalid {
  outline: 2px solid #FF8A80;
}

.herzl-html-consult__form .tod-form__error {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  color: #FFB4A8;
}

.herzl-html-consult__form .tod-form__group--name .tod-form__input {
  padding-left: 48px;
}

.herzl-html-consult__form .tod-form__group--name::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2387949B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.5'%3E%3C/circle%3E%3Cpath d='M5.5 20a6.5 6.5 0 0 1 13 0'%3E%3C/path%3E%3C/svg%3E") no-repeat center / contain;
}

.herzl-html-consult__form .tod-form__actions {
  grid-area: submit;
  margin: 0;
  align-self: stretch;
}

.herzl-html-consult__form .tod-form__submit {
  width: 180px;
  height: 56px;
  background: #FB5446;
  color: #FFFFFF;
  border: 2px solid #FB5446;
  border-radius: 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.herzl-html-consult__form .tod-form__submit:hover {
  background: transparent;
  color: #FB5446;
}

.herzl-html-consult__form .tod-form__checkbox-group {
  grid-area: consents;
  display: flex;
  gap: 48px;
  border: none;
  padding: 0;
  margin: 0;
}

.herzl-html-consult__form .tod-form__checkbox-row {
  position: relative;
  flex: 1;
  min-width: 0;
  margin: 0;
}

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

.herzl-html-consult__form .tod-form__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.herzl-html-consult__form .tod-form__checkbox span {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
  overflow-wrap: break-word;
}

.herzl-html-consult__form .tod-form__checkbox a {
  color: #FB5446;
  text-decoration: underline;
}

.herzl-html-consult__form .tod-form__checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

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

.herzl-html-consult__form .tod-form__checkbox input[type="checkbox"].tod-form__input--invalid {
  outline: none;
  background: transparent;
  border-color: #FF8A80;
}

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

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

.herzl-html-consult__form .tod-form__status {
  grid-column: 1 / -1;
  margin-top: 4px;
}

@media (max-width: 1024px) {
  .herzl-html-consult__photo {
    max-width: 280px;
  }
  .herzl-html-consult__inner {
    padding-right: 300px;
  }
  .herzl-html-consult__form .tod-form__submit {
    width: 160px;
  }
  .herzl-html-consult__form .tod-form__checkbox-group {
    gap: 32px;
  }
}
@media (max-width: 768px) {
  .herzl-html-consult__photo {
    display: none;
  }
  .herzl-html-consult__inner {
    gap: 20px;
    padding: 24px 0 48px;
  }
  .herzl-html-consult__photo-mobile {
    display: block;
    width: 100%;
    height: auto;
  }
  .herzl-html-consult__photo-mobile picture,
  .herzl-html-consult__photo-mobile img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
  }
  .herzl-html-consult__title {
    font-size: 28px;
  }
  .herzl-html-consult__br {
    display: inline;
  }
  .herzl-html-consult__form {
    display: none;
  }
  .herzl-html-consult__mobile-btn {
    display: block;
    text-align: center;
    background: #FB5446;
    color: #FFFFFF;
    border: 2px solid #FB5446;
    border-radius: 16px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
  }
  .herzl-html-consult__mobile-btn:hover {
    background: transparent;
    color: #FB5446;
  }
}
