/* ==========================================================================
   Public feedback form — the surface that has to convert.
   Mobile-first: most of these are opened from a QR code on a phone, one-handed,
   often standing up. Everything is thumb-reachable and nothing needs a swipe.

   The business is the star of this page, not us: their logo opens it, rides
   along in the header, and closes it. Our own mark only appears on the free
   tier, outside the card, as a quiet maker's badge.
   ========================================================================== */

html, body {
  height: 100%;
  overscroll-behavior: none;
  overflow-x: hidden;
}

body.fb-form {
  --brand: #D4A574;          /* overridden inline by the template */
  --surface: var(--paper);   /* whatever sits directly behind the content */
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --love: #E5484D;

  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink-2);
  font-variant-numeric: lining-nums;
}

/* A wash of the merchant's own colour behind everything, so even a plain
   form feels like it belongs to them. */
body.fb-form::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(110% 55% at 50% -12%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 62%),
    radial-gradient(70% 45% at 100% 105%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 70%);
}

/* ── Shell ───────────────────────────────────────────────────────────── */

.fb-shell {
  flex: 1 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 22px;
}

.fb-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ── Progress ────────────────────────────────────────────────────────── */

.fb-progress {
  flex: none;
  height: 4px;
  margin-top: max(14px, env(safe-area-inset-top));
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  overflow: hidden;
}
.fb-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 75%, #fff), var(--brand));
  transition: width var(--t-slow) var(--ease);
}

/* ── Compact header: identity through the questions ──────────────────── */

.fb-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 4px;
  animation: fb-fade-down var(--t-slow) var(--ease) both;
}
/* The welcome and the outcome show the logo large; no need to say it twice. */
.fb-card.is-hero .fb-head { display: none; }

.fb-biz { min-width: 0; flex: 1; }
.fb-biz-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fb-biz-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes fb-fade-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Logo tile ───────────────────────────────────────────────────────── */
/* One element, every size. Square logos fill the tile; wide and tall ones
   are shown whole on white in a tile matched to their proportions (see
   fbLogoFit in the template). No logo — or a broken one — falls back to a
   monogram in the brand colour rather than a generic placeholder. */

.fb-logo {
  --size: 40px;
  --ratio: 1;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: calc(var(--size) * .3);
  background: #fff;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(23, 21, 15, .08),
    0 2px 6px rgba(23, 21, 15, .06);
}
.fb-logo img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.fb-logo.is-loaded img { opacity: 1; }
.fb-logo.is-contain img {
  object-fit: contain;
  padding: calc(var(--size) * .13) calc(var(--size) * .16);
}
.fb-logo.is-wide {
  width: calc(var(--size) * var(--ratio));
  border-radius: calc(var(--size) * .26);
}

.fb-logo-mono {
  display: none;
  grid-area: 1 / 1;
  font-family: var(--serif);
  font-size: calc(var(--size) * .54);
  font-weight: 600;
  line-height: 1;
  color: var(--brand-ink);
  transform: translateY(-.03em);
}
.fb-logo.is-mono {
  background:
    radial-gradient(120% 120% at 28% 18%,
      color-mix(in srgb, var(--brand) 62%, #fff) 0%,
      var(--brand) 48%,
      var(--brand-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 0 0 1px color-mix(in srgb, var(--brand-deep) 35%, transparent),
    0 2px 6px rgba(23, 21, 15, .08);
}
.fb-logo.is-mono .fb-logo-mono { display: block; }
.fb-logo.is-mono img { display: none; }

/* The large version, for the welcome and the finish. */
.fb-logo--hero {
  --size: 84px;
  box-shadow:
    0 0 0 1px rgba(23, 21, 15, .06),
    0 2px 4px rgba(23, 21, 15, .05),
    0 14px 34px -8px color-mix(in srgb, var(--brand-deep) 38%, transparent);
}
.fb-logo--hero.is-mono {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    0 0 0 1px color-mix(in srgb, var(--brand-deep) 30%, transparent),
    0 14px 34px -8px color-mix(in srgb, var(--brand-deep) 55%, transparent);
}

/* Logo + soft halo + optional corner badge. */
.fb-mark {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  animation: fb-mark-in .6s var(--spring) both;
}
.fb-mark::before {
  content: '';
  position: absolute;
  inset: -30px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 30%, transparent), transparent);
  animation: fb-halo 3.6s ease-in-out infinite;
}

.fb-mark-badge {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 0 0 3px var(--surface), 0 6px 14px rgba(23, 21, 15, .18);
  animation: fb-badge-in .5s .28s var(--spring) both;
}
.fb-mark-badge svg { width: 16px; height: 16px; }
.fb-mark-badge.is-love { background: var(--love); color: #fff; }
.fb-mark-badge.is-good { background: var(--good); color: #fff; }
.fb-mark-badge.is-care { background: var(--info); color: #fff; }

/* A one-off burst of confetti from behind the logo, for the happy path. */
.fb-burst {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.fb-burst i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0;
  animation: fb-burst 1s .3s var(--ease) both;
}
.fb-burst i:nth-child(3n+1) { background: #F5B83D; width: 5px; height: 5px; margin: -2.5px; }
.fb-burst i:nth-child(3n+2) { background: var(--love); width: 5px; height: 5px; margin: -2.5px; border-radius: 1px; }

@keyframes fb-mark-in {
  from { opacity: 0; transform: scale(.82); }
  to   { opacity: 1; transform: none; }
}
@keyframes fb-halo {
  0%, 100% { opacity: .75; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.07); }
}
@keyframes fb-badge-in {
  from { opacity: 0; transform: scale(0) rotate(-30deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes fb-burst {
  0%   { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(.3); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-96px) scale(1); }
}

/* ── Stage: one question at a time ───────────────────────────────────── */

.fb-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* Centred, but with extra padding underneath so the optical centre sits
     above the true one — content parked dead-centre reads as sunken. */
  justify-content: center;
  position: relative;
  padding: clamp(18px, 3vh, 32px) 0 clamp(40px, 13vh, 130px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  /* Still scrolls by touch, wheel and keyboard — just no grey bar inside a
     card that is designed to fit. */
  scrollbar-width: none;
}
.fb-stage::-webkit-scrollbar { display: none; }
/* A long question with many options must not be centre-clipped. */
.fb-stage > .fb-screen.is-active { margin-block: auto; }

.fb-screen { display: none; }
.fb-screen.is-active { display: block; animation: fb-screen-in var(--t-slow) var(--ease) both; }
.fb-screen.is-back   { animation-name: fb-screen-in-back; }

@keyframes fb-screen-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fb-screen-in-back {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Welcome and outcome screens are moments, so they're centred. Question
   screens in between read top-to-bottom like a form. */
.fb-screen.is-centered { text-align: center; }
.fb-screen.is-centered .fb-q-help { max-width: 400px; margin-inline: auto; }
.fb-screen.is-centered .fb-stars,
.fb-screen.is-centered .fb-emojis,
.fb-screen.is-centered .fb-scale,
.fb-screen.is-centered .fb-yesno { margin-inline: auto; }
.fb-screen.is-centered .fb-choice { text-align: left; }

/* ── Welcome ─────────────────────────────────────────────────────────── */

.fb-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 26px;
}
.fb-intro .fb-mark { margin-bottom: 18px; }
.fb-intro-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.3;
  text-wrap: balance;
}
.fb-intro-sub {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.4;
  text-wrap: balance;
}

/* ── Question type ───────────────────────────────────────────────────── */

.fb-q-index {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 12px;
}
.fb-q-index .req { color: var(--bad); margin-left: 4px; }

.fb-q-title {
  font-family: var(--serif);
  font-size: clamp(30px, 7.6vw, 42px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 10px;
  text-wrap: balance;
}

.fb-q-help {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-bottom: 4px;
  text-wrap: pretty;
}

.fb-q-body { margin-top: 26px; }

/* ── Trust chips ─────────────────────────────────────────────────────── */

.fb-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
  animation: fb-screen-in var(--t-slow) .15s var(--ease) both;
}
.fb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-3);
}
.fb-chip svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--brand-deep);
}

/* ── Stars ───────────────────────────────────────────────────────────── */

.fb-stars {
  display: flex;
  gap: clamp(4px, 2vw, 10px);
  justify-content: space-between;
  max-width: 360px;
}
.fb-star {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1;
  max-width: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: #DDD5C7;
  transition:
    transform .22s var(--spring),
    color .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.fb-star svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: filter .25s var(--ease);
}
.fb-star.is-lit {
  color: var(--brand);
  /* Lights ripple left to right, the way a thumb sweeps. */
  transition-delay: 0s, calc(var(--i, 0) * 28ms);
}
.fb-star.is-lit svg {
  filter: drop-shadow(0 5px 10px color-mix(in srgb, var(--brand) 38%, transparent));
}
@media (hover: hover) {
  .fb-star:hover { transform: scale(1.12) rotate(-5deg); }
}
.fb-star:active { transform: scale(.9); }
.fb-star.is-picked { animation: fb-pop .38s var(--spring); }

@keyframes fb-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.24) rotate(-6deg); }
  100% { transform: scale(1); }
}

.fb-scale-caption {
  margin-top: 14px;
  min-height: 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.fb-scale-caption.show { opacity: 1; transform: translateY(0); }

.fb-scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
}

/* ── Emoji scale ─────────────────────────────────────────────────────── */

.fb-emojis {
  display: flex;
  gap: clamp(6px, 2.5vw, 12px);
  max-width: 400px;
}
.fb-emoji {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1;
  max-width: 72px;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1.5px solid var(--line);
  font-size: clamp(26px, 7.4vw, 34px);
  line-height: 1;
  filter: saturate(.35);
  opacity: .82;
  transition:
    transform .22s var(--spring),
    filter var(--t-base) var(--ease),
    opacity var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease),
    background var(--t-base) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .fb-emoji:hover { filter: none; opacity: 1; transform: translateY(-3px); border-color: var(--brand-line); }
}
.fb-emoji:active { transform: scale(.94); }
.fb-emoji.is-picked {
  filter: none;
  opacity: 1;
  border-color: var(--brand);
  background: var(--brand-wash);
  transform: scale(1.08);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent);
}

/* ── NPS 0–10 ────────────────────────────────────────────────────────── */

.fb-nps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(5px, 1.8vw, 8px);
}
.fb-nps-btn {
  min-width: 0;
  aspect-ratio: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: clamp(14px, 4.2vw, 16px);
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  transition: all var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .fb-nps-btn:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-2px); }
}
.fb-nps-btn.is-picked {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  transform: scale(1.06);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 34%, transparent);
}

/* ── Linear scale ────────────────────────────────────────────────────── */

.fb-scale {
  display: flex;
  gap: clamp(4px, 1.6vw, 8px);
}
.fb-scale-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 56px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .fb-scale-btn:hover { border-color: var(--brand); transform: translateY(-2px); }
}
.fb-scale-btn.is-picked {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 34%, transparent);
}

/* ── Choice rows ─────────────────────────────────────────────────────── */

.fb-choices { display: flex; flex-direction: column; gap: 10px; }

.fb-choice {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 58px;
  padding: 13px 16px;
  text-align: left;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  box-shadow: var(--sh-xs);
  transition: all var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .fb-choice:hover { border-color: var(--brand); transform: translateX(3px); }
}
.fb-choice:active { transform: scale(.985); }
.fb-choice.is-picked {
  border-color: var(--brand);
  background: var(--brand-wash);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.fb-choice-key {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--sunken);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  transition: all var(--t-fast) var(--ease);
}
.fb-choice.is-picked .fb-choice-key {
  background: var(--brand);
  color: var(--brand-ink);
}
.fb-choice-box {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  color: transparent;
  transition: all var(--t-fast) var(--ease);
}
.fb-choice.is-picked .fb-choice-box {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.fb-choice-box svg { width: 14px; height: 14px; }

/* ── Yes / No ────────────────────────────────────────────────────────── */

.fb-yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fb-yesno .fb-choice { justify-content: center; min-height: 76px; font-size: 17px; }
@media (hover: hover) {
  .fb-yesno .fb-choice:hover { transform: translateY(-3px); }
}

/* ── Text ────────────────────────────────────────────────────────────── */

.fb-textarea, .fb-input {
  width: 100%;
  padding: 15px 17px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 16px;          /* 16px keeps iOS from zooming on focus */
  line-height: 1.55;
  color: var(--ink);
  box-shadow: var(--sh-xs);
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.fb-textarea { min-height: 148px; resize: none; }
.fb-textarea::placeholder, .fb-input::placeholder { color: var(--ink-4); }
.fb-textarea:focus, .fb-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent);
}
.fb-charcount {
  margin-top: 8px;
  text-align: right;
  font-size: 12px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

/* ── Contact step ────────────────────────────────────────────────────── */

.fb-contact-fields { display: flex; flex-direction: column; gap: 12px; }

.fb-field { position: relative; display: block; }
.fb-field .fb-input { padding-left: 48px; }
.fb-field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--ink-4);
  pointer-events: none;
  transition: color var(--t-base) var(--ease);
}
.fb-field-icon svg { width: 20px; height: 20px; }
.fb-field:focus-within .fb-field-icon { color: var(--brand-deep); }

.fb-privacy {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-3);
  text-align: left;
}
.fb-privacy b { color: var(--ink-2); font-weight: 600; }
.fb-privacy-icon {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-wash);
  box-shadow: inset 0 0 0 1px var(--brand-line);
  color: var(--brand-deep);
}
.fb-privacy-icon svg { width: 15px; height: 15px; }

/* ── Footer nav — thumb zone ─────────────────────────────────────────── */

.fb-foot {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 max(16px, env(safe-area-inset-bottom));
  animation: fb-foot-in var(--t-slow) var(--ease) both;
}
@keyframes fb-foot-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.fb-foot .fb-next { flex: 1; }
.fb-next-icon {
  width: 18px !important;
  height: 18px !important;
  transition: transform var(--t-base) var(--ease);
}
@media (hover: hover) {
  .fb-next:hover .fb-next-icon { transform: translateX(3px); }
}

.fb-back {
  width: 56px; height: 56px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  box-shadow: var(--sh-xs);
  transition: all var(--t-fast) var(--ease);
}
.fb-back:hover { color: var(--ink); border-color: var(--ink-4); }
.fb-back:active { transform: scale(.94); }
.fb-back svg { width: 20px; height: 20px; }

.fb-skip {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 14px 8px;
}
.fb-skip:hover { color: var(--ink); }

.fb-error {
  flex: none;
  padding-bottom: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--bad);
  text-align: center;
  display: none;
}
.fb-error.show { display: block; animation: fb-shake .4s var(--ease); }
@keyframes fb-shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ── Outcome screens (public review invite / recovery / thanks) ──────── */

.fb-outcome .fb-mark { margin: 8px auto 0; }
.fb-outcome .fb-q-title { margin-top: 22px; }
.fb-outcome-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 400px;
  margin: 12px auto 0;
  text-wrap: pretty;
}
.fb-outcome-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
}
.fb-outcome-actions .btn { width: 100%; max-width: 360px; }

.fb-star-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 22px;
  color: #F5B83D;
}
.fb-star-row span {
  display: block;
  width: 24px;
  height: 24px;
  animation: fb-star-in .45s calc(.35s + var(--i, 0) * 70ms) var(--spring) both;
}
.fb-star-row svg { width: 100%; height: 100%; }
.fb-star-row + .fb-q-title { margin-top: 10px; }
@keyframes fb-star-in {
  from { opacity: 0; transform: scale(.2) rotate(-40deg); }
  to   { opacity: 1; transform: none; }
}

/* The Google CTA carries the real "G" on a white disc, so it reads as a link
   out to Google rather than another step of this form. */
.fb-cta-google { gap: 12px; }
.fb-cta-google .fb-g {
  width: 28px;
  height: 28px;
  margin-left: -10px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 21, 15, .18);
}
.fb-cta-google .fb-g svg { width: 16px; height: 16px; }
.fb-cta-google { animation: fb-cta-glow 2.6s 1.2s ease-in-out infinite; }
@keyframes fb-cta-glow {
  0%, 100% { box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 34%, transparent); }
  50%      { box-shadow: 0 6px 26px color-mix(in srgb, var(--brand) 55%, transparent),
                         0 0 0 6px color-mix(in srgb, var(--brand) 12%, transparent); }
}

.fb-redirect-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.fb-redirect-note b { color: var(--ink); font-weight: 700; }

/* Incentive ("show this for 10% off") — a coupon, not a footnote. */
.fb-gift {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  margin: 24px auto 0;
  padding: 12px 16px 12px 12px;
  border-radius: var(--r-md);
  background: var(--brand-wash);
  border: 1.5px dashed var(--brand-line);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-2);
  text-align: left;
}
.fb-gift-icon {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
}
.fb-gift-icon svg { width: 19px; height: 19px; }

/* Kept for the "form unavailable" page. */
.fb-medal {
  width: 76px; height: 76px;
  margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-wash);
  color: var(--brand-deep);
  animation: fb-pop .5s var(--ease);
}
.fb-medal svg { width: 34px; height: 34px; }

/* ── Powered-by badge (free tier) ────────────────────────────────────── */

.fb-badge {
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px auto max(14px, env(safe-area-inset-bottom));
  padding: 5px 5px 5px 10px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  box-shadow: var(--sh-xs);
  font-size: 12px;
  line-height: 1;
  color: var(--ink-3);
  white-space: nowrap;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.fb-badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
  border-color: color-mix(in srgb, var(--ink) 14%, transparent);
}
.fb-badge-mark {
  width: 16px;
  height: 16px;
  flex: none;
}
.fb-badge b { color: var(--ink); font-weight: 600; }
.fb-badge-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
}
.fb-badge-cta svg {
  width: 12px;
  height: 12px;
  transition: transform var(--t-base) var(--ease);
}
.fb-badge:hover .fb-badge-cta svg { transform: translateX(2px); }

/* Small phones: drop "Powered by" before anything gets clipped. */
@media (max-width: 360px) {
  .fb-badge-by { display: none; }
}

/* The badge takes over the bottom safe-area padding on phones. */
body.has-badge .fb-foot { padding-bottom: 12px; }

/* ── Preview ribbon (owner viewing their own form) ───────────────────── */

.fb-preview-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--info-wash);
  color: var(--info);
  font-size: 12.5px;
  font-weight: 500;
  border-bottom: 1px solid #D7E4F4;
}
.fb-preview-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fb-preview-bar a {
  flex: none;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Desktop: give it a real card ────────────────────────────────────── */

@media (min-width: 720px) {
  body.fb-form::before {
    background:
      radial-gradient(900px 520px at 18% -8%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
      radial-gradient(800px 520px at 100% 110%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%);
  }
  .fb-shell {
    max-width: 640px;
    padding: 36px 24px 20px;
    justify-content: center;
  }
  .fb-card {
    --surface: var(--card);
    flex: none;
    width: 100%;
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
    border-radius: 32px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, .9) inset,
      0 40px 90px -20px rgba(35, 28, 15, .18),
      0 10px 24px rgba(35, 28, 15, .05);
    padding: 22px 48px 12px;
    min-height: min(640px, 84dvh);
    max-height: 92dvh;
  }
  .fb-progress { margin-top: 0; }
  .fb-head { padding-top: 20px; }
  .fb-stage { padding: 34px 0 30px; }
  .fb-foot { padding-bottom: 20px; }
  body.has-badge .fb-foot { padding-bottom: 20px; }
  .fb-logo--hero { --size: 92px; }
  .fb-nps { gap: 7px; grid-template-columns: repeat(11, minmax(0, 1fr)); }
  .fb-nps-btn { font-size: 14px; }
  .fb-badge { margin-top: 22px; margin-bottom: 0; }
}

/* Very short viewports (landscape phone, small iPhones with a toolbar). */
@media (max-height: 640px) {
  .fb-logo--hero { --size: 64px; }
  .fb-intro { margin-bottom: 16px; }
  .fb-intro .fb-mark { margin-bottom: 12px; }
  .fb-q-title { font-size: 27px; }
  .fb-q-body  { margin-top: 18px; }
  .fb-stage   { padding: 14px 0; }
  .fb-trust   { margin-top: 18px; }
}

/* The stage clips sideways (so slide-ins don't add a scrollbar), and a
   full-width button reaches its edge on a phone — which sliced the Google
   CTA's glow off flat on both sides. Pull the clip box out into the shell's
   gutter so the glow has room; content width is unchanged. Sits after the
   shorthand paddings above so it wins at every size. */
.fb-stage {
  margin-inline: -22px;
  padding-inline: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .fb-burst { display: none; }
  .fb-mark::before, .fb-cta-google { animation: none; }
}
