/* Forms — what visitors see: the form page, website blocks, the confirmation page and the member app.
   Uses the church website's tokens (--ws-*) when present, else the app tokens, so every theme and the app look right. */
.fmp, .fm-embed, .fm-listsec {
  --fm-ink: var(--ws-ink, var(--ink, #0b1224)); --fm-ink-2: var(--ws-ink-2, var(--ink-2, #28324a)); --fm-muted: var(--ws-muted, var(--muted, #5b6480));
  --fm-line: var(--ws-line, var(--border, rgba(11,18,36,.08))); --fm-line-strong: var(--ws-line-strong, var(--border-strong, rgba(11,18,36,.14)));
  --fm-surface: var(--ws-surface, var(--surface, #fff)); --fm-surface-2: var(--ws-surface-2, var(--surface-2, #f9fafc));
  --fm-radius: var(--ws-radius, 14px); --fm-radius-sm: var(--ws-input-radius, 10px);
  --fm-primary: var(--primary, #4f46e5); --fm-soft: var(--primary-soft, #eef0ff); --fm-soft-ink: var(--ws-primary-soft-ink, var(--primary-ink, #3730a3));
  --fm-input-line: var(--ws-input-line, var(--input-border, #7c859f)); --fm-danger: #c42b2b; --fm-danger-soft: #fdeeee;
  --fm-font-h: var(--ws-font-h, inherit);
  color: var(--fm-ink);
}
.fmp { max-width: 720px; margin: 0 auto; }
.fmp.fmp-wide { max-width: 960px; }

/* Header */
.fmp-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 18px; border-radius: var(--fm-radius-sm); background: #fff4dc; color: #7a3e06; font-size: 14px; }
.fmp-banner a { margin-left: auto; font-weight: 600; color: inherit; text-decoration: underline; }
.fmp-cover { border-radius: var(--ws-img-radius, var(--fm-radius)); overflow: hidden; aspect-ratio: 21 / 8; margin-bottom: 24px; background: var(--fm-surface-2); }
.fmp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fmp-head { margin-bottom: 24px; }
.fmp-kicker { margin: 0 0 8px; color: var(--fm-soft-ink); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.fmp .fmp-title, .ws-module-page .fmp .fmp-title { margin: 0 0 12px; font-family: var(--fm-font-h); font-size: clamp(28px, 4.2vw, 42px); line-height: 1.12; letter-spacing: -.02em; color: var(--fm-ink); }
.fmp-intro { font-size: 17px; line-height: 1.65; color: var(--fm-ink-2); max-width: 62ch; margin: 0; }
.fmp-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.fmp-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--fm-surface-2); border: 1px solid var(--fm-line); color: var(--fm-ink-2); font-size: 13.5px; font-weight: 500; }
.fmp-meta span.is-hot { background: #fff4dc; border-color: rgba(180,83,9,.2); color: #8a4308; }
.fmp-card { background: var(--fm-surface); border: 1px solid var(--fm-line); border-radius: var(--fm-radius); box-shadow: 0 1px 2px rgba(11,18,36,.04), 0 18px 40px -28px rgba(11,18,36,.25); padding: clamp(20px, 4vw, 36px); }
.fmp-hello { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 10px 12px; border-radius: var(--fm-radius-sm); background: var(--fm-soft); color: var(--fm-soft-ink); font-size: 14px; }
.fmp-privacy { display: flex; align-items: flex-start; gap: 8px; justify-content: center; margin: 18px 0 0; color: var(--fm-muted); font-size: 13px; text-align: center; }
.fmp-privacy .icon { margin-top: 2px; flex-shrink: 0; }
.fmc-list + .fmp-privacy, .fmp-empty + .fmp-privacy { margin-top: 28px; }

/* Closed / empty */
.fmp-closed, .fmp-empty { text-align: center; padding: 16px 8px; }
.fmp-closed h2, .fmp-empty h2 { font-family: var(--fm-font-h); font-size: 22px; margin: 12px 0 6px; }
.fmp-closed p, .fmp-empty p { color: var(--fm-muted); margin: 0 auto 16px; max-width: 46ch; }
.fmp-closed-icon { width: 52px; height: 52px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--fm-surface-2); color: var(--fm-muted); border: 1px solid var(--fm-line); }

/* ── The form ─────────────────────────────────────────────── */
.fm-form { margin: 0; }
.fm-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 22px; border-radius: var(--fm-radius-sm); background: var(--fm-danger-soft); color: var(--fm-danger); font-size: 15px; font-weight: 500; outline: none; }
.fm-alert .icon { margin-top: 2px; flex-shrink: 0; }
.fm-alert-info { background: var(--fm-soft); color: var(--fm-soft-ink); }
.fm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
.fm-grid > * { grid-column: 1 / -1; min-width: 0; }
.fm-grid > .fm-half { grid-column: auto; }
.fm-section { padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--fm-line); }
.fm-grid > .fm-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.fm-section-title { font-family: var(--fm-font-h); font-size: 20px; letter-spacing: -.01em; margin: 0; color: var(--fm-ink); }
.fm-section-help { margin: 6px 0 0; color: var(--fm-muted); font-size: 15px; line-height: 1.55; }
fieldset.fm-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.fm-label { display: block; margin: 0 0 8px; padding: 0; font-size: 15.5px; font-weight: 600; line-height: 1.4; color: var(--fm-ink); }
.fm-req { color: var(--fm-danger); font-weight: 700; }
.fm-help { margin: -4px 0 10px; color: var(--fm-muted); font-size: 14px; line-height: 1.5; }
.fm-hint { margin: -2px 0 10px; color: var(--fm-muted); font-size: 13.5px; }
.fm-field .input { width: 100%; font-size: 16px; }
.fm-field textarea.input { min-height: 120px; padding-top: 10px; line-height: 1.55; resize: vertical; }
.fm-field select.input { cursor: pointer; }
.fm-error { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--fm-danger); font-size: 14px; font-weight: 500; }
.fm-field.has-error .input { border-color: var(--fm-danger); box-shadow: 0 0 0 3px rgba(196,43,43,.12); }
.fm-appear { animation: fm-in .3s var(--ws-ease, ease-out); }
@keyframes fm-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Choices */
.fm-options { display: grid; gap: 8px; }
.fm-options-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fm-option { position: relative; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 12px 14px; border: 1px solid var(--fm-line-strong); border-radius: var(--fm-radius-sm); background: var(--fm-surface); cursor: pointer; font-size: 15.5px; line-height: 1.4; color: var(--fm-ink); transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.fm-option:hover { border-color: color-mix(in srgb, var(--fm-primary) 45%, transparent); }
.fm-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.fm-option-ui { width: 20px; height: 20px; flex-shrink: 0; border: 2px solid var(--fm-input-line); border-radius: 50%; background: #fff; display: grid; place-items: center; transition: border-color .15s ease, background-color .15s ease; }
.fm-option input[type=checkbox] + .fm-option-ui { border-radius: 6px; }
.fm-option input:checked + .fm-option-ui { border-color: var(--fm-primary); background: var(--fm-primary); }
.fm-option input[type=radio]:checked + .fm-option-ui::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.fm-option input[type=checkbox]:checked + .fm-option-ui::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.fm-option:has(input:checked) { border-color: var(--fm-primary); background: var(--fm-soft); box-shadow: inset 0 0 0 1px var(--fm-primary); }
.fm-option input:focus-visible + .fm-option-ui { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fm-primary) 30%, transparent); }
.fm-option-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fm-tick { align-items: flex-start; border-style: solid; }
.fm-tick .fm-option-ui { margin-top: 1px; }
.fm-field.has-error .fm-option { border-color: rgba(196,43,43,.45); }

/* File */
.fm-drop { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed var(--fm-line-strong); border-radius: var(--fm-radius-sm); background: var(--fm-surface-2); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; position: relative; }
.fm-drop:hover, .fm-drop:focus-within { border-color: var(--fm-primary); background: var(--fm-soft); }
.fm-drop-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.fm-drop-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--fm-surface); color: var(--fm-primary); border: 1px solid var(--fm-line); flex-shrink: 0; }
.fm-drop-text { display: flex; flex-direction: column; min-width: 0; }
.fm-drop-text strong { font-size: 15px; color: var(--fm-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-drop-hint { color: var(--fm-muted); font-size: 13px; }
.fm-drop.has-file { border-style: solid; border-color: var(--fm-primary); background: var(--fm-soft); }
.fm-field.has-error .fm-drop { border-color: var(--fm-danger); }

/* Address */
.fm-address { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fm-sub { min-width: 0; }
.fm-sub-full { grid-column: 1 / -1; }
.fm-sublabel { display: block; margin-bottom: 5px; color: var(--fm-muted); font-size: 13.5px; font-weight: 500; }

/* Payment */
.fm-pay { margin-top: 26px; padding: 18px; border-radius: var(--fm-radius-sm); background: var(--fm-surface-2); border: 1px solid var(--fm-line); }
.fm-pay-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 16px; }
.fm-pay-row strong { font-size: 22px; letter-spacing: -.02em; }
.fm-pay-note { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; color: var(--fm-muted); font-size: 13.5px; }
.fm-amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.fm-amount { position: relative; cursor: pointer; }
.fm-amount input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fm-amount span { display: grid; place-items: center; min-height: 48px; padding: 8px; border: 1px solid var(--fm-line-strong); border-radius: var(--fm-radius-sm); background: var(--fm-surface); font-weight: 700; font-size: 16px; transition: border-color .15s ease, background-color .15s ease; }
.fm-amount input:checked + span { border-color: var(--fm-primary); background: var(--fm-primary); color: var(--ws-on-primary, #fff); }
.fm-amount input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fm-primary) 30%, transparent); }
.fm-money { display: flex; align-items: stretch; }
.fm-money span { display: grid; place-items: center; min-width: 46px; padding: 0 10px; border: 1px solid var(--ws-input-border, var(--border-strong)); border-right: 0; border-radius: var(--fm-radius-sm) 0 0 var(--fm-radius-sm); background: var(--fm-surface); font-weight: 600; color: var(--fm-muted); }
.fm-money .input { border-radius: 0 var(--fm-radius-sm) var(--fm-radius-sm) 0 !important; font-size: 18px; font-weight: 600; }

/* Submit */
.fm-submit-row { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 28px; }
.fm-submit { min-width: 220px; justify-content: center; gap: 10px; }
.fm-submit .icon { transition: transform .15s ease; }
.fm-submit:hover .icon { transform: translateX(3px); }
.fm-submit.is-busy { opacity: .75; pointer-events: none; }
.fm-submit.is-busy .icon { animation: fm-nudge .8s ease-in-out infinite; }
@keyframes fm-nudge { 50% { transform: translateX(4px); } }
.fm-fine { margin: 0; color: var(--fm-muted); font-size: 13px; }

/* ── Confirmation page ───────────────────────────────────── */
.fmp-done-card { text-align: center; padding-top: clamp(28px, 5vw, 48px); padding-bottom: clamp(28px, 5vw, 44px); }
.fmp-done-icon { width: 68px; height: 68px; border-radius: 50%; display: inline-grid; place-items: center; background: #e5f6ec; color: #15803d; box-shadow: 0 0 0 10px rgba(21,128,61,.06); animation: fm-pop .45s cubic-bezier(.2,.8,.2,1.2); }
.fmp-done-icon.is-wait { background: #fff4dc; color: #b45309; box-shadow: 0 0 0 10px rgba(180,83,9,.06); }
.fmp-done-icon.is-off { background: var(--fm-surface-2); color: var(--fm-muted); box-shadow: none; }
@keyframes fm-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.fmp-done-card h1, .ws-module-page .fmp-done-card h1 { font-family: var(--fm-font-h); font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; margin: 22px 0 10px; letter-spacing: -.02em; }
.fmp-lead { font-size: 17px; line-height: 1.6; color: var(--fm-ink-2); max-width: 50ch; margin: 0 auto 18px; }
.fmp-note { color: var(--fm-muted); font-size: 14px; margin: 10px auto 0; max-width: 50ch; }
.fmp-pay-again { margin: 8px 0 0; }
.fmp-receipt { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px; margin: 6px auto 12px; padding: 14px 18px; max-width: 460px; border-radius: var(--fm-radius-sm); background: var(--fm-surface-2); border: 1px solid var(--fm-line); }
.fmp-receipt div { display: flex; flex-direction: column; gap: 2px; }
.fmp-receipt span { color: var(--fm-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.fmp-receipt strong { font-size: 16px; }
.fmp-yours { margin: 22px auto 0; max-width: 520px; text-align: left; border: 1px solid var(--fm-line); border-radius: var(--fm-radius-sm); }
.fmp-yours summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.fmp-yours dl { margin: 0; padding: 4px 16px 14px; display: grid; gap: 2px 0; }
.fmp-yours dt { color: var(--fm-muted); font-size: 13px; margin-top: 10px; }
.fmp-yours dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.fmp-done-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* ── Lists of forms (Forms page, website block) ──────────── */
.fmc-list { display: grid; gap: 12px; }
.fmc-list.is-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fmc { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--fm-line); border-radius: var(--fm-radius); background: var(--fm-surface); color: var(--fm-ink); text-decoration: none; box-shadow: 0 1px 2px rgba(11,18,36,.04); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.fmc:hover { text-decoration: none; border-color: var(--fm-line-strong); box-shadow: 0 16px 36px -22px rgba(11,18,36,.3); transform: translateY(-1px); }
.fmc-tile { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; background: var(--fm-soft); color: var(--fm-soft-ink); }
.fmc-tile.fm-tone-blue { background: #e8f0ff; color: #1d4ed8; }
.fmc-tile.fm-tone-purple { background: #f1ebff; color: #6d28d9; }
.fmc-tile.fm-tone-green { background: #e5f6ec; color: #15803d; }
.fmc-tile.fm-tone-amber { background: #fff3da; color: #b45309; }
.fmc-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.fmc-title { font-family: var(--fm-font-h); font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.fmc-intro { color: var(--fm-ink-2); font-size: 14.5px; line-height: 1.5; }
.fmc-meta { color: var(--fm-muted); font-size: 13px; }
.fmc-go { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 8px 14px; border-radius: var(--ws-btn-radius, 999px); background: var(--fm-primary); color: var(--ws-on-primary, #fff); font-size: 14px; font-weight: 600; }
.fmc.is-full { opacity: .7; }
.fmc.is-full .fmc-go { background: var(--fm-surface-2); color: var(--fm-muted); }
.fmc-list.is-grid .fmc { flex-direction: column; align-items: stretch; gap: 14px; }
.fmc-list.is-grid .fmc-body { flex: 1; }
.fmc-list.is-grid .fmc-go { align-self: flex-start; margin-left: 0 !important; }

/* ── Website blocks ─────────────────────────────────────── */
.fm-embed { max-width: 720px; margin: 0 auto; }
.fm-embed.is-wide { max-width: none; }
.fm-embed-head { margin-bottom: clamp(20px, 3vw, 32px); }
.fm-embed-head h2 { font-family: var(--fm-font-h); font-size: clamp(28px, 3.2vw, 40px); line-height: 1.15; margin: 0 0 10px; color: var(--fm-ink); }
.fm-embed-head p { color: var(--fm-ink-2); font-size: 17px; line-height: 1.6; margin: 0; max-width: 62ch; }
.fm-embed-card { background: var(--fm-surface); border: 1px solid var(--fm-line); border-radius: var(--fm-radius); padding: clamp(20px, 4vw, 36px); box-shadow: 0 18px 40px -30px rgba(11,18,36,.3); }
.fm-embed-empty { display: flex; align-items: center; gap: 12px; padding: 24px; border: 1px dashed var(--ws-input-border, #c3c7d1); border-radius: 12px; color: var(--ws-muted, #5b6480); }
.fm-embed-empty p { margin: 0; }

/* ── Member app ─────────────────────────────────────────── */
.member-app .fmp-card { padding: 20px 16px; border-radius: var(--r-lg, 14px); }
.member-app .fmp .fmp-title { font-size: 26px; }
.member-app .fmp-intro { font-size: 15.5px; }
.member-app .fm-submit { width: 100%; }
.member-app .fmp-head { margin-bottom: 18px; }

/* ── Phones ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .fm-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .fm-grid > .fm-half { grid-column: 1 / -1; }
  .fm-options-2 { grid-template-columns: minmax(0, 1fr); }
  .fm-address { grid-template-columns: minmax(0, 1fr); }
  .fm-submit { width: 100%; }
  .fm-submit-row { align-items: stretch; text-align: center; }
  .fmp-intro, .fm-embed-head p { font-size: 16px; }
  .fmc { flex-wrap: wrap; padding: 16px; }
  .fmc-go { margin-left: 62px; }
  .fmp-cover { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) { .fm-appear, .fmp-done-icon, .fm-submit.is-busy .icon { animation: none; } }
