/*
 * MyFIL form baseline compatibility stylesheet
 * Validation pack v2.5.3. Consolidates common form rules observed in the four original
 * CSS captures plus the public form descriptors and live page CSS for ten APAC
 * forms: 7814, 12886, 13016, 6983, 17504, 11729, 11727, 1780, 1781 and 1620.
 *
 * Scope: all rules require the renderer-owned .fil-braze-form root class.
 * Optional legacy .mkto* elements are styled only when they are descendants of
 * that root. A genuine Marketo form without .fil-braze-form is not targeted.
 * :is() retains root-class specificity so generic host-page form rules do not
 * override the baseline as easily as the previous zero-specificity :where().
 * Host pages remain responsible for loading approved brand fonts.
 */

:is(.fil-braze-form, .fil-braze-form.mktoForm),
:is(.fil-braze-form, .fil-braze-form.mktoForm) * {
  box-sizing: border-box;
}

:is(.fil-braze-form, .fil-braze-form.mktoForm) {
  width: 100% !important;
  max-width: 758px;
  margin: 0;
  padding: 0 !important;
  color: #20242b;
  font-family: "Neuzeit Grotesk", "NeuzeitGro", Arial, Helvetica, sans-serif !important;
  font-size: 16px;
  font-weight: 400 !important;
  line-height: 1.4;
  text-align: left;
}

/* Match the language-specific fallbacks used by the live APAC host styles.
 * These selectors do not require the font to be bundled; the host page remains
 * responsible for loading it. Both form-level and inherited document language
 * declarations are supported. */
:is(.fil-braze-form, .fil-braze-form.mktoForm):lang(ja),
:lang(ja) :is(.fil-braze-form, .fil-braze-form.mktoForm) {
  font-family: "Noto Sans JP", "Neuzeit Grotesk", "NeuzeitGro", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif !important;
}

:is(.fil-braze-form, .fil-braze-form.mktoForm):lang(zh),
:is(.fil-braze-form, .fil-braze-form.mktoForm):lang(zh-Hant),
:lang(zh) :is(.fil-braze-form, .fil-braze-form.mktoForm),
:lang(zh-Hant) :is(.fil-braze-form, .fil-braze-form.mktoForm) {
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Heiti TC", "Neuzeit Grotesk", "NeuzeitGro", sans-serif !important;
}

/* Structural rows emitted by the new renderer and their Marketo equivalents. */
:is(.fil-braze-form .fil-form-row, .fil-braze-form.mktoForm .mktoFormRow) {
  clear: both;
  width: 100%;
  margin: 0 0 15px;
}

:is(.fil-braze-form .fil-form-col, .fil-braze-form.mktoForm .mktoFormCol),
:is(.fil-braze-form .fil-field-descriptor, .fil-braze-form.mktoForm .mktoFieldDescriptor) {
  width: 100% !important;
  margin-bottom: 0 !important;
}

:is(.fil-braze-form .fil-field-wrap, .fil-braze-form.mktoForm .mktoFieldWrap),
:is(.fil-braze-form .fil-html-text, .fil-braze-form.mktoForm .mktoHtmlText),
:is(.fil-braze-form .fil-logical-field, .fil-braze-form.mktoForm .mktoLogicalField) {
  width: 100% !important;
}

:is(.fil-braze-form .fil-field-wrap, .fil-braze-form.mktoForm .mktoFieldWrap) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

/* Marketo form-level Layout and LabelWidth are preserved by converter v2.2.3.
 * Left-label forms use a governed two-column variant instead of per-form CSS. */
.fil-braze-form.fil-layout-left .fil-field-wrap {
  display: grid;
  grid-template-columns: var(--fil-label-width, 120px) minmax(0, 1fr);
  column-gap: 20px;
  align-items: start;
}

.fil-braze-form.fil-layout-left .fil-field-wrap > .fil-label {
  grid-column: 1;
  width: 100% !important;
  max-width: none !important;
  margin: 0;
  padding-top: 7px;
}

.fil-braze-form.fil-layout-left .fil-field-wrap > .fil-field,
.fil-braze-form.fil-layout-left .fil-field-wrap > .fil-logical-field,
.fil-braze-form.fil-layout-left .fil-field-wrap > .fil-field-error {
  grid-column: 2;
}

.fil-braze-form.fil-layout-left .fil-field-wrap > .fil-html-text {
  grid-column: 1 / -1;
}

.fil-braze-form.fil-layout-left .fil-field-wrap > .fil-clear {
  display: none !important;
}

:is(.fil-braze-form .fil-offset, .fil-braze-form .fil-gutter,
       .fil-braze-form.mktoForm .mktoOffset, .fil-braze-form.mktoForm .mktoGutter) {
  display: none !important;
  width: 0 !important;
}

:is(.fil-braze-form .fil-clear, .fil-braze-form.mktoForm .mktoClear) {
  display: block !important;
  clear: both;
  float: none;
  width: 100%;
  height: 0;
  overflow: hidden;
}

/* Labels and required indicators. */
:is(.fil-braze-form .fil-label, .fil-braze-form.mktoForm label.mktoLabel) {
  display: flex;
  float: none;
  width: 100% !important;
  max-width: 485px !important;
  margin: 0 0 10px;
  padding: 0;
  color: #20242b;
  font-size: 16px;
  font-weight: 400 !important;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* A blank technical Marketo label must not create an empty line. Required-only
 * labels retain their asterisk because they are not :empty. */
:is(.fil-braze-form .fil-label, .fil-braze-form.mktoForm label.mktoLabel):empty {
  display: none !important;
  margin: 0 !important;
}

:is(.fil-braze-form .fil-required-mark, .fil-braze-form.mktoForm .mktoAsterix) {
  order: -1;
  margin: 0 8px 0 0;
  padding: 0;
  color: #b22029;
  font-weight: 700;
}

/* Text controls. Inline widths from converted Marketo JSON are overridden. */
:is(.fil-braze-form input[type="text"],
       .fil-braze-form input[type="url"],
       .fil-braze-form input[type="email"],
       .fil-braze-form input[type="tel"],
       .fil-braze-form input[type="number"],
       .fil-braze-form input[type="date"],
       .fil-braze-form select,
       .fil-braze-form textarea,
       .fil-braze-form.mktoForm input[type="text"],
       .fil-braze-form.mktoForm input[type="url"],
       .fil-braze-form.mktoForm input[type="email"],
       .fil-braze-form.mktoForm input[type="tel"],
       .fil-braze-form.mktoForm input[type="number"],
       .fil-braze-form.mktoForm input[type="date"],
       .fil-braze-form.mktoForm select.mktoField,
       .fil-braze-form.mktoForm textarea.mktoField) {
  width: 100% !important;
  max-width: 400px !important;
  min-height: 46px;
  margin: 0;
  padding: 7px 15px !important;
  border: 0;
  border-bottom: 1px solid #b9bdc5;
  border-radius: 0;
  outline: 0;
  background: #f7f7f8;
  box-shadow: none;
  color: #20242b;
  font: inherit;
}

:is(.fil-braze-form textarea, .fil-braze-form.mktoForm textarea.mktoField) {
  min-height: 7rem;
  resize: vertical;
}

:is(.fil-braze-form input, .fil-braze-form select, .fil-braze-form textarea,
       .fil-braze-form.mktoForm input, .fil-braze-form.mktoForm select, .fil-braze-form.mktoForm textarea):focus {
  border-bottom: 2px solid #016fad;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

:is(.fil-braze-form .fil-invalid, .fil-braze-form.mktoForm .mktoInvalid) {
  border-color: #b22029 !important;
  background-color: #fff5f5 !important;
}

:is(.fil-braze-form .fil-field-error, .fil-braze-form .fil-error-banner,
       .fil-braze-form.mktoForm .mktoError, .fil-braze-form.mktoForm .validationError) {
  color: #b22029;
}

:is(.fil-braze-form .fil-field-error, .fil-braze-form.mktoForm .mktoError) {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
}

:is(.fil-braze-form .fil-error-banner, .fil-braze-form .fil-success) {
  width: 100%;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid currentColor;
  font-size: 15px;
  line-height: 1.45;
}

.fil-braze-form .fil-error-banner {
  background: #fff5f5;
}

.fil-braze-form .fil-success {
  background: #f1f8f3;
  color: #28643b;
}

/* Keep native accessible checkboxes/radios. This intentionally replaces the
 * icon-font pseudo-element treatment in mkto_18979.css because that font is
 * not guaranteed on every host page. */
:is(.fil-braze-form .fil-checkbox-list, .fil-braze-form .fil-radio-list,
       .fil-braze-form.mktoForm .mktoCheckboxList, .fil-braze-form.mktoForm .mktoRadioList) {
  display: block;
  position: relative;
  width: 100% !important;
  padding: 4px 0;
  border: 0 !important;
}

:is(.fil-braze-form input[type="checkbox"], .fil-braze-form input[type="radio"],
       .fil-braze-form.mktoForm input[type="checkbox"], .fil-braze-form.mktoForm input[type="radio"]) {
  position: static !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  margin: 2px 10px 0 0 !important;
  padding: 0 !important;
  accent-color: #016fad;
  vertical-align: top;
}

:is(.fil-braze-form .fil-checkbox-list > label,
       .fil-braze-form .fil-radio-list > label,
       .fil-braze-form.mktoForm .mktoCheckboxList > label,
       .fil-braze-form.mktoForm .mktoRadioList > label) {
  display: block;
  min-height: 24px;
  margin: 0 0 10px 30px !important;
  padding: 0 !important;
  color: #20242b;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
}

/* Multi-option checkbox/radio rows. The wrapper prevents host-page label and
 * float rules from separating the control from its option copy. */
.fil-braze-form .fil-checkbox-list .fil-option-row,
.fil-braze-form .fil-radio-list .fil-option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0 0 10px;
}

.fil-braze-form .fil-checkbox-list .fil-option-row > input,
.fil-braze-form .fil-radio-list .fil-option-row > input {
  flex: 0 0 20px;
  margin: 2px 0 0 !important;
}

.fil-braze-form .fil-checkbox-list .fil-option-row > label,
.fil-braze-form .fil-radio-list .fil-option-row > label {
  display: block;
  flex: 1 1 auto;
  min-height: 24px;
  margin: 0 !important;
  color: #20242b;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
  overflow-wrap: anywhere;
}

/* Radio orientation is independent from field-row layout. Two-choice fields
 * default to horizontal; longer converter-generated lists default to vertical. */
.fil-braze-form .fil-radio-list--horizontal {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 28px;
}

.fil-braze-form .fil-radio-list--horizontal .fil-option-row {
  display: inline-flex;
  width: auto;
  margin: 0;
}

.fil-braze-form .fil-radio-list--vertical {
  display: block;
}

.fil-braze-form .fil-radio-list--vertical .fil-option-row {
  display: flex;
  width: 100%;
}

/* Rating questions and other explicitly marked fields can put their label
 * above the controls even when the wider imported form uses left labels. */
.fil-braze-form.fil-layout-left .fil-field-wrap--label-above {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.fil-braze-form.fil-layout-left .fil-field-wrap--label-above > .fil-label {
  width: 100% !important;
  margin: 0 0 8px;
  padding-top: 0;
}

:is(.fil-braze-form .fil-checkbox-list .fil-option-row > label,
       .fil-braze-form .fil-radio-list .fil-option-row > label) a {
  color: #016fad;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Several APAC forms carry a required single checkbox whose explanatory copy
 * is supplied by the next HtmlText field. Do not let the deliberately blank
 * inner label create extra height. The converter/renderer must still associate
 * that following copy semantically; CSS cannot create an accessible label. */
.fil-braze-form .fil-form__checkbox-label:empty {
  display: none !important;
  min-height: 0;
  margin: 0 !important;
}

.fil-braze-form .fil-checkbox-list .fil-option-row > label br + br {
  display: none;
}

/* Renderer two-column option layout, stacking on small screens. */
.fil-braze-form .fil-checkbox-list.fil-two-col .fil-opt-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  clear: both;
  margin-bottom: 14px;
}

.fil-braze-form .fil-checkbox-list.fil-two-col .fil-opt-left,
.fil-braze-form .fil-checkbox-list.fil-two-col .fil-opt-right {
  flex: 1 1 50%;
}

.fil-braze-form .fil-checkbox-list.fil-two-col .fil-opt-right {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.fil-braze-form .fil-checkbox-list.fil-two-col .fil-opt-right label {
  margin: 0 !important;
}

/* Fieldsets and display-only HTML. */
:is(.fil-braze-form fieldset, .fil-braze-form.mktoForm fieldset) {
  width: 100%;
  min-width: 0;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid #d8dadd;
}

:is(.fil-braze-form fieldset legend, .fil-braze-form.mktoForm fieldset legend) {
  width: auto;
  margin: 0 !important;
  padding: 0 8px;
  color: #20242b;
  font-size: 18px;
  font-weight: 700;
}

:is(.fil-braze-form .fil-html-text, .fil-braze-form.mktoForm .mktoHtmlText) {
  display: block;
  clear: both;
  float: none;
  padding: 4px 0;
  color: #20242b;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: normal;
}

:is(.fil-braze-form .fil-html-text a, .fil-braze-form.mktoForm .mktoHtmlText a) {
  color: #016fad;
  text-decoration: underline;
}

:is(.fil-braze-form .fil-form__step-title) {
  margin: 0 0 14px;
  color: #20242b;
  font-size: 22px;
  line-height: 1.25;
}

:is(.fil-braze-form .fil-form__step-description,
       .fil-braze-form .fil-instruction) {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  color: #515b6b;
  font-size: 14px;
  line-height: 1.45;
}

/* Actions. */
:is(.fil-braze-form .fil-button-row, .fil-braze-form.mktoForm .mktoButtonRow) {
  display: block;
  clear: both;
  float: none;
  width: 100%;
  margin-top: 30px;
  padding-top: 0;
}

:is(.fil-braze-form .fil-button-wrap, .fil-braze-form.mktoForm .mktoButtonWrap) {
  margin-left: 0 !important;
}

:is(.fil-braze-form .fil-submit-button,
       .fil-braze-form.mktoForm button[type="submit"].mktoButton,
       .fil-braze-form.mktoForm .mktoButton) {
  min-width: 200px;
  max-width: 100%;
  height: auto !important;
  min-height: 46px;
  padding: 12px 16px !important;
  border: 1px solid #016fad !important;
  border-radius: 0;
  background: #016fad !important;
  background-image: none !important;
  color: #fff !important;
  font: inherit;
  font-size: 18px !important;
  line-height: 1.2 !important;
  text-align: center;
  cursor: pointer;
}

:is(.fil-braze-form .fil-submit-button,
       .fil-braze-form.mktoForm button[type="submit"].mktoButton,
       .fil-braze-form.mktoForm .mktoButton):hover,
:is(.fil-braze-form .fil-submit-button,
       .fil-braze-form.mktoForm button[type="submit"].mktoButton,
       .fil-braze-form.mktoForm .mktoButton):focus-visible {
  border-color: #00526b !important;
  background: #00526b !important;
  text-decoration: none;
}

:is(.fil-braze-form .fil-submit-button, .fil-braze-form.mktoForm .mktoButton):disabled {
  border-color: #91bedc !important;
  background: #91bedc !important;
  cursor: not-allowed;
}

:is(.fil-braze-form .fil-submit-button, .fil-braze-form.mktoForm .mktoButton):disabled:hover {
  border-color: #d7e5ee !important;
  background: #91bedc !important;
  cursor: wait;
}

#ff-submit:disabled {
  border-color: #91bedc !important;
  background: #91bedc !important;
  cursor: wait;
}

#ff-submit:disabled:hover {
  border-color: #d7e5ee !important;
  background: #91bedc !important;
}

:is(.fil-braze-form input[type="hidden"], .fil-braze-form.mktoForm input[type="hidden"]) {
  display: none !important;
}

/* The renderer wraps hidden fields in a normal form row. Suppress that row so
 * several migrated tracking fields do not create unexplained vertical gaps. */
:is(.fil-braze-form .fil-form-row, .fil-braze-form.mktoForm .mktoFormRow):has(> input[type="hidden"]) {
  display: none !important;
  margin: 0 !important;
}

:is(.fil-braze-form input, .fil-braze-form select, .fil-braze-form textarea):disabled {
  background-color: #eceef0 !important;
  color: #69717d;
  cursor: not-allowed;
}

/* Preserve Marketo rows containing three sibling fields. The converter marks
 * every participating field with layout="three-column" and the renderer emits
 * this row modifier. A following normal row clears the floats. */
.fil-braze-form .fil-form-row--three-column {
  clear: none;
  float: left;
  width: 33.3333%;
  padding-right: 16px;
  box-sizing: border-box;
}

.fil-braze-form .fil-form-row--three-column .fil-form-col {
  float: none;
  width: 100%;
}

/* The original Marketo three-column rows place each speaker label above its
 * rating choices even when the form-level label layout is left-aligned. */
.fil-braze-form.fil-layout-left .fil-form-row--three-column .fil-field-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.fil-braze-form.fil-layout-left .fil-form-row--three-column .fil-field-wrap > .fil-label {
  width: 100% !important;
  margin: 0 0 8px;
  padding-top: 0;
}

@media (max-width: 767px) {
  :is(.fil-braze-form, .fil-braze-form.mktoForm) {
    max-width: 100%;
  }

  :is(.fil-braze-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
         .fil-braze-form select, .fil-braze-form textarea,
         .fil-braze-form.mktoForm input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
         .fil-braze-form.mktoForm select, .fil-braze-form.mktoForm textarea) {
    max-width: 100% !important;
  }

  .fil-braze-form .fil-checkbox-list.fil-two-col .fil-opt-row {
    flex-direction: column;
    gap: 8px;
  }

  .fil-braze-form .fil-form-row--three-column {
    clear: both;
    float: none;
    width: 100%;
    padding-right: 0;
  }

  .fil-braze-form.fil-layout-left .fil-field-wrap {
    display: flex;
    flex-direction: column;
  }

  .fil-braze-form.fil-layout-left .fil-field-wrap > .fil-label {
    width: 100% !important;
    margin-bottom: 10px;
    padding-top: 0;
  }

  :is(.fil-braze-form .fil-submit-button, .fil-braze-form.mktoForm .mktoButton) {
    width: 100%;
  }
}
