/* Forms by Foxco - front-end styles
 * Scoped under .fbf-form so it will not leak into the host theme.
 * Accent colors come from the preset, injected inline as --fbf-accent /
 * --fbf-accent-ink / --fbf-accent-soft on the .fbf-form container.
 */

.fbf-form{
  /* fallbacks match the Dr Guberman preset */
  --fbf-accent:#2c79c0;
  --fbf-accent-ink:#ffffff;
  --fbf-accent-soft:#e2eefb;
  --fbf-bg:#ffffff;
  --fbf-surface:#f6f8fb;
  --fbf-fg:#1a2230;
  --fbf-muted:#5b6675;
  --fbf-line:#dde3ec;
  --fbf-radius:14px;
  --fbf-good:#2e9d6f;
  --fbf-warn:#d9911f;
  --fbf-bad:#d1495b;
  /* 0-3 severity scale (green -> red) */
  --fbf-p0:#4f9d7a;
  --fbf-p1:#d1a52b;
  --fbf-p2:#dd7a33;
  --fbf-p3:#cf4a52;
  max-width:760px;margin:0 auto;color:var(--fbf-fg);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  line-height:1.5;
}
.fbf-form *{box-sizing:border-box}

/* progress header */
.fbf-head{position:sticky;top:0;z-index:5;background:var(--fbf-bg);padding:12px 0;border-bottom:1px solid var(--fbf-line)}
.fbf-progress{height:5px;background:var(--fbf-surface);border-radius:99px;overflow:hidden}
.fbf-bar{height:100%;width:0;background:var(--fbf-accent);transition:width .35s ease}
.fbf-meta{display:flex;justify-content:space-between;font-size:11.5px;color:var(--fbf-muted);margin-top:8px;letter-spacing:.02em}

/* steps */
.fbf-step{padding:18px 0 8px}
.fbf-eyebrow{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--fbf-accent);font-weight:700;margin:0}
.fbf-step h2{font-size:24px;margin:6px 0 0;font-weight:600;line-height:1.2}
.fbf-lede{color:var(--fbf-muted);margin:8px 0 0;max-width:60ch}

.fbf-card{background:var(--fbf-bg);border:1px solid var(--fbf-line);border-radius:var(--fbf-radius);
  box-shadow:0 1px 2px rgba(16,32,58,.05),0 6px 18px rgba(16,32,58,.05);padding:18px;margin-top:16px}
.fbf-cathead{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.fbf-cathead h3{font-size:18px;margin:0;font-weight:600}
.fbf-catscore{font-variant-numeric:tabular-nums;font-size:12.5px;color:var(--fbf-muted);font-weight:700;white-space:nowrap}
.fbf-catnote{color:var(--fbf-muted);font-size:12.5px;margin:2px 0 6px}

/* fields */
.fbf-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.fbf-field{margin-top:14px}
.fbf-field:first-child{margin-top:0}
.fbf-form label.fbf-l{display:block;font-size:13px;font-weight:600;margin-bottom:6px}
.fbf-req{color:var(--fbf-bad)}
.fbf-form input[type=text],.fbf-form input[type=email],.fbf-form input[type=tel],
.fbf-form input[type=date],.fbf-form textarea{
  width:100%;font:inherit;font-size:14px;color:var(--fbf-fg);background:var(--fbf-surface);
  border:1px solid var(--fbf-line);border-radius:10px;padding:11px 12px}
.fbf-form textarea{min-height:90px;resize:vertical}
.fbf-form input:focus,.fbf-form textarea:focus{outline:2px solid var(--fbf-accent);outline-offset:1px;border-color:transparent}

/* choice + yes/no buttons */
.fbf-choice{display:flex;gap:8px;flex-wrap:wrap}
.fbf-choice button{font:inherit;font-weight:600;padding:10px 20px;border-radius:10px;border:1px solid var(--fbf-line);
  background:var(--fbf-surface);color:var(--fbf-fg);cursor:pointer}
.fbf-choice button[aria-pressed="true"]{background:var(--fbf-accent);border-color:var(--fbf-accent);color:var(--fbf-accent-ink)}

/* likert: four tap pills per row, graded by severity */
.fbf-rows{display:flex;flex-direction:column}
.fbf-qrow{padding:14px 0;border-top:1px solid var(--fbf-line)}
.fbf-qrow:first-child{border-top:0}
.fbf-qlabel{margin:0 0 10px;font-size:14.5px;line-height:1.45}
.fbf-pills{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.fbf-pill{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  min-height:54px;padding:8px 4px;border:1.5px solid var(--fbf-line);border-radius:12px;background:var(--fbf-bg);
  color:var(--fbf-muted);cursor:pointer;font:inherit;line-height:1;
  transition:transform .06s ease,border-color .15s ease,background .15s ease,box-shadow .15s ease}
.fbf-pill b{font-size:19px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--fbf-fg)}
.fbf-pill small{font-size:9.5px;letter-spacing:.04em;text-transform:uppercase;opacity:.75}
.fbf-pill:hover{border-color:var(--fbf-accent)}
.fbf-pill:active{transform:scale(.95)}
.fbf-pill:focus-visible{outline:2px solid var(--fbf-accent);outline-offset:2px}
.fbf-pill[aria-pressed="true"]{color:#fff;border-color:transparent;box-shadow:0 4px 12px rgba(16,32,58,.14)}
.fbf-pill[aria-pressed="true"] b{color:#fff}
.fbf-pill.p0[aria-pressed="true"]{background:var(--fbf-p0)}
.fbf-pill.p1[aria-pressed="true"]{background:var(--fbf-p1)}
.fbf-pill.p2[aria-pressed="true"]{background:var(--fbf-p2)}
.fbf-pill.p3[aria-pressed="true"]{background:var(--fbf-p3)}

/* nav */
.fbf-nav{display:flex;gap:12px;align-items:center;margin-top:20px}
.fbf-btn{font:inherit;font-weight:600;border-radius:11px;padding:12px 20px;cursor:pointer;border:1px solid var(--fbf-line)}
.fbf-btn.ghost{background:var(--fbf-bg);color:var(--fbf-fg)}
.fbf-btn.primary{background:var(--fbf-accent);color:var(--fbf-accent-ink);border-color:var(--fbf-accent);margin-left:auto}
.fbf-btn:disabled{opacity:.4;cursor:not-allowed}

/* results */
.fbf-total{background:var(--fbf-accent);color:var(--fbf-accent-ink);border-radius:var(--fbf-radius);padding:22px;margin-top:16px}
.fbf-total .n{font-size:42px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
.fbf-total .of{opacity:.85;font-size:14px}
.fbf-rank{padding:9px 0;border-top:1px solid var(--fbf-line)}
.fbf-rank:first-child{border-top:0}
.fbf-rankhead{display:flex;justify-content:space-between;gap:12px}
.fbf-rank .nm{font-size:13.5px;font-weight:600}
.fbf-rank .val{font-variant-numeric:tabular-nums;font-size:12.5px;color:var(--fbf-muted);font-weight:700}
.fbf-meter{height:7px;background:var(--fbf-surface);border-radius:99px;overflow:hidden;margin-top:6px}
.fbf-meter i{display:block;height:100%;border-radius:99px}

/* submit / confirmation states */
.fbf-error{color:var(--fbf-bad);font-size:13px;margin-top:10px;min-height:16px}
.fbf-done{text-align:center;padding:40px 20px}
.fbf-done .tick{width:60px;height:60px;border-radius:50%;background:var(--fbf-accent-soft);color:var(--fbf-accent);
  display:grid;place-items:center;font-size:30px;margin:0 auto 16px}
.fbf-done h2{font-size:22px;margin:0 0 8px;font-weight:600}
.fbf-done p{color:var(--fbf-muted);max-width:48ch;margin:0 auto}

@media (max-width:560px){
  .fbf-grid{grid-template-columns:1fr}
  .fbf-step h2{font-size:21px}
}
@media (prefers-reduced-motion:reduce){.fbf-bar{transition:none}}
