/* Состояние загрузки попапа */
.legal_entity_request_frame.le-form-popup-frame--loading {
  min-height: 220px;
  min-width: 280px;
}

.legal_entity_request_frame .le-form-popup-loading {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
  padding: 48px 24px 32px;
  text-align: center;
}

.legal_entity_request_frame .le-form-popup-loading__spinner {
  animation: le-form-popup-spin 0.75s linear infinite;
  border: 3px solid #e8e8e8;
  border-radius: 50%;
  border-top-color: #5daa61;
  display: block;
  height: 40px;
  margin: 0 auto 16px;
  width: 40px;
}

.legal_entity_request_frame .le-form-popup-loading__text {
  color: #555;
  font-size: 15px;
  line-height: 1.4;
  margin: 0;
}

.legal_entity_request_frame .le-form-popup-loading--error .le-form-popup-loading__text {
  color: #333;
}

.legal-entities-page .le-btn.loadings {
  background-image: url(/bitrix/templates/aspro_next/images/loaders/preloader.gif);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 24px;
  color: transparent !important;
  pointer-events: none;
}

@keyframes le-form-popup-spin {
  to {
    transform: rotate(360deg);
  }
}

.form.LEGAL_ENTITY_REQUEST .le-form-popup__header {
  display: block;
  height: 203px;
  line-height: 0;
  margin: 0 0 16px;
  overflow: hidden;
  width: 100%;
}

.form.LEGAL_ENTITY_REQUEST .le-form-popup__header img {
  display: block;
  height: 203px;
  object-fit: cover;
  object-position: center top;
  width: 100%;
}

.form.LEGAL_ENTITY_REQUEST .form_head {
  margin-bottom: 18px;
}

.form.LEGAL_ENTITY_REQUEST .form_head h2 {
  font-size: 42px;
  line-height: 1.1;
}

.form.LEGAL_ENTITY_REQUEST .form_desc {
  font-size: 14px;
  line-height: 1.45;
}

.form.LEGAL_ENTITY_REQUEST .form-control {
  margin-bottom: 10px;
}

.form.LEGAL_ENTITY_REQUEST textarea {
  min-height: 150px;
  resize: vertical;
}

.form.LEGAL_ENTITY_REQUEST .btn.btn-default {
  background: #5daa61;
  border: 0;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.form.LEGAL_ENTITY_REQUEST .licence_block label {
  font-size: 13px;
  line-height: 1.35;
}

.form.LEGAL_ENTITY_REQUEST .le-form-popup__footer {
  margin-top: 45px !important;
}

/* Контейнер jqModal — центрирование через CSS, без inline top/margin-left от Aspro */
.legal_entity_request_frame.jqmWindow.popup {
  box-sizing: border-box;
  left: 50% !important;
  margin-left: 0 !important;
  max-height: calc(100dvh - 24px);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px));
}

@media (min-width: 992px) {
  .legal_entity_request_frame.jqmWindow.popup {
    top: 50% !important;
    transform: translate(-50%, -50%);
  }
}

.legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST {
  box-sizing: border-box;
}

@media (max-width: 991px) {
  .legal_entity_request_frame.jqmWindow.popup {
    max-height: calc(100dvh - 24px);
    top: 12px !important;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 24px));
  }

  .legal_entity_request_frame.popup .close {
    right: 8px;
    top: 8px;
    z-index: 5;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST {
    display: flex;
    flex-direction: column;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .le-form-popup__header {
    flex-shrink: 0;
    height: 128px;
    margin: 0 0 12px;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .le-form-popup__header img {
    height: 128px;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form_head {
    flex-shrink: 0;
    margin-bottom: 12px;
    padding: 12px 40px 8px 16px !important;
    border-bottom: 0 !important;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form_head h2 {
    font-size: 24px;
    line-height: 1.15;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form_desc {
    font-size: 13px;
    margin-top: 8px;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form_body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 16px 4px !important;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form_footer {
    flex-shrink: 0;
    margin-top: 12px !important;
    padding: 0 16px 16px !important;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST textarea {
    min-height: 110px;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .btn.btn-default {
    display: block;
    font-size: 14px;
    min-height: 44px;
    width: 100%;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .licence_block {
    margin-bottom: 12px;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .captcha-row .captcha_image,
  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .captcha-row .captcha_input {
    float: none;
    width: 100%;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .captcha-row .captcha_input {
    margin-top: 8px;
    padding-left: 0;
  }
}

@media (max-width: 575px) {
  .legal_entity_request_frame.jqmWindow.popup {
    max-height: calc(100dvh - 16px);
    top: 8px !important;
    width: min(520px, calc(100vw - 16px));
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .le-form-popup__header {
    height: 96px;
    margin-bottom: 10px;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .le-form-popup__header img {
    height: 96px;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form_head {
    padding: 10px 36px 6px 12px !important;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form_head h2 {
    font-size: 20px;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form_body {
    padding: 6px 12px 2px !important;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form_footer {
    padding: 0 12px 12px !important;
  }

  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form-control input,
  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form-control textarea,
  .legal_entity_request_frame.popup .form.LEGAL_ENTITY_REQUEST .form-control select {
    font-size: 16px;
  }
}
