:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) {
  min-width: 0;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)):not([data-form-mounted]) {
  min-height: 0;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-wrapper {
  min-width: 0;
  max-width: 100%;
  background: transparent;
  box-shadow: none;
  border: 0;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-content {
  padding: 0;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-header {
  display: none;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-control,
:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-control-label,
:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-field-agreement,
:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-btn {
  font-family: PTSans,Arial,sans-serif!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-control {
  font-size: 16px!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-field-agreement {
  font-size: 12px;
  line-height: 1.45;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-btn {
  border-radius: 30px;
  background: #e20155;
  font-size: 18px;
  font-weight: 700;
  min-height: 48px;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-field {
  margin-bottom: 12px;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-control-container {
  margin-bottom: 8px;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-sign {
  margin-top: 10px;
}

/* The existing Bitrix24 form retains its fields and processing. */

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-wrapper {
  width: 100%!important;
  max-width: none!important;
  min-height: 0!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-content form:has(> .b24-form-field),
:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-content form > div:has(> .b24-form-field) {
  display: grid!important;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-field {
  min-width: 0!important;
  margin: 0!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-control-container {
  min-width: 0!important;
  margin: 0!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-field-agreement,
:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-btn-container {
  grid-column: 1/-1;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-control {
  background: #fff!important;
  border: 1px solid #d5d5d5!important;
  border-radius: 6px!important;
  box-shadow: none!important;
  color: #272727!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) input.b24-form-control {
  height: 52px!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-control-label {
  color: #5b5b5b!important;
  opacity: 1!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) textarea.b24-form-control {
  height: 80px!important;
  min-height: 80px!important;
  max-height: none!important;
  resize: vertical!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-field-agreement {
  font: 12px/1.45 PTSans,Arial,sans-serif!important;
  color: #555!important;
  opacity: 1!important;
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-btn {
  min-height: 48px!important;
  box-shadow: none!important;
}

@media(max-width:767px) {
  :is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-content form:has(> .b24-form-field),
  :is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-content form > div:has(> .b24-form-field) {
    grid-template-columns: minmax(0,1fr);
    gap: 10px;
  }
}

:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-field-agreement .b24-form-control-desc,
:is([data-pc-form-mount], .b24-window-panel:has(.b24-form-wrapper)) .b24-form-field-agreement .b24-form-field-agreement-link {
  color: #555!important;
}

/* Keep the native Bitrix24 overlay and close controls. */

body:has(.pc-hero[data-booking-layout="popup"]) .b24-window-panel:has(.b24-form-wrapper) {
  width: min(720px,100%)!important;
  max-width: 100%!important;
}

body:has(.pc-hero[data-booking-layout="popup"]) .b24-window-panel .b24-window-scrollable:has(.b24-form-wrapper) {
  padding: 56px 28px 28px;
  box-sizing: border-box;
  max-height: 100dvh;
  overflow-y: auto;
}

body:has(.pc-hero[data-booking-layout="popup"]) .b24-window-panel .b24-form-btn {
  background: #e20155!important;
  color: #fff!important;
  border-radius: 30px!important;
}

@media(max-width:767px) {
  body:has(.pc-hero[data-booking-layout="popup"]) .b24-window-panel .b24-window-scrollable:has(.b24-form-wrapper) {
    padding: 52px 16px 20px;
  }
}
