/**
 * HubSpot form layout fixes — loaded after Webflow export CSS.
 * Overrides HubSpot-injected markup for responsive containment.
 */

/* Field layout */
.hs-form .input {
  margin-right: 0 !important;
}

.hs-form > fieldset {
  max-width: 100% !important;
}

.hs-form .hs-form-field {
  max-width: 100%;
  min-width: 0;
}

.hs-input {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.hs-input[type='radio'] {
  width: auto !important;
  margin-right: var(--size--8px);
  min-height: auto !important;
}

.hs-form-checkbox > label {
  font-weight: 400 !important;
}

.hs-error-msgs > label {
  margin-bottom: 0 !important;
}

.hs-input[type='checkbox'] {
  width: var(--size--20px) !important;
  height: var(--size--20px) !important;
  margin-right: var(--size--8px) !important;
  min-height: auto !important;
  border: 1px solid #20244833 !important;
  background: #eaeff67d !important;
}

.hs-input[type='checkbox']:focus {
  box-shadow: none;
}

.hs-input[type='checkbox']:checked {
  accent-color: var(--swatch--brand-dark);
  outline: none;
}

.hs-form-field:has(.hs-input[type='checkbox']) {
  background-color: var(--swatch--transparent) !important;
  border-color: var(--swatch--transparent) !important;
}

.hs-form-booleancheckbox-display > span {
  margin-left: 0 !important;
}

.hs-form img {
  margin-bottom: var(--adaptive-sizes--16px);
  max-width: 100%;
  height: auto;
}

.hs-error-msg {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

/* Form container inside popups and pages */
.g_form_wrap,
.g_form_hubspot,
[cd-hs-form] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.hs-form {
  width: 100%;
  max-width: 100%;
}

/* Phone input country selector — prevent overflow on narrow screens */
.hs-form .hs-fieldtype-intl-phone {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 100%;
}

.hs-form .hs-fieldtype-intl-phone .hs-input {
  flex: 1 1 8rem;
  min-width: 0;
}

/* Submit row — stack on mobile */
@media screen and (max-width: 479px) {
  .hs-form .hs-submit,
  .hs-form .hs-button {
    width: 100%;
  }

  .hs-form .actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Popup form containment */
@media screen and (max-width: 767px) {
  .popup_wrap {
    width: 100%;
    max-width: calc(100vw - 1rem);
    padding: 1.25rem 1rem 2rem;
    box-sizing: border-box;
  }

  .popup_content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .g_form_wrap {
    padding-left: 0;
    padding-right: 0;
  }
}
