
/* ================================================
   TerraStroy — форма расчёта на страницах услуг
   ================================================ */

.tsServiceLead {
  --leadDark: #222222;
  --leadMuted: #77716c;
  --leadBorder: #ded7d1;
  --leadBackground: #fcf3ea;
  --leadAccent: #995735;

  padding: 48px 0;
  background: var(--colorWhite, #ffffff);
}

/* ================================================
   ОБЩИЙ КОНТЕЙНЕР
   ================================================ */

.tsServiceLeadInner {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;

  min-height: 544px;
  overflow: hidden;
  isolation: isolate;

  border-radius: 24px;
  background: var(--leadBackground);
}

/* ================================================
   ФОТОГРАФИЯ

   Изображение занимает фон блока, а не отдельную
   колонку. Правая панель перекрывает его часть.
   ================================================ */

.tsServiceLeadIllustration {
  position: absolute;
  z-index: 0;

  top: 0;
  bottom: 0;
  left: 0;

  width: 73%;
  height: 100%;

  overflow: hidden;
  pointer-events: none;

  background: var(--leadBackground);
}

.tsServiceLeadImage {
  position: absolute;
  inset: 0;

  display: block;
  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: left center;
}

/* ================================================
   БЕЛАЯ ПАНЕЛЬ ФОРМЫ

   Панель накладывается поверх иллюстрации.
   ================================================ */

.tsServiceLeadPanel {
  position: relative;
  z-index: 2;

  grid-column: 2;
  grid-row: 1;

  display: flex;
  flex-direction: column;
  justify-content: center;

  min-width: 0;
  min-height: 480px;

  margin: 32px 28px 32px 0;
  padding: 32px;

  border-radius: 24px;
  background: #ffffff;
}

/* Заголовок */

.tsServiceLeadTitle {
  max-width: 560px;
  margin: 0;

  color: var(--leadDark);
  font-family: var(--fontBody, inherit);
  font-size: clamp(34px, 3.5vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* Необязательное описание */

.tsServiceLeadDescription {
  margin: 14px 0 0;

  color: var(--leadMuted);
  font-family: var(--fontBody, inherit);
  font-size: 16px;
  line-height: 1.5;
}

/* ================================================
   CF7 — ОБЩАЯ ОБЛАСТЬ
   ================================================ */

.tsServiceLead .tsEstimateFormPanel {
  width: 100%;
  margin: 28px 0 0;
  padding: 0;

  align-self: stretch;

  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.tsServiceLead .wpcf7 {
  width: 100%;
}

.tsServiceLead .wpcf7 form {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.tsServiceLead .wpcf7 form p {
  margin: 0;
}

/* ================================================
   СТРУКТУРА ПОЛЕЙ
   ================================================ */

.tsServiceLead .tsLeadFormFields {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.tsServiceLead .tsLeadFormField {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 9px;
}

.tsServiceLead .tsLeadFormField > label {
  display: block;
  margin: 0;

  color: var(--leadDark);
  font-family: var(--fontBody, inherit);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.tsServiceLead .tsLeadFormField > label span {
  color: var(--leadDark);
}

.tsServiceLead .tsLeadFormField .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

/* ================================================
   ТЕЛЕФОН
   ================================================ */

.tsServiceLead .tsLeadFormField input[type="tel"],
.tsServiceLead .tsLeadFormField input[type="text"],
.tsServiceLead .tsLeadFormField input[type="email"] {
  display: block;

  width: 100%;
  height: 56px;
  min-height: 56px;

  margin: 0;
  padding: 0 16px;

  appearance: none;
  -webkit-appearance: none;

  border: 1px solid var(--leadBorder);
  border-radius: 12px;
  outline: none;

  background: #ffffff;
  box-shadow: none;

  color: var(--leadDark);
  font-family: var(--fontBody, inherit);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;

  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.tsServiceLead .tsLeadFormField input::placeholder {
  color: #918a84;
  opacity: 1;
}

.tsServiceLead .tsLeadFormField input:hover {
  border-color: #c0b4ab;
}

.tsServiceLead .tsLeadFormField input:focus {
  border-color: var(--leadAccent);
  box-shadow: 0 0 0 3px rgba(153, 87, 53, 0.1);
}

/* Ошибки CF7 */

.tsServiceLead
.tsLeadFormField
input.wpcf7-not-valid {
  border-color: #c65a50;
}

.tsServiceLead .wpcf7-not-valid-tip {
  margin-top: 6px;
  color: #b7473f;
  font-size: 12px;
  line-height: 1.4;
}

/* ================================================
   КНОПКА ОТПРАВКИ
   ================================================ */

.tsServiceLead .tsLeadFormSubmit {
  position: relative;
  display: block;

  width: 100%;
  margin-top: 38px;
}

.tsServiceLead .tsLeadFormSubmit input[type="submit"],
.tsServiceLead .tsLeadFormSubmit .wpcf7-submit {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 56px;
  min-height: 56px;

  margin: 0;
  padding: 12px 56px;

  border: 1px solid var(--leadDark);
  border-radius: 999px;

  appearance: none;
  -webkit-appearance: none;

  background: var(--leadDark);
  box-shadow: none;

  color: #ffffff;
  font-family: var(--fontBody, inherit);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;

  cursor: pointer;

  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.tsServiceLead .tsLeadFormSubmit input[type="submit"]:hover {
  background: var(--leadAccent);
  border-color: var(--leadAccent);
  transform: translateY(-2px);
}

.tsServiceLead .tsLeadFormSubmit input[type="submit"]:active {
  transform: translateY(0);
}

.tsServiceLead .tsLeadFormSubmit input[type="submit"]:focus-visible {
  outline: 2px solid var(--leadAccent);
  outline-offset: 4px;
}

.tsServiceLead .tsLeadFormSubmit input[type="submit"]:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

/* Стрелка справа от текста кнопки */

.tsServiceLead .tsLeadFormSubmitArrow {
  position: absolute;
  z-index: 1;

  top: 50%;
  right: 27px;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 24px;
  height: 24px;

  color: #ffffff;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;

  pointer-events: none;
  transform: translateY(-50%);

  transition: transform 0.25s ease;
}

.tsServiceLead
.tsLeadFormSubmit:hover
.tsLeadFormSubmitArrow {
  transform: translate(4px, -50%);
}

/* Индикатор отправки CF7 */

.tsServiceLead .tsLeadFormSubmit .wpcf7-spinner {
  position: absolute;
  top: 50%;
  left: 16px;

  margin: 0;
  transform: translateY(-50%);
}

/* ================================================
   СОГЛАСИЕ НА ОБРАБОТКУ ДАННЫХ
   ================================================ */

.tsServiceLead .tsLeadFormConsent {
  display: flex;
  align-items: flex-start;

  width: 100%;
  margin-top: 38px;

  color: var(--leadDark);
  font-family: var(--fontBody, inherit);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.tsServiceLead .tsLeadFormConsent p {
  margin: 0;
}

.tsServiceLead .tsLeadFormConsent .wpcf7-form-control-wrap,
.tsServiceLead .tsLeadFormConsent .wpcf7-acceptance {
  display: block;
  width: 100%;
}

.tsServiceLead .tsLeadFormConsent .wpcf7-list-item {
  display: block;
  margin: 0;
}

.tsServiceLead .tsLeadFormConsent .wpcf7-list-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  margin: 0;
  cursor: pointer;
}

.tsServiceLead
.tsLeadFormConsent
input[type="checkbox"] {
  flex: 0 0 18px;

  width: 18px;
  height: 18px;

  margin: 1px 0 0;

  appearance: none;
  -webkit-appearance: none;

  border: 1px solid #c9c0b9;
  border-radius: 4px;
  background: #ffffff;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.tsServiceLead
.tsLeadFormConsent
input[type="checkbox"]:checked {
  border-color: var(--leadAccent);
  background-color: var(--leadAccent);

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10 4 4 8-8' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px;
}

.tsServiceLead
.tsLeadFormConsent
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--leadAccent);
  outline-offset: 3px;
}

.tsServiceLead
.tsLeadFormConsent
.wpcf7-list-item-label {
  flex: 1;
  min-width: 0;
}

.tsServiceLead .tsLeadFormConsent a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tsServiceLead .tsLeadFormConsent a:hover {
  color: var(--leadAccent);
  text-decoration: underline;
}

/* ================================================
   СООБЩЕНИЯ CF7
   ================================================ */

.tsServiceLead .wpcf7-response-output {
  margin: 18px 0 0 !important;
  padding: 12px 14px !important;

  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.tsServiceLead .wpcf7 form.sent .wpcf7-response-output {
  border-color: #70a47b;
  background: #f0f8f0;
}

.tsServiceLead .wpcf7 form.invalid .wpcf7-response-output,
.tsServiceLead .wpcf7 form.failed .wpcf7-response-output {
  border-color: #cf776a;
  background: #fff7f5;
}

/* ================================================
   ДО 1440 PX
   ================================================ */

@media (max-width: 1440px) {
  .tsServiceLeadPanel {
    padding: 30px;
  }

  .tsServiceLeadTitle {
    font-size: clamp(34px, 3.3vw, 46px);
  }
}

/* ================================================
   ДО 1200 PX
   ================================================ */

@media (max-width: 1200px) {
  .tsServiceLeadInner {
    min-height: 480px;
  }

  .tsServiceLeadIllustration {
    width: 75%;
  }

  .tsServiceLeadPanel {
    min-height: 430px;
    margin: 24px 20px 24px 0;
    padding: 28px;
  }

  .tsServiceLeadTitle {
    font-size: clamp(30px, 3.8vw, 42px);
  }

  .tsServiceLead .tsLeadFormSubmit {
    margin-top: 28px;
  }

  .tsServiceLead .tsLeadFormConsent {
    margin-top: 28px;
  }
}

/* ================================================
   ДО 700 PX
   ================================================ */

@media (max-width: 700px) {
  .tsServiceLead {
    padding: 36px 0;
  }

  .tsServiceLeadInner {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    min-height: 0;

    border-radius: 18px;
  }

  .tsServiceLeadIllustration {
    position: relative;

    top: auto;
    left: auto;
    bottom: auto;

    flex: 0 0 auto;

    width: 100%;
    height: 270px;
    min-height: 270px;

    overflow: hidden;
  }

  .tsServiceLeadImage {
    object-fit: contain;
    object-position: center bottom;
  }

  .tsServiceLeadPanel {
    position: relative;
    z-index: 2;

    min-height: 0;
    width: auto;

    margin: -18px 12px 12px;
    padding: 28px 20px 30px;

    border-radius: 18px;
  }

  .tsServiceLeadTitle {
    font-size: clamp(30px, 8vw, 40px);
    line-height: 1.15;
  }

  .tsServiceLead .tsEstimateFormPanel {
    margin-top: 24px;
  }

  .tsServiceLead .tsLeadFormSubmit {
    margin-top: 26px;
  }

  .tsServiceLead .tsLeadFormConsent {
    margin-top: 26px;
    font-size: 13px;
  }

  .tsServiceLead .tsLeadFormSubmit input[type="submit"] {
    font-size: 15px;
  }
}

/* ================================================
   МАЛЕНЬКИЕ ЭКРАНЫ
   ================================================ */

@media (max-width: 400px) {
  .tsServiceLeadPanel {
    padding: 24px 16px 28px;
  }

  .tsServiceLeadTitle {
    font-size: 30px;
  }

  .tsServiceLeadIllustration {
    height: 230px;
    min-height: 230px;
  }

  .tsServiceLead .tsLeadFormSubmitArrow {
    right: 20px;
  }
}

/* ================================================
   УМЕНЬШЕНИЕ АНИМАЦИЙ
   ================================================ */

@media (prefers-reduced-motion: reduce) {
  .tsServiceLead *,
  .tsServiceLead *::before,
  .tsServiceLead *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Убираем стрелку с кнопки */
.tsServiceLead .tsLeadFormSubmitArrow {
  display: none !important;
}

/* Убираем изменение курсора при наведении */
.tsServiceLead .tsLeadFormSubmit input[type="submit"],
.tsServiceLead .tsLeadFormConsent label,
.tsServiceLead .tsLeadFormConsent input[type="checkbox"] {
  cursor: auto;
}
