
/* TerraStroy — Global Estimate */

.tsEstimate {
  --estimateDark: #202020;
  --estimateMuted: #746e69;
  --estimateBorder: #ded7d1;

  padding: 50px 0;
  background: var(--colorWhite, #fff);
}

.tsEstimateInner {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 24px;
  background: #f5f3f0;
}

.tsEstimateBackground {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.tsEstimateBackgroundImage {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Осветление фотографии под текстом */

.tsEstimateInner::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    rgb(245 243 240 / 96%) 0%,
    rgb(245 243 240 / 88%) 23%,
    rgb(245 243 240 / 15%) 49%,
    transparent 75%
  );
  content: "";
  pointer-events: none;
}

/* Основная сетка */

.tsEstimateContent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  min-height: 520px;
  padding: 30px 32px;
}

/* Левая колонка */

.tsEstimateCopy {
  max-width: 540px;
}

.tsEstimateTitle {
  margin: 0;
  color: var(--estimateDark);
  font-family: var(--fontBody, "Mulish", sans-serif);
  font-size: clamp(36px, 3.4vw, 48px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.tsEstimateDescription {
  margin: 24px 0 0;
  color: var(--estimateDark);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 400;
  line-height: 1.35;
}

/* Белая панель формы */

.tsEstimateFormPanel {
  display: block;
  align-self: center;
  width: 100%;
  padding: 28px 30px;
  border-radius: 24px;
  background: #fff;
}

.tsEstimateFormPanel .wpcf7 {
  width: 100%;
  margin: 0;
}

.tsEstimateFormPanel .wpcf7 form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 0;
}

/*
 * CF7 может автоматически добавлять <p>.
 * Убираем их внешние отступы только
 * внутри нашей формы.
 */

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

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

/* Поля */

.tsEstimateField {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tsEstimateFieldLabel {
  display: block;
  margin: 0;
  color: var(--estimateDark);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.tsEstimateField .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
  margin: 0;
}

.tsEstimateField input[type="tel"],
.tsEstimateField textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  border: 1px solid var(--estimateBorder);
  border-radius: 12px;
  background: #fff;
  color: var(--estimateDark);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  outline: 0;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.tsEstimateField input[type="tel"] {
  height: 56px;
  padding: 14px 16px;
}

.tsEstimateField textarea {
  height: 96px;
  min-height: 96px;
  padding: 14px 16px;
  resize: vertical;
}

.tsEstimateField input::placeholder,
.tsEstimateField textarea::placeholder {
  color: #817b76;
  opacity: 1;
}

.tsEstimateField input:focus,
.tsEstimateField textarea:focus {
  border-color: var(--colorBrand, #995735);
  box-shadow: 0 0 0 3px rgb(153 87 53 / 10%);
}

.tsEstimateField .wpcf7-not-valid {
  border-color: #c04b48;
}

.tsEstimateFormPanel .wpcf7-not-valid-tip {
  margin-top: 6px;
  color: #b63f3a;
  font-size: 13px;
  line-height: 1.4;
}

/* Кнопка отправки */

.tsEstimateSubmit {
  position: relative;
  margin: 0;
}

.tsEstimateSubmitButton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  min-height: 56px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: #202020;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  transition:
    background-color 200ms ease,
    transform 200ms ease;
}

.tsEstimateSubmitButton svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.tsEstimateSubmitButton:not(:disabled):hover {
  background: var(--colorBrand, #995735);
}

.tsEstimateSubmitButton:disabled {
  opacity: 0.65;
  cursor: wait;
}

.tsEstimateSubmit .wpcf7-spinner {
  position: absolute;
  top: 50%;
  right: 10px;
  margin: 0;
  transform: translateY(-50%);
}

/* Согласие */

.tsEstimateConsent {
  margin: 0;
  color: #242424;
  font-size: 14px;
  line-height: 1.45;
}

.tsEstimateConsent .wpcf7-form-control-wrap {
  display: block;
}

.tsEstimateConsent .wpcf7-acceptance {
  display: block;
}

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

.tsEstimateConsent .wpcf7-list-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.tsEstimateConsent input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--colorBrand, #995735);
  cursor: pointer;
}

.tsEstimateConsent .wpcf7-list-item-label {
  display: block;
}

.tsEstimateConsent a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.tsEstimateConsent a:hover {
  color: var(--colorBrand, #995735);
  text-decoration: underline;
}

/* Системные сообщения Contact Form 7 */

.tsEstimateFormPanel .wpcf7-response-output {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.tsEstimateFormPanel .wpcf7 form .wpcf7-response-output {
  border-color: var(--estimateBorder);
}

/* Адаптивность — 1440px */

@media (max-width: 1440px) {
  .tsEstimateContent {
    gap: 24px;
    padding: 26px;
  }

  .tsEstimateFormPanel {
    padding: 26px;
  }
}

/* Адаптивность — 1200px */

@media (max-width: 1200px) {
  .tsEstimateContent {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 20px;
    min-height: 500px;
    padding: 24px;
  }

  .tsEstimateFormPanel {
    padding: 24px;
  }

  .tsEstimateTitle {
    font-size: clamp(32px, 3.5vw, 42px);
  }

  .tsEstimateDescription {
    font-size: 20px;
  }

  .tsEstimateFormPanel .wpcf7 form {
    gap: 20px;
  }

  .tsEstimateFields {
    gap: 18px;
  }

  .tsEstimateField {
    gap: 6px;
  }
}

/* Адаптивность — 700px */

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

  .tsEstimateInner {
    min-height: 0;
    border-radius: 20px;
  }

  .tsEstimateInner::before {
    background: linear-gradient(
      180deg,
      rgb(245 243 240 / 97%) 0%,
      rgb(245 243 240 / 90%) 20%,
      rgb(245 243 240 / 8%) 100%
    );
  }

  .tsEstimateBackgroundImage {
    object-position: center;
  }

  .tsEstimateContent {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    min-height: 0;
    padding: 25px 15px 15px;
  }

  .tsEstimateCopy {
    padding: 8px 5px 0;
  }

  .tsEstimateTitle {
    font-size: clamp(30px, 8vw, 38px);
    line-height: 1.2;
  }

  .tsEstimateDescription {
    margin-top: 15px;
    font-size: 18px;
    line-height: 1.4;
  }

  .tsEstimateFormPanel {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .tsEstimateFormPanel .wpcf7 form {
    gap: 20px;
  }

  .tsEstimateFields {
    gap: 18px;
  }

  .tsEstimateField {
    gap: 6px;
  }

  .tsEstimateFieldLabel {
    font-size: 15px;
  }

  .tsEstimateField input[type="tel"],
  .tsEstimateField textarea {
    font-size: 15px;
  }

  .tsEstimateField textarea {
    height: 90px;
    min-height: 90px;
  }

  .tsEstimateConsent {
    font-size: 12px;
  }

  .tsEstimateSubmitButton {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tsEstimateField input[type="tel"],
  .tsEstimateField textarea,
  .tsEstimateSubmitButton {
    transition: none;
  }
}
