/* RMetS Forms - Responsive CSS */

/* Main form container */
.marketingForm {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box;
  overflow: hidden;
}

/* Container divs for Microsoft Dynamics forms */
div[data-form-id] {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box;
  overflow: hidden;
}

/* Form element itself */
form.marketingForm {
  width: 100%;
  margin: 0;
  padding: 0 15px 15px 0 !important; /* Remove left padding */
  box-sizing: border-box;
}

/* Title styling */
.marketingForm title {
  display: block;
  font-size: 1.2em;
  margin-bottom: 10px;
  word-wrap: break-word;
}

/* Meta tags and hidden elements */
.marketingForm meta {
  display: none;
}

/* Ensure all child elements respect container width */
.marketingForm * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Override fixed widths from Microsoft Dynamics forms */
.marketingForm [data-layout="true"],
.marketingForm table.outer,
.marketingForm .containerWrapper,
.marketingForm .columnContainer,
.marketingForm .inner {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important
}

/* Override inline styles for tables */
.marketingForm table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
}

/* Override specific column widths */
.marketingForm th[data-container-width],
.marketingForm td[data-container-width] {
  width: auto !important;
  max-width: 100% !important;
}

/* Make form layout container responsive */
.marketingForm div[data-layout="true"] {
  max-width: 100% !important;
  margin: 0 !important;
}

/* If there are input fields within the form */
.marketingForm input,
.marketingForm select,
.marketingForm textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
}

/* For any embedded styles or scripts */
.marketingForm style,
.marketingForm script {
  display: none;
}

/* When forms are in page content areas (field) */
.field .marketingForm,
.field--type-text-long .marketingForm,
.field--name-field-section-body .marketingForm {
  width: 100% !important;
  max-width: 100% !important;
}

/* Override the form's inline max-width style */
.field .marketingForm div[style*="max-width: 600px"],
.field--type-text-long .marketingForm div[style*="max-width: 600px"],
.field--name-field-section-body .marketingForm div[style*="max-width: 600px"] {
  max-width: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  form.marketingForm {
    padding: 10px 10px 10px 0 !important; /* Remove left padding on mobile too */
  }

  .marketingForm title {
    font-size: 1em;
  }
}

/* Ensure the form doesn't break out of sidebar */
.sidebar-right .marketingForm,
aside .marketingForm {
  width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* Handle any potential iframe content */
.marketingForm iframe {
  width: 100% !important;
  max-width: 100% !important;
  height: auto;
}

/* Target textFormFieldBlock elements to remove left padding */
.textFormFieldBlock,
.phoneFormFieldBlock,
.dateTimeFormFieldBlock,
.twoOptionFormFieldBlock,
.optionSetFormFieldBlock,
.multiOptionSetFormFieldBlock,
.lookupFormFieldBlock {
  margin-left: 0 !important;
  padding: 0px !important;
  max-width: 100% !important;
  gap: 4px !important;
}

/* Ensure form field inputs are full width */
.textFormFieldBlock input,
.textFormFieldBlock select,
.textFormFieldBlock textarea,
.phoneFormFieldBlock input,
.dateTimeFormFieldBlock input,
.lookupFormFieldBlock input,
.optionSetFormFieldBlock select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Remove left margin from div elements with data-editorblocktype="Text" */
div[data-editorblocktype="Text"] {
  margin: 10px !important;
  padding: 0 !important;
}

/* Also target any nested elements within the marketing form */
.marketingForm div[data-editorblocktype="Text"] {
  margin: 0px !important;
  padding: 0 !important;
}

/* Submit button wrapper responsive */
.marketingForm .submitButtonWrapper {
  width: 100% !important;
  text-align: center !important;
  padding: 0 30px !important;
}

/* Submit button responsive */
.marketingForm .submitButton {
  width: auto !important;
  max-width: 100% !important;
  display: inline-block !important;
}

/* Consent block responsive */
.marketingForm .consentBlock {
  padding: 4px 30px !important;
}

/* Override inline table cell styles */
.marketingForm th[style*="width"],
.marketingForm td[style*="width"] {
  width: 100% !important;
}



  .marketingForm .submitButtonWrapper {
    padding: 0 15px !important;
  }

  .marketingForm .consentBlock {
    padding: 4px 15px !important;
  }

  .marketingForm div[data-editorblocktype="Text"] {
    margin: 10px 0px !important;
  }

.marketingForm .notification-container {
  margin: 0 !important;
}
