/* Consultation popup (#popup:myform) — mobile-friendly layout */

#rec2515649801 .t-popup__container {
  border-radius: 30px;
  overflow: hidden;
}

#rec2515649801 .consultation-popup__subtitle {
  margin-top: 8px;
  color: #666;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 400;
}

#rec2515649801 .t702__title {
  font-weight: 600;
}

/* После отправки поля должны скрываться (перебиваем flex !important ниже) */
#rec2515649801 .t-form__inputsbox.t702__inputsbox_hidden,
#rec2515649801 .t-form__inputsbox_inrow.t702__inputsbox_hidden {
  display: none !important;
  max-height: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Экран «Спасибо» внутри белого попапа */
#rec2515649801 .t-form__successbox.js-form-successbox,
#rec2583610701 .t-form__successbox.js-form-successbox {
  display: block !important;
  position: relative !important;
  background: transparent !important;
  color: #1a1a1a !important;
  margin: 0 !important;
  padding: 12px 12px 8px !important;
  text-align: center;
  animation: formSuccessIn 0.35s ease-out;
}

#rec2515649801 .js-form-successbox__icon,
#rec2583610701 .js-form-successbox__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

#rec2515649801 .js-form-successbox__icon svg,
#rec2583610701 .js-form-successbox__icon svg {
  display: block;
  filter: drop-shadow(0 8px 16px rgba(195, 68, 0, 0.28));
  animation: formSuccessIcon 0.45s ease-out 0.05s both;
}

#rec2515649801 .js-form-successbox__title,
#rec2583610701 .js-form-successbox__title {
  font-family: Montserrat, Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  color: #1a1a1a;
  margin: 0 0 10px;
}

#rec2515649801 .js-form-successbox__text,
#rec2583610701 .js-form-successbox__text {
  font-family: Montserrat, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: #666;
  margin: 0 0 22px;
}

#rec2515649801 .js-form-successbox__close,
#rec2583610701 .js-form-successbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 1000px;
  background: var(--uc-color-color-chxXC0Ge, #C34400);
  color: #fff;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

#rec2515649801 .js-form-successbox__close:active,
#rec2583610701 .js-form-successbox__close:active {
  background: var(--uc-color-color-Roa4ttfA2, #E05A18);
}

#rec2515649801 .t702__wrapper.js-form-success-state,
#rec2583610701 .t702__wrapper.js-form-success-state,
#rec2515649801 .js-form-success-state .t702__wrapper,
#rec2583610701 .js-form-success-state .t702__wrapper,
#rec2515649801 .t702__wrapper:has(.js-form-success),
#rec2583610701 .t702__wrapper:has(.js-form-success) {
  background: #ffffff !important;
  min-height: 0;
  display: block;
}

@keyframes formSuccessIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes formSuccessIcon {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stack name + phone vertically on tablets and phones */
@media screen and (max-width: 640px) {
  #rec2515649801 .t-form__inputsbox_inrow:not(.t702__inputsbox_hidden) .t-form__screen-wrapper_active,
  #rec2515649801 .t-form__inputsbox_inrow:not(.t702__inputsbox_hidden) {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    column-gap: 0 !important;
  }

  #rec2515649801 .t-form__inputsbox_inrow .t-input-group {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    margin-bottom: 16px !important;
  }

  #rec2515649801 .t-input-block,
  #rec2515649801 .t-input {
    width: 100% !important;
    box-sizing: border-box;
  }

  #rec2515649801 .t-input {
    height: 48px !important;
    font-size: 16px !important;
    padding: 0 18px !important;
  }

  #rec2515649801 .t702__wrapper {
    padding: 28px 20px 32px !important;
  }

  #rec2515649801 .t702__title {
    font-size: 22px !important;
    line-height: 1.25 !important;
    margin-bottom: 4px !important;
  }

  #rec2515649801 .consultation-popup__subtitle {
    font-size: 13px;
  }

  #rec2515649801 .t-checkbox__control {
    align-items: flex-start !important;
  }

  #rec2515649801 .t-checkbox__control span {
    font-size: 12px !important;
    line-height: 1.45 !important;
    text-align: left;
    color: #5b5b5b;
  }

  #rec2515649801 .t-checkbox__control a {
    color: #C34400 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
  }

  #rec2515649801 .t-checkbox__indicator {
    flex-shrink: 0;
    margin-top: 2px;
  }

  #rec2515649801 .t-form__submit,
  #rec2515649801 .t-submit.t-btnflex {
    width: 100% !important;
  }

  #rec2515649801 .t-btnflex.t-btnflex_type_submit {
    min-height: 50px !important;
    font-size: 16px !important;
  }
}

/* Bottom sheet instead of fullscreen black header on phones */
@media screen and (max-width: 560px) {
  #rec2515649801 .t-popup.t-popup_show {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  #rec2515649801 .t-popup_show .t-popup__container {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: auto !important;
    max-height: min(92dvh, 100%) !important;
    margin: 0 !important;
    padding: 0 0 env(safe-area-inset-bottom, 0) !important;
    transform: none !important;
    border-radius: 20px 20px 0 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    box-sizing: border-box !important;
  }

  /* После отправки — без горизонтального листания */
  #rec2515649801 .t-popup_show.js-form-success-popup,
  #rec2515649801 .t-popup_show:has(.js-form-success),
  #rec2515649801 .t-popup_show:has(.js-form-success-state) {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overscroll-behavior: none;
    overscroll-behavior-x: none;
    touch-action: manipulation;
  }

  #rec2515649801 .t-popup_show.js-form-success-popup .t-popup__container,
  #rec2515649801 .t-popup_show .t-popup__container:has(.js-form-success),
  #rec2515649801 .t-popup_show .t-popup__container:has(.js-form-success-state),
  #rec2515649801 .t-popup_show .t-popup__container.js-form-success-state {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    max-height: none !important;
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    overscroll-behavior: none;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: auto;
    touch-action: manipulation;
  }

  #rec2515649801 .t702__wrapper {
    padding-top: 36px !important;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0)) !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  #rec2515649801 .t702__wrapper.js-form-success-state,
  #rec2515649801 .t702__wrapper:has(.js-form-success) {
    padding-top: 28px !important;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0)) !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
  }

  #rec2515649801 .t702__wrapper::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: -20px auto 20px;
    border-radius: 2px;
    background: #ddd;
  }

  #rec2515649801 .t702__wrapper.js-form-success-state::before,
  #rec2515649801 .t702__wrapper:has(.js-form-success)::before {
    display: none !important;
  }

  #rec2515649801 .t-form__successbox.js-form-successbox {
    padding: 8px 4px 4px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  /* drop-shadow SVG даёт горизонтальный overflow */
  #rec2515649801 .js-form-successbox__icon {
    overflow: hidden;
    max-width: 100%;
  }

  #rec2515649801 .js-form-successbox__icon svg {
    filter: none !important;
  }

  #rec2515649801 .t-popup_show.js-form-success-popup form,
  #rec2515649801 form.js-form-success {
    overflow: hidden !important;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Крестик — правый верхний угол белого bottom sheet */
  #rec2515649801 .t-popup__close.t-popup__block-close {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    order: 1;
    align-self: flex-end;
    flex-shrink: 0;
    width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    margin: 0 2px -48px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    z-index: 10 !important;
    pointer-events: none;
    transform: none !important;
  }

  #rec2515649801 .t-popup_show .t-popup__container {
    order: 2;
  }

  #rec2515649801 .t-popup__block-close-button {
    pointer-events: auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #rec2515649801 .t-popup__close-icon {
    width: 18px !important;
    height: 18px !important;
  }

  #rec2515649801 .t-popup__close-icon g {
    fill: #373737 !important;
  }

  #rec2515649801 .t702__text-wrapper {
    padding-right: 36px;
    padding-left: 36px;
  }
}

/* Desktop: dark close icon on overlay */
@media screen and (min-width: 561px) {
  #rec2515649801 .t-popup__close-icon g {
    fill: #ffffff !important;
  }
}
