/* ═══════════════════════════════════════════════════════════════
   HEIMFINDER FLOW EMBED - inline mount inside #moonform-root
   Chromeless: no card border-radius, no shadow, no enclosing box.
   The form blends with the host LP's hero. Question text + 3-segment
   progress indicator + step body. Lean blue icons, conversational
   tone, one question per screen for the search criteria.
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset (scoped under #moonform-root .moonform) ── */
#moonform-root .moonform *,
#moonform-root .moonform *::before,
#moonform-root .moonform *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  line-height: 1;
}
#moonform-root .moonform button,
#moonform-root .moonform input,
#moonform-root .moonform .autocomplete-item {
  touch-action: manipulation;
}

/* ── Theme tokens ── */
#moonform-root .moonform {
  --navy: #2E2868;
  --navy-mid: #4A4290;
  --navy-soft: #9294C9;
  --navy-pale: #EEEDF6;
  --fushia: #E72168;
  --pink: #F8CAE0;
  --pink-pale: #FDF0F6;
  --blue: #4C99FF;          /* primary brand blue (lighter, friendlier) */
  --blue-deep: #2E80E5;     /* hover / active text */
  --blue-light: #ECF3FF;    /* selected card backdrop */
  --white: #FFFFFF;
  --bg: #F7F6FB;
  --text: #16182D;
  --text-muted: #54505C;
  --border: #E5E3EE;
  --border-strong: #D4D0E0;
  --border-focus: #4C99FF;
  --error: #C0392B;
  --radius-sm: 10px;
  --radius: 14px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);

  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  color: var(--text);
  display: block;
  width: 100%;
}

/* ── Container (chromeless) ── */
#moonform-root .moonform .form-wrapper {
  width: 100%;
  position: relative;
}
#moonform-root .moonform .form-body {
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   CONVERSATIONAL TITLE
   Big-text question that changes per step. Pink-highlighted accent
   words inside <span class="accent">. Sits where the LP H1 used
   to be — this IS the hero copy.
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform .form-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 30px;
  font-weight: 500;          /* lighter conversational tone for all step titles */
  line-height: 1.32;
  color: var(--navy);
  text-align: center;
  letter-spacing: -0.4px;
  max-width: 760px;
  margin: 0 auto 56px;       /* generous breathing room before progress */
  padding: 0 4px;
  /* Stable bottom edge across short-title steps so the progress bar
     lands at a consistent vertical position. Long titles (step 1)
     grow past this min and push progress down naturally. Plain
     min-height (no flex) so multi-line text flow stays normal. */
  min-height: 130px;
}
/* The accent word(s) — the question — read in deep pink with a
   light-pink underline tic. Upright (no italics). */
#moonform-root .moonform .form-title .accent {
  color: var(--fushia);
  font-weight: inherit;
  background-image: linear-gradient(0deg, rgba(248,202,224,0.7), rgba(248,202,224,0.7) 28%, transparent 28.01%);
}
/* Color-coded acknowledgement: confirms the user's previous answer.
   Blue text + light-blue underline tic, upright. */
#moonform-root .moonform .form-title .accent-blue {
  color: var(--blue);
  font-weight: inherit;
  background-image: linear-gradient(0deg, rgba(76,153,255,0.20), rgba(76,153,255,0.20) 28%, transparent 28.01%);
}
/* Step 1 carries an LP-style intro sentence + the actual question.
   Mark the question wrapper with .form-title-question so a clean
   blank line sits between the two without needing <br><br>. The
   question is rendered LIGHTER than the H1 intro for visual hierarchy. */
/* Step 1's brand promise H1 — designed like the v2 LP hero
   headline: medium weight (not heavy), generous size. The
   question that follows reads slightly smaller so the H1 pops. */
#moonform-root .moonform .form-title-intro {
  display: block;
  font-weight: 500;
  font-size: 1.12em;
  line-height: 1.16;
  letter-spacing: -0.6px;
}
#moonform-root .moonform .form-title-question {
  display: block;
  margin-top: 1.4em;
  font-weight: 500;
  font-size: 0.78em;
  line-height: 1.3;
}
/* Desktop (>=960): the host LP renders its own H1 in the hero.
   Hide the form's step-1 intro to avoid the marketing pitch reading
   twice. The question on the same step then sits without its top
   margin (no preceding intro to gap below). */
@media (min-width: 960px) {
  #moonform-root .moonform .form-title-intro { display: none; }
  #moonform-root .moonform .form-title-intro + .form-title-question {
    margin-top: 0;
    font-size: 1em;       /* full-size question on desktop where it's the only title */
  }
}
@media (min-width: 768px) {
  #moonform-root .moonform .form-title {
    font-size: 44px;
    line-height: 1.22;
    margin-bottom: 64px;
    letter-spacing: -0.6px;
    min-height: 180px;     /* desktop equivalent — taller font needs more headroom */
  }
}

/* ═══════════════════════════════════════════════════════════════
   3-SEGMENT PROGRESS INDICATOR
   Blue active dot + connector + grey upcoming dots. Matches the
   reference flow's "Your search / Your information / Your free list".
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform .form-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 28px;
  max-width: 480px;
  padding: 0 8px;
}
#moonform-root .moonform .form-progress-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#moonform-root .moonform .form-progress-segment .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border-strong);
  position: relative;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
#moonform-root .moonform .form-progress-segment.is-active .dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(76,153,255,0.18);
  transform: scale(1.05);
}
#moonform-root .moonform .form-progress-segment.is-completed .dot {
  background: var(--blue);
}
/* Check-circle icon revealed on segment 3 once the user reaches the
   confirmation screen (step 8+). Replaces the dot's circle visual
   with the icon (transparent bg, transparent box-shadow, normal scale). */
#moonform-root .moonform .form-progress-segment .dot-check-icon {
  display: none;
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: var(--blue);
}
#moonform-root .moonform .form-progress-segment.is-list-ready .dot {
  width: 22px;
  height: 22px;
  background: transparent;
  box-shadow: none;
  transform: none;
}
#moonform-root .moonform .form-progress-segment.is-list-ready .dot-check-icon {
  display: block;
}
#moonform-root .moonform .form-progress-segment.is-list-ready .label {
  color: var(--blue-deep);
  font-weight: 700;
}
#moonform-root .moonform .form-progress-segment .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.1px;
  transition: color var(--transition);
}
#moonform-root .moonform .form-progress-segment.is-active .label {
  color: var(--blue-deep);
  font-weight: 700;
}
#moonform-root .moonform .form-progress-line {
  flex: 1 1 auto;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  margin-top: -16px; /* align to dot vertically */
  min-width: 24px;
}
@media (max-width: 420px) {
  #moonform-root .moonform .form-progress { gap: 6px; }
  #moonform-root .moonform .form-progress-segment .label { font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════
   MATCHING / LOADING SCREEN (step 5)
   Pure-CSS rings + a 3-stage progressive checklist with smooth
   reveal. Auto-advances after ~2.7s via JS. No external library —
   keeps the bundle tiny and dependency-free.
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform .matching-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding: 8px 16px 16px;
  max-width: 480px;
  margin: 0 auto;
}
#moonform-root .moonform .matching-pulse {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
}
#moonform-root .moonform .matching-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--blue);
  opacity: 0;
  animation: moonformPulseRing 2.4s ease-out infinite;
}
#moonform-root .moonform .matching-pulse-ring:nth-child(2) { animation-delay: 0.6s; }
#moonform-root .moonform .matching-pulse-ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes moonformPulseRing {
  0%   { transform: scale(0.4); opacity: 0; }
  20%  { opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0; }
}
#moonform-root .moonform .matching-pulse-core {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px -8px rgba(76,153,255,0.6);
  animation: moonformPulseCore 2.4s ease-in-out infinite;
}
@keyframes moonformPulseCore {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
#moonform-root .moonform .matching-checks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
#moonform-root .moonform .matching-checks li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.4s ease, color 0.4s ease;
}
#moonform-root .moonform .matching-checks li::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--white);
  flex-shrink: 0;
  transition: background 0.3s ease, border-color 0.3s ease;
}
#moonform-root .moonform .matching-checks li.is-active {
  opacity: 1;
  color: var(--navy);
}
#moonform-root .moonform .matching-checks li.is-done {
  opacity: 1;
  color: var(--blue-deep);
}
#moonform-root .moonform .matching-checks li.is-done::before {
  background: var(--blue);
  border-color: var(--blue);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8 7 12 13 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  animation: moonformCheckPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes moonformCheckPop {
  0%   { transform: scale(0.6); }
  100% { transform: scale(1); }
}
@media (max-width: 599px) {
  #moonform-root .moonform .matching-screen { gap: 28px; padding: 0; }
  #moonform-root .moonform .matching-pulse { width: 80px; height: 80px; }
  #moonform-root .moonform .matching-pulse-core { width: 46px; height: 46px; }
  #moonform-root .moonform .matching-checks li { font-size: 14px; }
}

/* ═══════════════════════════════════════════════════════════════
   STEPS (animated transitions)
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform .step {
  display: none;
  animation: moonformFadeSlide 0.3s ease forwards;
  position: relative;
  max-width: 640px;          /* keeps desktop content from sprawling */
  margin: 0 auto;
}
#moonform-root .moonform .step.active { display: block; }
@keyframes moonformFadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #moonform-root .moonform .step { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════
   CHOICE CARDS - lean white card, thin border, blue icon
   - choices-grid: 2-col grid (e.g. type_etablissement, budget)
   - default (.choices, no .choices-grid): single-column rows
     (e.g. urgence, autonomie when stacked)
   - .choice-card-row: explicit row layout with icon + label inline
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform .choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}
#moonform-root .moonform .choices.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
#moonform-root .moonform .choices.choices-inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}
#moonform-root .moonform .choice-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  color: var(--navy);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  min-height: 92px;
}
#moonform-root .moonform .choice-card:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}
#moonform-root .moonform .choice-card.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(76,153,255,0.18);
}
#moonform-root .moonform .choice-card .choice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
}
/* Override the SVG's stroke-width + size attributes so every icon
   reads at the same scale regardless of what the markup specifies.
   Bigger (zoomed) and leaner (thin stroke) per design direction. */
#moonform-root .moonform .choice-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.8;
}
#moonform-root .moonform .choice-card .choice-label {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--navy);
  letter-spacing: -0.1px;
}
#moonform-root .moonform .choice-card .choice-label small {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* Row variant: icon left, label right (used for urgence) */
#moonform-root .moonform .choice-card-row {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  padding: 14px 18px;
  min-height: auto;
  gap: 14px;
}
#moonform-root .moonform .choice-card-row .choice-label {
  font-size: 17px;
}

/* When a choices-grid has 5 cards (e.g. lien_parente: 2x2 + 1
   underneath), the .choice-card-wide modifier makes the last card
   span both columns so it sits centered below the 2x2 instead of
   landing alone in the first column. */
#moonform-root .moonform .choices.choices-grid .choice-card-wide {
  grid-column: 1 / -1;
}

/* Inline variant for residence (Zu Hause / Spital — 2 buttons in a row) */
#moonform-root .moonform .choices-inline .choice-card {
  flex: 1 1 0;
  min-width: 140px;
  flex-direction: row;
  padding: 14px;
  min-height: auto;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   INPUT FIELDS
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform .input-group {
  display: block;
  margin-bottom: 14px;
}
/* Input pairs (e.g. Vorname + Nachname) stay side-by-side at every
   viewport — short placeholders make this comfortable even on narrow
   phones, and matches the reference's denser contact form. */
#moonform-root .moonform .input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
#moonform-root .moonform .input-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.3;
}
#moonform-root .moonform .input-label.required::after {
  content: ' *';
  color: var(--fushia);
}
#moonform-root .moonform .input-field {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
#moonform-root .moonform .input-field:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(76,153,255,0.18);
}
/* iOS: avoid focus zoom (font-size >= 16px on mobile) */
@media (max-width: 599px) {
  #moonform-root .moonform .input-field { font-size: 16px; }
}
#moonform-root .moonform select.input-field {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23545C5C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Step 3 — city input + arrow-in-input advance. Centered text so
   the typed answer/placeholder sits in the middle of the field.
   Sized to match the rest of the form's input rhythm — the step's
   vertical breathing room comes from the host hero's min-height,
   not from inflating this control. */
#moonform-root .moonform .input-with-advance {
  position: relative;
  max-width: 540px;
  margin: 0 auto 14px;
}
/* Inside the compact personal-info step, the input-with-advance
   wraps the age field which sits below a 2-up name row. Drop the
   540px cap so the age field matches the row's width. */
#moonform-root .moonform .step-compact .input-with-advance {
  max-width: none;
  margin-bottom: 12px;
}
#moonform-root .moonform .input-field-lg {
  font-size: 16px;
  padding: 16px 56px 16px 56px;  /* equal left/right keeps placeholder centered */
  border-radius: 14px;
  border-width: 1.5px;
  text-align: center;
  font-weight: 600;
}
#moonform-root .moonform .input-field-lg::placeholder {
  font-weight: 500;
  color: var(--text-muted);
}
@media (max-width: 599px) {
  #moonform-root .moonform .input-field-lg {
    font-size: 16px;
    padding: 14px 48px 14px 48px;
  }
}
#moonform-root .moonform .input-arrow {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--fushia);
  color: var(--white);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease, background 200ms ease;
  box-shadow: 0 6px 14px -4px rgba(231,33,104,0.5);
}
#moonform-root .moonform .input-arrow:not([disabled]) {
  opacity: 1;
  pointer-events: auto;
}
#moonform-root .moonform .input-arrow:not([disabled]):hover {
  background: #d11a5d;
  transform: translateY(-50%) scale(1.05);
}
#moonform-root .moonform .input-arrow[disabled] {
  background: var(--border-strong);
  box-shadow: none;
  cursor: not-allowed;
}

/* Mail icon inside the email field */
#moonform-root .moonform .input-with-icon {
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
  padding-left: 38px;
}
#moonform-root .moonform .input-icon-mail {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23545C5C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E");
}

/* Error message */
#moonform-root .moonform .error-msg {
  display: none;
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
}
#moonform-root .moonform .error-msg.visible { display: block; }

/* Confidentiality note */
#moonform-root .moonform .confidentiality-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--navy-pale);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--navy);
  line-height: 1.4;
}
#moonform-root .moonform .confidentiality-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}
#moonform-root .moonform .confidentiality-note a {
  color: var(--navy);
  text-decoration: underline;
  font-weight: 600;
}

/* Step hint (small intro line above step content) */
#moonform-root .moonform .step-hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 auto 14px;
  max-width: 480px;
  line-height: 1.45;
}

/* Compact variant for the contact step */
#moonform-root .moonform .step-compact { max-width: 560px; margin: 0 auto; }

/* ═══════════════════════════════════════════════════════════════
   CONFIRMATION CHIP (step 8 — between Part 1 submit and Part 2)
   Carries a "Anfrage gesendet ✓" acknowledgement, an invitation to
   answer the remaining post-form questions, and the "4× schneller"
   stat lifted from the thank-you badge. Sits above the first
   post-form question on the same screen.
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform .confirmation-chip {
  background: var(--pink-pale);
  border: 1px solid var(--pink);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 auto 28px;
  max-width: 540px;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
#moonform-root .moonform .confirmation-chip-row {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
}
#moonform-root .moonform .confirmation-chip-check {
  color: #1F7F4D;
  flex-shrink: 0;
  margin-top: 2px;
}
#moonform-root .moonform .confirmation-chip-stat {
  font-weight: 800;
  color: var(--fushia);
  white-space: nowrap;
}

/* Step 10 (autonomie) auto-submits on choice click — hide the manual
   form-nav (submit + back). Buttons stay in DOM so the keyboard Enter
   handler and submit spinner still work. */
#moonform-root .moonform #step-10 .form-nav { display: none; }

/* ═══════════════════════════════════════════════════════════════
   AUTOCOMPLETE DROPDOWN
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform .autocomplete-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px -8px rgba(46,40,104,0.15);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}
#moonform-root .moonform .autocomplete-list.open { display: block; }
#moonform-root .moonform .autocomplete-item {
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  color: var(--navy);
}
#moonform-root .moonform .autocomplete-item:last-child { border-bottom: 0; }
#moonform-root .moonform .autocomplete-item:hover,
#moonform-root .moonform .autocomplete-item.highlighted {
  background: var(--blue-light);
}

/* ═══════════════════════════════════════════════════════════════
   POST-FORM (step 6) helpers
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform .postform-intro {
  background: var(--navy-pale);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 auto 18px;
  max-width: 560px;
}
#moonform-root .moonform .postform-intro-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
#moonform-root .moonform .postform-intro-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}
#moonform-root .moonform .resident-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 14px;
}
#moonform-root .moonform .resident-badge svg { color: var(--navy); }

/* Civil row (Anrede toggle) */
#moonform-root .moonform .civil-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
#moonform-root .moonform .civil-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
#moonform-root .moonform .civil-btn:hover { border-color: var(--blue); }
#moonform-root .moonform .civil-btn.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS - submit (primary fuchsia pill) + back (discreet text)
   ═══════════════════════════════════════════════════════════════ */
/* Centered Submit on top, discreet Back text-link beneath.
   Mirrors the reference's primary-action emphasis and de-emphasizes
   navigation noise. Keeps both centered as a vertical stack. */
#moonform-root .moonform .form-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
#moonform-root .moonform .form-nav .btn-submit {
  order: 0;
}
#moonform-root .moonform .form-nav .btn-back {
  order: 1;
}
#moonform-root .moonform .btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  background: var(--fushia);
  color: var(--white);
  border: 0;
  border-radius: 100px;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: 0 12px 24px -8px rgba(231,33,104,0.4);
  transition: transform var(--transition), box-shadow var(--transition);
  min-width: 200px;
  position: relative;
}
#moonform-root .moonform .btn-submit:not([disabled]):hover {
  transform: scale(1.02);
  box-shadow: 0 16px 32px -8px rgba(231,33,104,0.55);
}
#moonform-root .moonform .btn-submit[disabled] {
  background: var(--border-strong);
  box-shadow: none;
  cursor: not-allowed;
}

/* Back: discreet text-link button. Centered below the step content
   when standalone (auto-advance steps), inline-left in form-nav. */
#moonform-root .moonform .btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 8px 12px;
  cursor: pointer;
  margin: 18px auto 0;
  transition: color var(--transition);
}
#moonform-root .moonform .btn-back:hover { color: var(--navy); }
/* When btn-back is the lone child below choices, center it. */
#moonform-root .moonform .step > .btn-back {
  display: flex;
  margin-left: auto;
  margin-right: auto;
}
/* Inside form-nav, left-align */
#moonform-root .moonform .form-nav .btn-back { margin: 0; }

/* Spinner inside submit */
#moonform-root .moonform .spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: moonformSpin 0.8s linear infinite;
}
@keyframes moonformSpin { to { transform: rotate(360deg); } }

/* Test buttons — hidden until Konami */
#moonform-root .moonform .btn-test {
  display: none;
  margin-top: 12px;
  padding: 5px 12px;
  font-size: 11px;
  font-family: monospace;
  background: #f5f5f5;
  border: 1px dashed #aaa;
  border-radius: 6px;
  color: #888;
  cursor: pointer;
  width: 100%;
}
#moonform-root .moonform .btn-test:hover { background: #ebebeb; color: #555; }

/* ═══════════════════════════════════════════════════════════════
   THANK YOU
   ═══════════════════════════════════════════════════════════════ */
#moonform-root .moonform #step-thankyou {
  text-align: center;
  padding: 16px 0;
  max-width: 520px;
  margin: 0 auto;
}
#moonform-root .moonform .ty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--navy-pale);
  display: grid;
  place-items: center;
}
#moonform-root .moonform .ty-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.25;
}
#moonform-root .moonform .ty-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 16px;
}
#moonform-root .moonform .ty-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--pink-pale);
  border: 1px solid var(--pink);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 auto;
  max-width: 420px;
}
#moonform-root .moonform .ty-badge-body {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  text-align: left;
  line-height: 1.4;
}
#moonform-root .moonform .ty-badge-stat {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--fushia);
  letter-spacing: -0.2px;
}

/* ═══════════════════════════════════════════════════════════════
   EMBED CONTAINER (overrides any default)
   ═══════════════════════════════════════════════════════════════ */
#moonform-root {
  display: block;
  width: 100%;
}
#moonform-root .moonform.form-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE TIGHTENING
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 599px) {
  #moonform-root .moonform .form-title {
    font-size: 28px;
    margin-bottom: 44px;
    padding: 0;             /* edge-to-edge mobile — let the text breathe */
    line-height: 1.3;
  }
  #moonform-root .moonform .choice-icon svg { width: 36px; height: 36px; }
  #moonform-root .moonform .form-progress {
    gap: 8px;
    margin-bottom: 24px;
  }
  #moonform-root .moonform .form-progress-segment .label { font-size: 12px; }
  #moonform-root .moonform .choices.choices-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  #moonform-root .moonform .choice-card { padding: 16px 10px; min-height: 92px; }
  #moonform-root .moonform .choice-card .choice-label { font-size: 14px; }
  #moonform-root .moonform .choice-card-row { padding: 14px 14px; }
  #moonform-root .moonform .choice-card-row .choice-label { font-size: 15px; }
  #moonform-root .moonform .input-arrow { width: 36px; height: 36px; right: 6px; }
  #moonform-root .moonform .btn-submit { padding: 13px 22px; font-size: 14px; min-width: 0; }
  #moonform-root .moonform .form-nav .btn-back { padding: 6px 8px; font-size: 12px; }
}
