.bitrix-form-block {
  width: 100%;
  max-width: 1050px;
  margin-inline: auto;
}

.bitrix-form-block .w-embed,
.bitrix-form-block .b24-form,
.bitrix-form-block .b24-form-wrapper {
  width: 100%;
  max-width: 100%;
}

.b24-form,
.b24-form * {
  text-align: left !important;
}

.b24-form .b24-form-wrapper {
  text-align: left !important;
  border-radius: 20px !important;
  box-shadow: 0 18px 48px rgb(2 19 75 / 18%) !important;
}

/* The section already has its own heading, so the empty Bitrix header only
   adds a blank white strip above the fields. */
.b24-form .b24-form-header {
  display: none !important;
}

.b24-form .b24-form-content {
  padding: 32px 40px 28px !important;
}

/* Bitrix renders the ten customer fields inside the first form wrapper.
   A two-column grid keeps the form short and scannable on larger screens. */
.b24-form .b24-form-content form > :first-child {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.b24-form .b24-form-content form > :first-child > .b24-form-field {
  min-width: 0;
  margin-bottom: 0 !important;
}

.b24-form .b24-form-content form > :first-child > .b24-form-field-text {
  grid-column: 1 / -1;
}

.b24-form .b24-form-field-agreement {
  margin: 20px 0 10px !important;
}

.b24-form .b24-form-btn-container {
  margin-top: 8px !important;
}

.b24-form .b24-form-btn {
  width: min(100%, 360px) !important;
  min-height: 54px !important;
  margin-inline: auto !important;
}

.b24-form .b24-form-control-label,
.b24-form .b24-form-field-label,
.b24-form label {
  text-align: left !important;
  justify-content: flex-start !important;
}

.b24-form input,
.b24-form textarea,
.b24-form select {
  text-align: left !important;
}

.b24-form .b24-form-field,
.b24-form .b24-form-control {
  align-items: flex-start !important;
}

.b24-form .b24-form-btn-container {
  text-align: center !important;
}

.b24-form,
.b24-form-wrapper,
.b24-form .b24-form-wrapper,
.b24-form .b24-form-content {
  border-radius: 20px !important;
  overflow: hidden !important;
}

.b24-form button,
.b24-form .b24-form-btn,
.b24-form input[type="submit"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

@media (max-width: 767px) {
  .bitrix-form-block {
    max-width: 620px;
  }

  .b24-form .b24-form-content {
    padding: 22px 18px 20px !important;
  }

  .b24-form .b24-form-content form > :first-child {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .b24-form .b24-form-content form > :first-child > .b24-form-field-text {
    grid-column: auto;
  }

  .b24-form .b24-form-field-agreement {
    margin-top: 16px !important;
  }
}
