/* MP Form Builder — minimal front-end styles. Override any --mp-fb-* variable from the theme or Elementor. */
.mp-fb {
  --mp-fb-accent: var(--mp-token-brand);
  --mp-fb-accent-ink: var(--mp-token-white);
  --mp-fb-text: inherit;
  --mp-fb-muted: var(--mp-token-ink-muted);
  --mp-fb-border: var(--mp-token-border);
  --mp-fb-input-bg: var(--mp-token-white);
  --mp-fb-input-text: var(--mp-token-ink);
  --mp-fb-radius: 6px;
  --mp-fb-input-padding: 0.6em 0.8em;
  --mp-fb-control-pad-y: 0.6rem;
  --mp-fb-control-line: 1.4;
  --mp-fb-col-gap: 1rem;
  --mp-fb-row-gap: 1rem;
  --mp-fb-choice-gap: 6px;
  --mp-fb-error: var(--mp-token-danger);
  --mp-fb-error-bg: var(--mp-token-wp-notice-error-surface);
  --mp-fb-success: var(--mp-token-wp-success);
  --mp-fb-success-bg: var(--mp-token-wp-notice-success-surface);
  --mp-fb-focus: var(--mp-token-focus);
  --mp-fb-button-bg: var(--mp-fb-accent);
  --mp-fb-button-ink: var(--mp-fb-accent-ink);
  --mp-fb-button-flex: 0 0 auto;
  color: var(--mp-fb-text);
}

.mp-fb *,
.mp-fb *::before,
.mp-fb *::after {
  box-sizing: border-box;
}

.mp-fb-form {
  margin: 0;
}

.mp-fb-step {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.mp-fb-step[hidden],
.mp-fb-field[hidden],
.mp-fb-button[hidden],
.mp-fb-message[hidden],
.mp-fb-error[hidden] {
  display: none !important;
}

.mp-fb-step__title {
  font-size: 1.15em;
  font-weight: 600;
  margin: 0 0 0.5em;
  padding: 0;
}

.mp-fb-step__description {
  color: var(--mp-fb-muted);
  margin-bottom: 1em;
}

.mp-fb-grid {
  display: flex;
  flex-direction: column;
  gap: var(--mp-fb-row-gap) var(--mp-fb-col-gap);
}

/* The form-level wrapper is a vertical stack of steps; only each step owns a column grid.
 * In a flex column, align-items controls the horizontal axis, so it must stay `stretch`
 * or steps shrink to their content instead of filling the row. */
.mp-fb-fields {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--mp-fb-row-gap) var(--mp-fb-col-gap);
}

.mp-fb-grid > .mp-fb-step {
  display: flex;
  flex-direction: column;
  gap: var(--mp-fb-row-gap);
}
.mp-fb-step-fields,
.mp-fb [data-step-footer] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--mp-fb-row-gap) var(--mp-fb-col-gap);
}
.mp-fb [data-step-footer] { margin-top: 0; }
/* Spans own footer geometry, including when legacy Elementor CSS is still cached. */
.mp-fb [data-step-footer] > .mp-fb-button {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
  justify-self: stretch !important;
  overflow-wrap: anywhere;
}
/* A button placed in the field grid is a grid item and fills its span like a footer button. */
.mp-fb .mp-fb-step-fields > .mp-fb-button {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
.mp-fb [data-step-footer] > .mp-fb-message { margin: 0; }
.mp-fb-message-row:has(> .mp-fb-message[hidden]) { display: none; }
.mp-fb-step__title,
.mp-fb-step__description { grid-column: 1 / -1; }
@media (max-width: 1024px) {
  .mp-fb [data-grid-container] { grid-template-columns: minmax(0, 1fr); }
  .mp-fb [data-grid-container] > [data-grid-item] { grid-column: 1 / -1; }
}
.mp-fb-field,
.mp-fb-grid-item,
.mp-fb-step__title,
.mp-fb-step__description,
.mp-fb-grid > .mp-fb-actions,
.mp-fb-grid > .mp-fb-message,
.mp-fb-grid > .mp-fb-captcha,
.mp-fb-grid > .mp-fb-captcha-error,
.mp-fb-grid > .mp-fb-ghl-turnstile {
  grid-column: 1 / -1;
  max-width: 100%;
  min-width: 0;
}
.mp-fb-field { position: relative; }
.mp-fb-w-75 { grid-column: span 9; }
.mp-fb-w-66 { grid-column: span 8; }
.mp-fb-w-50 { grid-column: span 6; }
.mp-fb-w-33 { grid-column: span 4; }
.mp-fb-w-25 { grid-column: span 3; }
.mp-fb-grid .mp-fb-actions,
.mp-fb-grid .mp-fb-message { margin-top: 0; }
.mp-fb [hidden] { display: none !important; }

@media (max-width: 767px) {
  .mp-fb-grid, .mp-fb-fields { grid-template-columns: minmax(0, 1fr); }
  .mp-fb-field { grid-column: 1 / -1; }
}

.mp-fb-label,
.mp-fb-choices > legend {
  display: block;
  font-weight: 600;
  margin: 0 0 0.35em;
  padding: 0;
}

.mp-fb-required {
  color: var(--mp-fb-error);
  margin-left: 0.15em;
}

.mp-fb-sr-only,
.mp-fb-hp {
  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;
}

.mp-fb-hp {
  left: -9999px !important;
}

.mp-fb-input {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: var(--mp-fb-input-padding);
  border: 1px solid var(--mp-fb-border);
  border-radius: var(--mp-fb-radius);
  background-color: var(--mp-fb-input-bg);
  color: var(--mp-fb-input-text);
  font: inherit;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mp-fb-input:focus {
  outline: none;
  border-color: var(--mp-fb-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mp-fb-focus) 35%, transparent);
}

textarea.mp-fb-input {
  resize: vertical;
  min-height: 6em;
}

input[type="file"].mp-fb-input {
  padding: 0.45em;
}

.mp-fb-choices {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--mp-fb-choice-gap);
}

.mp-fb-choices--inline {
  flex-direction: row;
  flex-wrap: wrap;
  column-gap: calc(var(--mp-fb-choice-gap) * 3);
}

.mp-fb-choices--inline > legend {
  width: 100%;
}

.mp-fb-choice {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5em;
  cursor: pointer;
  font-weight: 400;
}

.mp-fb-choice input {
  margin: 0.2em 0 0;
  accent-color: var(--mp-fb-accent);
  flex: 0 0 auto;
}

.mp-fb-description {
  color: var(--mp-fb-muted);
  font-size: 0.875em;
  margin-top: 0.35em;
}

.mp-fb-error {
  color: var(--mp-fb-error-text, var(--mp-fb-error));
  background: var(--mp-fb-error-inline-bg, transparent);
  border-radius: var(--mp-fb-error-radius, 4px);
  font-size: 0.875em;
  margin-top: 0.35em;
  overflow-wrap: anywhere;
}
.mp-fb-field > .mp-fb-error::before { content: '! '; font-weight: 700; }
/* Keep descriptions available to AT, while summary links carry visual feedback. */
.mp-fb[data-error-display="summary"] .mp-fb-field > .mp-fb-error,
.mp-fb[data-error-display="tooltip"] .mp-fb-field > .mp-fb-error {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
/* Only one focused bubble is shown; it cannot intercept the next control. Escape dismisses it. */
.mp-fb[data-error-display="tooltip"] .mp-fb-field:focus-within:not(.is-error-dismissed) > .mp-fb-error {
  inset-inline: 0;
  top: 100%;
  width: auto;
  height: auto;
  clip-path: none;
  padding: 0.5em 0.75em;
  z-index: 10;
  pointer-events: none;
  background: var(--mp-fb-error-tooltip-bg, var(--mp-fb-error-bg));
  border: 1px solid var(--mp-fb-error);
  box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
}
/* Touch users need persistent feedback without a bubble covering later controls. */
@media (hover: none), (pointer: coarse) {
  .mp-fb[data-error-display="tooltip"] .mp-fb-field > .mp-fb-error,
  .mp-fb[data-error-display="tooltip"] .mp-fb-field:focus-within:not(.is-error-dismissed) > .mp-fb-error {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
    overflow: visible;
  }
}
.mp-fb-error-summary { margin: 0; padding-inline-start: 1.25em; }
.mp-fb-error-summary li + li { margin-top: var(--mp-fb-summary-gap, 0.35em); }
.mp-fb-error-summary a { color: var(--mp-fb-summary-link, inherit); text-decoration: underline; }
.mp-fb-error-summary a:focus-visible,
.mp-fb-message:focus-visible { outline: 2px solid var(--mp-fb-focus); outline-offset: 3px; }

.mp-fb-field.has-error .mp-fb-input {
  border-color: var(--mp-fb-error);
}

.mp-fb-captcha {
  margin-top: var(--mp-fb-row-gap);
}

.mp-fb-message {
  margin: var(--mp-fb-row-gap) 0 0;
  padding: 0.75em 1em;
  border: 1px solid transparent;
  border-radius: var(--mp-fb-radius);
}

.mp-fb > .mp-fb-message {
  margin: 0 0 var(--mp-fb-row-gap);
}

.mp-fb-message.is-success {
  color: var(--mp-fb-success);
  background-color: var(--mp-fb-success-bg);
  border-color: var(--mp-fb-success);
}

.mp-fb-message.is-error {
  color: var(--mp-fb-error);
  background-color: var(--mp-fb-error-bg);
  border-color: var(--mp-fb-error);
}

.mp-fb-actions {
  justify-content: var(--mp-fb-actions-justify, var(--mp-fb-button-justify, flex-start));
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--mp-fb-row-gap);
}

.mp-fb-button {
  width: var(--mp-fb-button-width, auto);
  max-width: 100%;
  flex: var(--mp-fb-button-flex);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.7em 1.4em;
  border: 1px solid var(--mp-fb-button-bg);
  border-radius: var(--mp-fb-radius);
  background-color: var(--mp-fb-button-bg);
  color: var(--mp-fb-button-ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.mp-fb-button:hover {
  opacity: 0.9;
}

.mp-fb-button:focus-visible {
  outline: 2px solid var(--mp-fb-focus);
  outline-offset: 2px;
}

/* Control metrics use rem, not em: custom properties are substituted as raw tokens, so em would resolve per element
 * and a themed 14px button would end up shorter than a 16px input.
 * One shared height for every single-line control, so an input and a Send button on the same grid row
 * always match regardless of theme resets or native widget quirks (date/select size their own inner parts).
 * Inputs get that exact height (border-box, so device-pixel border rounding cannot add to it). Buttons get it as a
 * minimum with deliberately small padding, so a single-line label is always sized by the minimum rather than by
 * padding + border (which differs by a pixel at fractional zoom), while a long label can still wrap and grow.
 * Textareas, multi-selects and file inputs keep their own size. */
.mp-fb {
  --mp-fb-control-height: calc(var(--mp-fb-control-line) * 1rem + 2 * var(--mp-fb-control-pad-y) + 2px);
}
.mp-fb .mp-fb-input:not(textarea):not([multiple]):not([type="file"]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  box-sizing: border-box;
  height: var(--mp-fb-control-height);
  padding-block: var(--mp-fb-control-pad-y);
  line-height: var(--mp-fb-control-line);
  margin-block: 0;
}
.mp-fb .mp-fb-button {
  box-sizing: border-box;
  min-height: var(--mp-fb-control-height);
  padding-block: 0.3rem;
  line-height: var(--mp-fb-control-line);
  margin-block: 0;
}
/* Native date/time widgets are taller than one text line; trim their inner padding to fit the shared height. */
.mp-fb .mp-fb-input::-webkit-datetime-edit,
.mp-fb .mp-fb-input::-webkit-datetime-edit-fields-wrapper { padding-block: 0; }

.mp-fb-button--prev,
.mp-fb-button--secondary {
  background-color: transparent;
  color: var(--mp-fb-accent);
  border-color: var(--mp-fb-border);
}

/* Skip / tertiary actions read as a text link rather than a button. */
.mp-fb-button--link,
.mp-fb-button--skip {
  background-color: transparent;
  border-color: transparent;
  color: var(--mp-fb-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.mp-fb-button--skip { flex: 0 0 auto; }

/* Thank-you layout: replaces the plain success banner when enabled in the form settings. */
.mp-fb-message:has(> .mp-fb-thankyou) {
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: inherit;
}
.mp-fb-thankyou {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  text-align: center;
}
.mp-fb-thankyou__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  background-color: var(--mp-fb-success-bg);
  color: var(--mp-fb-success);
}
.mp-fb-thankyou__icon:has(.mp-fb-thankyou__image) {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
}
.mp-fb-thankyou__check { width: 2rem; height: 2rem; }
.mp-fb-thankyou__image { display: block; max-width: 100%; height: auto; max-height: 8rem; width: auto; }
.mp-fb-thankyou__heading { margin: 0; font-size: 1.5em; line-height: 1.25; }
.mp-fb-thankyou__text { max-width: 36em; }
.mp-fb-thankyou__text > :first-child { margin-top: 0; }
.mp-fb-thankyou__text > :last-child { margin-bottom: 0; }
.mp-fb-thankyou__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 0.5rem; }
.mp-fb-thankyou__actions .mp-fb-button { text-decoration: none; }
.mp-fb-thankyou__actions .mp-fb-button--link { text-decoration: underline; }

.mp-fb-form.is-sending .mp-fb-button--submit {
  opacity: 0.6;
  cursor: progress;
}

.mp-fb-form.is-submitted .mp-fb-step,
.mp-fb-form.is-submitted .mp-fb-actions,
.mp-fb-form.is-submitted .mp-fb-progress,
.mp-fb-form.is-submitted .mp-fb-progress-bar,
.mp-fb-form.is-submitted .mp-fb-captcha,
.mp-fb-form.is-submitted .mp-fb-captcha-error,
.mp-fb-form.is-submitted .mp-fb-ghl-turnstile {
  display: none !important;
}
.mp-fb-form.is-submitted .mp-fb-grid > :not(.mp-fb-message) { display: none !important; }
.mp-fb-form.is-submitted .mp-fb-grid > .mp-fb-message {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
}

.mp-fb-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.mp-fb-progress__step {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--mp-fb-muted);
  font-size: 0.9em;
  margin: 0;
}

.mp-fb-progress__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  border: 1px solid var(--mp-fb-border);
  font-weight: 600;
  font-size: 0.85em;
}

.mp-fb-progress__step.is-active,
.mp-fb-progress__step.is-done {
  color: var(--mp-fb-text);
}

.mp-fb-progress__step.is-active .mp-fb-progress__num,
.mp-fb-progress__step.is-done .mp-fb-progress__num {
  background-color: var(--mp-fb-accent);
  border-color: var(--mp-fb-accent);
  color: var(--mp-fb-accent-ink);
}

.mp-fb-progress-bar {
  height: 4px;
  border-radius: 999px;
  background-color: var(--mp-token-gray-200);
  overflow: hidden;
  margin-bottom: var(--mp-fb-row-gap);
}

.mp-fb-progress-bar__fill {
  display: block;
  height: 100%;
  background-color: var(--mp-fb-accent);
  transition: width 0.25s ease;
}

.mp-fb-toast {
  position: fixed;
  z-index: 100000;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 0.9em 1.2em;
  border-radius: var(--mp-fb-radius, 6px);
  background-color: var(--mp-token-toast-bg);
  color: var(--mp-token-white);
  box-shadow: 0 6px 24px var(--mp-token-shadow-15);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mp-fb-toast.is-visible {
  opacity: 1;
  transform: none;
}

.mp-fb-notice {
  padding: 0.75em 1em;
  border: 1px dashed var(--mp-token-border-dashed);
}

.mp-fb-test-notice {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px dashed currentColor;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}
