/* ============================================================
   Marketo Forms 2.0 — Resi design system override (universal)
   ------------------------------------------------------------
   Applies to any Marketo form rendered inside a .resi-mkto wrapper:

     <div class="resi-mkto [modifiers]">
       <p class="resi-mkto__loading">Loading...</p>
       <form data-mkto-id="4935"></form>
     </div>

   Loaded on demand (only on pages containing data-mkto-id) by
   resi_marketo_maybe_enqueue() in functions.php; the form itself is
   lazy-loaded by assets/js/marketo.js.

   Opt-in modifiers on the wrapper:
     .resi-mkto--placeholders  Hide labels on text/email/tel/select fields
                               (kept for screen readers) and fill missing
                               placeholders from the label text.
     .resi-mkto--split-rows    Marketo rows holding 2+ fields become a
                               2-column grid (stacks below 640px).
     .resi-mkto--block-button  Full-width submit button.

   Opt-in behaviour via data attributes on the <form> (see marketo.js):
     data-mkto-pair-rows="4"   Pair the first N single-field rows side by side.
     data-mkto-button="Text"   Override the submit button label.
     data-mkto-recaptcha="KEY" reCAPTCHA Enterprise token on submit.

   Classes added by marketo.js:
     .resi-mkto-split    row with 2+ visible fields
     .resi-mkto-half     paired single-field row (+ -left / -right)
     .resi-mkto-clear    first row after the pairs
     (rows with only hidden inputs are hidden live via :has(), not a class)
     .resi-mkto-consent  rich-text row directly above the submit button
     .resi-mkto-nolabel  field descriptor whose label is hidden
   ============================================================ */

.resi-mkto .mktoForm,
.resi-mkto .mktoForm * {
  font-family: var(--font-body, 'Lexend', sans-serif) !important;
  box-sizing: border-box;
}
.resi-mkto .mktoForm {
  width: 100% !important;
  background: transparent !important;
  padding: 0 !important;
}
/* Clearfix so floated paired rows don't collapse the form */
.resi-mkto .mktoForm::after {
  content: '';
  display: table;
  clear: both;
}

/* ── Rows & fields — flatten Marketo's floated column layout ── */
.resi-mkto .mktoForm .mktoFormRow,
.resi-mkto .mktoForm .mktoFieldWrap,
.resi-mkto .mktoForm .mktoFieldDescriptor,
.resi-mkto .mktoForm .mktoCheckboxList,
.resi-mkto .mktoForm .mktoRadioList,
.resi-mkto .mktoForm .mktoLogicalField {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  clear: both !important;
}
.resi-mkto .mktoForm .mktoFieldDescriptor {
  margin-bottom: 1.25rem !important;
}
.resi-mkto .mktoForm .mktoOffset,
.resi-mkto .mktoForm .mktoGutter {
  display: none !important;
  width: 0 !important;
}
/* Rows holding only hidden inputs. Evaluated live with :has() — NOT tagged
   once by JS — because Marketo visibility rules inject fields into empty rows
   later (e.g. demo form: Job Title / Weekly Attendance appear when
   Industry = Church). A row hidden permanently would hide required fields
   and silently block submission. */
.resi-mkto .mktoForm .mktoFormRow:not(:has(.mktoField:not([type="hidden"]))):not(:has(.mktoHtmlText)) {
  display: none !important;
}

/* ── Labels ── */
.resi-mkto .mktoForm .mktoLabel {
  width: 100% !important;
  float: none !important;
  display: block !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--color-blue-charcoal, #55575e) !important;
  margin-bottom: 0.375rem !important;
  padding: 0 !important;
}
html.dark .resi-mkto .mktoForm .mktoLabel {
  color: #ececef !important;
}
/* Visually hidden label (still announced by screen readers) */
.resi-mkto .mktoForm .resi-mkto-nolabel > .mktoFieldWrap > .mktoLabel,
.resi-mkto .mktoForm .resi-mkto-nolabel .mktoLabel {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Inputs & selects ── */
.resi-mkto .mktoForm .mktoField {
  width: 100% !important;
  height: auto !important;
  padding: 0.625rem 0.875rem !important;
  border: 1px solid var(--color-neutral-200, #e1dde3) !important;
  border-radius: 0.75rem !important;
  background-color: #ffffff !important;
  color: var(--color-blue-charcoal, #55575e) !important;
  font-size: 1rem !important;
  transition: border-color 0.2s !important;
  box-shadow: none !important;
}
.resi-mkto .mktoForm .mktoField:focus {
  outline: none !important;
  border-color: var(--color-tertiary, #9300ff) !important;
}
.resi-mkto .mktoForm .mktoField::placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}
html.dark .resi-mkto .mktoForm .mktoField {
  background-color: #1a1b1f !important;
  border-color: #2a2b30 !important;
  color: #ececef !important;
}
html.dark .resi-mkto .mktoForm .mktoField:focus {
  border-color: var(--color-tertiary, #9300ff) !important;
}
html.dark .resi-mkto .mktoForm .mktoField::placeholder {
  color: #ffffff !important;
}

/* ── Checkbox & radio — left-align, full width ── */
.resi-mkto .mktoForm .mktoCheckboxList,
.resi-mkto .mktoForm .mktoRadioList,
.resi-mkto .mktoForm .mktoLogicalField {
  text-align: left !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  align-items: start !important;
  gap: 0.5rem !important;
}
.resi-mkto .mktoForm .mktoCheckboxList input[type="checkbox"],
.resi-mkto .mktoForm .mktoRadioList input[type="radio"] {
  margin: 0.25rem 0 0 0 !important;
  width: 1rem !important;
  height: 1rem !important;
  flex-shrink: 0 !important;
}
.resi-mkto .mktoForm .mktoCheckboxList label,
.resi-mkto .mktoForm .mktoRadioList label {
  display: block !important;
  font-size: 0.9375rem !important;
  font-weight: 400 !important;
  color: var(--color-blue-charcoal, #55575e) !important;
  text-align: left !important;
  margin: 0 !important;
  width: auto !important;
  float: none !important;
  line-height: 1.5 !important;
}
html.dark .resi-mkto .mktoForm .mktoCheckboxList label,
html.dark .resi-mkto .mktoForm .mktoRadioList label {
  color: #ececef !important;
}
.resi-mkto .mktoForm input[type="checkbox"],
.resi-mkto .mktoForm input[type="radio"] {
  accent-color: var(--color-primary, #ff585d) !important;
  width: 1rem !important;
  height: 1rem !important;
  cursor: pointer !important;
}
/* Opt-in check label (Marketo rich-text class used on the preference form) */
.resi-mkto .label_optin_check {
  font-weight: bold !important;
  text-decoration: underline !important;
}

/* ── HR dividers ── */
.resi-mkto .mktoForm hr {
  border: none !important;
  border-top: 1px solid var(--color-neutral-200, #e1dde3) !important;
  margin: 1.5rem 0 !important;
}
html.dark .resi-mkto .mktoForm hr {
  border-top-color: #2a2b30 !important;
}

/* ── Rich text & consent copy ── */
.resi-mkto .mktoForm .mktoHtmlText,
.resi-mkto .mktoForm .mktoHtmlText * {
  color: var(--color-blue-charcoal, #55575e) !important;
}
html.dark .resi-mkto .mktoForm .mktoHtmlText,
html.dark .resi-mkto .mktoForm .mktoHtmlText * {
  color: #ffffff !important;
}
.resi-mkto .mktoForm .mktoHtmlText {
  width: 100% !important;
  /* Marketo's inline form font-size varies per form (13px/14px); pin to 14px.
     Set on the block only so inline sizes inside the rich text still win. */
  font-size: 14px !important;
}
.resi-mkto .mktoForm .mktoHtmlText a {
  text-decoration: underline !important;
}
/* Consent copy directly above the submit button — mb-6 */
.resi-mkto .mktoForm .resi-mkto-consent .mktoFieldDescriptor {
  margin-bottom: 0 !important;
}
.resi-mkto .mktoForm .resi-mkto-consent .mktoHtmlText {
  margin-bottom: 1.5rem !important;
}
.resi-mkto .mktoForm .mktoCaptchaDisclaimer,
.resi-mkto .mktoForm .mktoCaptchaDisclaimer * {
  color: #000000 !important;
}
html.dark .resi-mkto .mktoForm .mktoCaptchaDisclaimer,
html.dark .resi-mkto .mktoForm .mktoCaptchaDisclaimer * {
  color: #ffffff !important;
}

/* ── Submit button — matches resi-btn resi-btn--primary ── */
.resi-mkto .mktoForm .mktoButtonRow {
  width: 100% !important;
  text-align: left !important;
  margin-top: 0.5rem !important;
  clear: both !important;
}
.resi-mkto .mktoForm .mktoButton {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 9999px !important;
  border: none !important;
  background: var(--color-primary, #ff585d) !important;
  background-image: none !important;
  color: #ffffff !important;
  font-family: var(--font-heading, 'Lexend', sans-serif) !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: background-color 0.2s !important;
  box-shadow: none !important;
}
.resi-mkto .mktoForm .mktoButton:hover {
  background: var(--color-primary-dark, #d94347) !important;
  background-image: none !important;
}

/* ── Validation errors ── */
.resi-mkto .mktoForm .mktoError .mktoErrorMsg {
  background: var(--color-primary, #ff585d) !important;
  color: #ffffff !important;
  border-radius: 0.5rem !important;
  font-size: 0.8125rem !important;
  padding: 0.25rem 0.625rem !important;
  box-shadow: none !important;
}
/* Hide required asterisk (span only — not the input itself) */
.resi-mkto .mktoForm .mktoAsterix {
  display: none !important;
}

/* ── Loading state ── */
.resi-mkto__loading {
  color: var(--color-neutral-500, #75777e);
  font-size: 0.9375rem;
}
html.dark .resi-mkto__loading {
  color: #a3a3a8;
}

/* ============================================================
   Modifiers
   ============================================================ */

/* Rows with 2+ fields → 2-column grid */
.resi-mkto--split-rows .mktoForm .mktoFormRow.resi-mkto-split {
  display: grid !important;
  grid-template-columns: 1fr !important;
  column-gap: 1rem !important;
}
@media (min-width: 640px) {
  .resi-mkto--split-rows .mktoForm .mktoFormRow.resi-mkto-split {
    grid-template-columns: 1fr 1fr !important;
  }
}
.resi-mkto--split-rows .mktoForm .mktoFormRow.resi-mkto-split > .mktoClear {
  display: none !important;
}
.resi-mkto--split-rows .mktoForm .mktoFormRow.resi-mkto-split > .mktoFieldDescriptor {
  clear: none !important;
}

/* Paired single-field rows (data-mkto-pair-rows) */
.resi-mkto .mktoForm .mktoFormRow.resi-mkto-half {
  float: left !important;
  width: calc(50% - 0.375rem) !important;
  clear: none !important;
}
.resi-mkto .mktoForm .mktoFormRow.resi-mkto-half-left {
  margin-right: 0.75rem !important;
}
.resi-mkto .mktoForm .mktoFormRow.resi-mkto-half-right {
  margin-right: 0 !important;
}
.resi-mkto .mktoForm .mktoFormRow.resi-mkto-clear {
  clear: both !important;
}

/* Full-width submit button */
.resi-mkto--block-button .mktoForm .mktoButtonWrap {
  width: 100% !important;
  margin-left: 0 !important;
}
.resi-mkto--block-button .mktoForm .mktoButton {
  display: flex !important;
  width: 100% !important;
}
