/* ============================================================
   #feedback — the pilot feedback section on the home page.

   Ten questions, one per screen (the founders' spec, 12 Nov 2026).
   Builds on /styles.css: the tokens, .form, .q, .opt, .input, .tel and
   .btn all come from there, so this file only adds the steps, the
   scales, the progress bar, the reward and the outcome panels. No
   inline styles anywhere — the CSP ships `style-src 'self'` with no
   'unsafe-inline' (the progress fill is set through the CSSOM).

   Motion: a step slides a few pixels in the direction you moved, and
   the bar eases along. Transform and opacity only, behind the motion
   query. Nothing overshoots, nothing loops.
   ============================================================ */

/* every [hidden] panel below also sets display:flex, which would otherwise win */
.fb [hidden] { display: none !important; }

.fb {
  position: relative; scroll-margin-top: 0;
  /* centred below the section's top edge, so it fades out before it reaches it */
  background: radial-gradient(64% 380px at 50% 360px, var(--sun-soft) 0%, transparent 70%) no-repeat;
}

/* the old #join anchor sits at the section's top edge */
.fb__alias { position: absolute; top: 0; left: 0; width: 1px; height: 1px; }

/* the First 100's stage, now the pilot's: a big centred head, the gold ticket, the form */
.fb__inner {
  max-width: 780px; margin: 0 auto; padding: var(--sec) var(--gut);
  display: flex; flex-direction: column; gap: 36px;
}
.fb .intro .h2 { overflow-wrap: break-word; min-width: 0; }
.fb__big {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  letter-spacing: -0.02em; color: var(--green); text-wrap: balance;
}
.fb__ticket { box-shadow: 0 24px 50px -28px var(--sun-bloom); }
.fb__ticket .ticket__cur { text-align: center; max-width: 9rem; line-height: 1.35; }
.fb__ticket .ticket__list li { align-items: flex-start; }
.fb__ticket .ticket__list .ico { margin-top: 0.3em; flex: none; }

.fb__form { gap: 28px; padding: 32px 36px 36px; }

/* ── where you are ── */
.fb__head { display: flex; flex-direction: column; gap: 10px; }
.fb__count {
  font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--green);
}
.fb__track { height: 6px; border-radius: 999px; background: var(--wash); overflow: hidden; }
.fb__fill {
  display: block; height: 100%; background: var(--green); border-radius: inherit;
  transform-origin: left center; transform: scaleX(0.09);
}
.fb__draft { font-size: 13.5px; color: var(--muted); }
.fb__link {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: var(--green); text-decoration: underline; text-underline-offset: 3px;
}
.fb__link:hover { color: var(--forest); }

/* ── a step ── */
.fb-step { display: flex; flex-direction: column; gap: 26px; }
.fb-step + .fb-step { border-top: 1px solid var(--line); padding-top: 28px; }
.fb__form.is-stepped .fb-step { border-top: 0; padding-top: 0; }
.fb__form.is-stepped .fb-step:not(.is-current) { display: none; }
.fb-step__q {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem);
  line-height: 1.25; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance;
}
.fb-step__q:focus { outline: none; }
.fb-step__aside {
  font-size: 14.5px; color: var(--body); background: var(--wash);
  border-radius: 14px; padding: 12px 16px; margin-top: -10px;
}

.fb .q__req { font-family: var(--font-body); font-size: 12px; font-weight: 600; margin-left: 4px; }
.fb .q__label--sm { line-height: 1.45; }
/* a legend sits outside the fieldset's flex gap, so it brings its own space */
.fb fieldset.q > legend { margin-bottom: 12px; }
.fb__text { min-height: 112px; }
.fb .q.is-invalid .input { border-color: var(--bad); }
.fb fieldset.q.is-invalid legend { color: var(--bad); }

/* ── scales: equal cells on one row, the ends named underneath ── */
.fb-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.fb-scale--eleven { grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; }
.fb-scale__opt span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 14px; padding: 10px 2px; text-align: center; line-height: 1.2; min-height: 52px;
}
.fb-scale__opt b {
  font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--ink);
}
.fb-scale__opt i { font-style: normal; font-size: 13px; color: var(--gold-deep); }
.fb-scale__opt input:checked + span b,
.fb-scale__opt input:checked + span i { color: var(--surface); }
.fb-scale--face .fb-scale__opt span { font-size: 12.5px; gap: 4px; }
.fb-scale--face .fb-scale__opt b { font-size: 24px; line-height: 1; }
.fb-scale__ends {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 13px; color: var(--muted); margin-top: -4px;
}
.fb-scale__ends span:last-child { text-align: right; }

/* ── the last screen ── */
.fb__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.fb__note { margin: 0; }
.fb-check { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--ink); cursor: pointer; }
.fb-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--forest); flex: none; }

/* how close the answers are to the 50% coupon */
.fb__progress {
  margin: 0; font-size: 14px; color: var(--muted);
  padding-left: 22px; position: relative;
}
.fb__progress::before {
  content: ''; position: absolute; left: 0; top: 0.42em; width: 10px; height: 10px;
  border-radius: 999px; border: 2px solid var(--gold-line);
}
.fb__progress.is-ready { color: var(--forest); font-weight: 600; }
.fb__progress.is-ready::before { background: var(--gold); border-color: var(--gold); }
.fb__progress:empty { display: none; }

/* the status line only takes space when it has something to say */
.fb .form__msg:empty { display: none; }
.fb .form__msg { text-align: left; margin-bottom: -10px; }

/* ── moving on ── */
.fb__nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb__nav .btn { font-size: 16px; padding: 15px 28px; }
.fb__next, .fb__send { margin-left: auto; min-width: 9.5rem; }
.fb__back { background: transparent; color: var(--forest); border: 1px solid var(--line); box-shadow: none; }
.fb__back:hover { border-color: var(--forest); color: var(--forest); background: transparent; }
/* without scripting every question shows at once, and only Send applies */
.fb__form:not(.is-stepped) .fb__back,
.fb__form:not(.is-stepped) .fb__next { display: none; }

/* while sending: a quieter fill and ink, and a busy cursor */
.btn[disabled] { background: var(--line); color: var(--muted); box-shadow: none; cursor: progress; filter: none; transform: none; }

/* the failure panel: plain, not alarming, and always offers a way out */
.fb__fail {
  border: 1px solid var(--bad-line); background: var(--bad-wash); border-radius: 16px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px;
  font-size: 15px; color: var(--ink);
}
.fb__fail-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--bad); }
.fb__fail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.fb__retry { font-size: 15px; padding: 12px 22px; }
.fb__mail { font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }

.fb__done {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 40px 36px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 12px 40px var(--lift-soft);
}
.fb__done:focus { outline: none; }
.fb__done-ico {
  width: 44px; height: 44px; padding: 10px; border-radius: 999px;
  background: var(--wash); color: var(--green); stroke-width: 2.5;
}
.fb__done-title { font-weight: 800; font-size: 24px; line-height: 1.25; color: var(--ink); }
/* the thank-you heart: Frescoo's gold, lime and green in one */
.fb__heart { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.16em; margin-left: 0.1em; }
.fb__heart-a { stop-color: var(--gold); }
.fb__heart-b { stop-color: var(--lime); }
.fb__heart-c { stop-color: var(--green); }

/* the coupon itself: a gold ticket with the code big enough to read out */
.fb__coupon {
  margin: 8px 0 4px; border: 1.5px dashed var(--gold-deep); background: var(--gold-pale);
  border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 20px 44px -24px var(--sun-bloom);
}
.fb__coupon-amt {
  font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1;
  letter-spacing: -0.03em; color: var(--forest);
}
.fb__coupon-code { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.fb__coupon-code span { font-size: 13px; color: var(--muted); }
.fb__coupon-code b {
  font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: 0.06em;
  color: var(--ink); user-select: all; overflow-wrap: anywhere;
}
.fb__coupon-note { font-size: 14.5px; color: var(--body); }
.fb__done-more { color: var(--ink); }
.fb__done-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 6px; }
.fb__fix { font-size: 15px; padding: 12px 22px; }

/* ── the corner button: always one tap from the form ── */
.fb-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--forest); color: var(--on-dark); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  /* the hairline ring keeps its edge on the night-green journey section */
  box-shadow: 0 12px 30px var(--lift-float), 0 0 0 1px var(--ring-dark);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0s linear 0s;
}
.fb-fab:hover { background: var(--forest-hi); color: var(--on-dark); }
.fb-fab__short { display: none; }
.fb-fab .cash { font-size: 13px; padding: 5px 9px; border-radius: 999px; }
.fb-fab.is-away {
  opacity: 0; transform: translateY(14px); visibility: hidden; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0s linear 0.3s;
}

@media (prefers-reduced-motion: no-preference) {
  .fb__fail:not([hidden]), .fb__done:not([hidden]) { animation: fb-fade 0.32s ease-out both; }
  .fb__fill { transition: transform 0.5s var(--ease-out); }
  .fb__form.is-stepped .fb-step.is-current { animation: fb-step-in 0.38s var(--ease-out) both; }
  .fb__form.is-stepped[data-dir="back"] .fb-step.is-current { animation-name: fb-step-back; }
}
@keyframes fb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fb-step-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes fb-step-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .fb__inner { gap: 24px; }
  .fb__ticket .ticket__cur { max-width: none; text-align: left; }
  .fb__form { padding: 22px 16px 24px; gap: 22px; }
  .fb-step { gap: 22px; }
  .fb__pair { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .fb-scale { gap: 6px; }
  .fb-scale--eleven { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .fb-scale__opt span { padding: 9px 2px; }
  .fb-scale--face .fb-scale__opt span { font-size: 11.5px; }
  .fb__nav .btn { padding: 14px 20px; }
  .fb__next, .fb__send { flex: 1; }
  .fb__done { padding: 28px 20px; }
  .fb__retry { width: 100%; }
  .fb__coupon { padding: 16px 18px; }
  .fb__coupon-amt { font-size: 28px; }
  .fb__fix { width: 100%; }
  /* on a phone the button is a small label, clear of the home bar */
  .fb-fab {
    right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 8px; padding: 6px 6px 6px 14px; font-size: 13px; min-height: 44px;
  }
  .fb-fab .cash { font-size: 12px; padding: 4px 8px; }
  .fb-fab__long { display: none; }
  .fb-fab__short { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .fb-fab, .fb-fab.is-away { transition: none; transform: none; }
}

/* styles.css gives .opt span a 44px floor on touch screens; scale cells stack */
@media (pointer: coarse) {
  .fb-scale__opt span { min-height: 56px; }
}
