/* ═══════════════════════════════════════════════════════════════════════
   Bar plan wizard

   The nine-question wizard that used to live only inside /bar-plan/. It is
   now mounted wherever a page carries a [data-kb-barplan] container, so the
   design guides, /bar-design/ and /bar-workflow-review/ run the same form
   rather than a second copy that can drift from it.

   Everything is prefixed .bp- and every colour is a theme token from
   assets/theme.css, so the widget follows the site's light and dark modes
   without carrying its own palette. Page chrome (the hero, the footer, the
   client strip) stays in /bar-plan/index.html; only the widget is here.
   ═══════════════════════════════════════════════════════════════════════ */

/* The UA rule for [hidden] is `display: none` at the lowest possible weight,
   so any author rule that sets a display beats it and the element stays on
   screen with the attribute still set. That is how the Back button rendered
   on the start screen: .bp-back declares inline-flex. Reading el.hidden in a
   test does not catch it, because the attribute is correct and the rendering
   is not. */
.bp-wiz [hidden] { display: none !important; }

.bp-wiz { min-width: 0; }
.bp-card {
  background: hsl(var(--background-elev));
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  padding: 26px 26px 28px;
  box-shadow: 0 20px 60px hsl(0 0% 0% / 0.28);
}
.bp-prog { height: 3px; border-radius: 3px; background: hsl(var(--border)); overflow: hidden; margin-bottom: 20px; }
.bp-prog__bar { height: 100%; width: 0; background: hsl(var(--primary)); transition: width .3s cubic-bezier(.2,.7,.3,1); }
.bp-back {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  background: none; border: none; cursor: pointer; font: inherit;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); padding: 4px 8px 4px 4px; margin: 0 0 12px -4px;
  border-radius: 6px;
}
.bp-back:hover { color: hsl(var(--foreground)); background: hsl(var(--background-elev-2)); }
.bp-step__eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); margin-bottom: 8px;
}
.bp-step__q {
  font-family: var(--font-display), 'Bebas Neue', sans-serif;
  font-size: clamp(1.45rem, 4.4vw, 1.95rem); line-height: 1.1;
  text-transform: uppercase; color: hsl(var(--foreground)); margin: 0 0 6px;
}
.bp-step__hint { font-size: .9rem; line-height: 1.5; color: hsl(var(--muted-foreground)); margin: 0 0 20px; }

/* The tappable answers. Big targets, one tap, no submit button: this is the
   whole reason the page exists rather than another form. */
.bp-opts { display: grid; gap: 10px; }
.bp-opts--2 { grid-template-columns: 1fr 1fr; }
.bp-opt {
  display: flex; align-items: flex-start; gap: 13px; width: 100%;
  min-height: 62px; padding: 15px 17px; text-align: left; cursor: pointer;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border-strong, var(--border)));
  border-radius: 11px; color: hsl(var(--foreground));
  font: inherit; transition: border-color .14s, background .14s, transform .07s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bp-opt:hover { border-color: hsl(var(--primary) / 0.6); background: hsl(var(--background-elev-2)); }
.bp-opt:active { transform: scale(.995); }
.bp-opt.is-on { border-color: hsl(var(--primary)); background: hsl(var(--primary) / 0.09); }
.bp-opt__icon {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: hsl(var(--primary) / 0.13); color: hsl(var(--primary));
}
.bp-opt__icon svg { width: 19px; height: 19px; }
.bp-opt__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bp-opt__t { font-weight: 600; font-size: .96rem; line-height: 1.3; }
.bp-opt__d { font-size: .79rem; line-height: 1.4; color: hsl(var(--muted-foreground)); }

/* Two chip rows on one screen need a label each, and the options can be
   smaller because the text is shorter. */
.bp-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); margin: 0 0 9px;
}
.bp-sub + .bp-opts { margin-bottom: 20px; }
.bp-opt--sm { min-height: 54px; padding: 11px 14px; }
.bp-opt--sm .bp-opt__t { font-size: .92rem; }

/* Quick-pick measurements and multi-select tags. Same idea as the big option
   cards above, smaller: anything a visitor would otherwise have to type,
   they can tap instead. */
.bp-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.bp-pick, .bp-tag {
  padding: 10px 15px; min-height: 44px; cursor: pointer;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border-strong, var(--border)));
  border-radius: 999px; color: hsl(var(--foreground));
  font: inherit; font-size: .86rem; line-height: 1.2;
  display: inline-flex; align-items: center; gap: 7px;
  transition: border-color .14s, background .14s, color .14s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bp-pick:hover, .bp-tag:hover { border-color: hsl(var(--primary) / 0.6); background: hsl(var(--background-elev-2)); }
.bp-pick.is-on { border-color: hsl(var(--primary)); background: hsl(var(--primary)); color: #fff; }
.bp-tag.is-on { border-color: hsl(var(--primary)); background: hsl(var(--primary) / 0.12); }
.bp-tag__box {
  flex: none; width: 15px; height: 15px; border-radius: 4px;
  border: 1.5px solid hsl(var(--border-strong, var(--border)));
  display: inline-flex; align-items: center; justify-content: center;
}
.bp-tag.is-on .bp-tag__box { border-color: hsl(var(--primary)); background: hsl(var(--primary)); }
.bp-tag__box svg { width: 10px; height: 10px; color: #fff; opacity: 0; }
.bp-tag.is-on .bp-tag__box svg { opacity: 1; }
.bp-or {
  display: block; margin: 14px 0 7px; font-size: .79rem;
  color: hsl(var(--muted-foreground));
}

/* Optional exact measurement, under the ranges on the space step. */
.bp-exact { margin-top: 16px; padding-top: 16px; border-top: 1px solid hsl(var(--border)); }
.bp-exact__lab {
  display: block; font-size: .79rem; color: hsl(var(--muted-foreground)); margin-bottom: 7px;
}
.bp-exact__row { display: flex; gap: 9px; }
.bp-input {
  flex: 1; min-width: 0; padding: 12px 14px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border-strong, var(--border)));
  border-radius: 9px; color: hsl(var(--foreground));
  font: inherit; font-size: .95rem;
}
.bp-input:focus { outline: none; border-color: hsl(var(--primary)); }
.bp-input::placeholder { color: hsl(var(--muted-foreground) / 0.8); }

.bp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 14px 24px; border-radius: 9px; border: 1px solid transparent;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; transition: background .14s, transform .07s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bp-btn--primary { background: hsl(var(--primary)); color: #fff; }
.bp-btn--primary:hover { background: hsl(var(--primary) / 0.9); transform: translateY(-1px); }
.bp-btn--ghost { background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--border-strong, var(--border))); }
.bp-btn--ghost:hover { background: hsl(var(--background-elev-2)); }
.bp-btn--full { width: 100%; }
.bp-btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }
.bp-actions { display: flex; gap: 10px; margin-top: 18px; }
.bp-actions .bp-btn { flex: 1; }

/* ── The result ── */
.bp-kit { margin: 0 0 20px; }
.bp-kit__h {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); margin: 0 0 10px;
}

/* The list of what the Blueprint gives you. Lives only in the result step
   now that the hero carries the offer line instead, so it is one rule rather
   than a base plus an override. */
.bp-gets {
  list-style: none; counter-reset: bp-get; margin: 0; padding: 0;
  display: grid; gap: 9px;
}
.bp-gets li {
  display: flex; gap: 11px; align-items: baseline;
  font-size: .88rem; line-height: 1.5; color: hsl(var(--muted-foreground));
}
.bp-gets li::before {
  content: counter(bp-get); counter-increment: bp-get;
  flex: none; width: 21px; height: 21px; border-radius: 50%;
  background: hsl(var(--primary) / 0.14); color: hsl(var(--primary));
  font-family: 'Barlow Condensed', sans-serif; font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  align-self: flex-start; position: relative; top: 2px;
}
.bp-gets__t { min-width: 0; }
.bp-gets strong { color: hsl(var(--foreground)); font-weight: 600; }

.bp-fee {
  border: 1px solid hsl(var(--border)); border-radius: 12px;
  background: hsl(var(--background)); padding: 16px 18px; margin: 0 0 20px;
}
.bp-fee__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .92rem; }
.bp-fee__row + .bp-fee__row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed hsl(var(--border)); }
.bp-fee__lab { color: hsl(var(--muted-foreground)); }
.bp-fee__val { font-weight: 600; color: hsl(var(--foreground)); white-space: nowrap; }
.bp-fee__val--off { color: hsl(var(--primary)); }
.bp-fee__note { font-size: .79rem; line-height: 1.5; color: hsl(var(--muted-foreground)); margin: 11px 0 0; }

.bp-ask { margin-top: 20px; }
/* The ask leads the last step now, so the rule that used to sit above it
   separates what follows instead. */
.bp-ask + .bp-kit { border-top: 1px solid hsl(var(--border)); margin-top: 26px; padding-top: 22px; }
.bp-ask__h {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: hsl(var(--primary)); margin: 0 0 6px;
}
.bp-ask__p { font-size: .87rem; line-height: 1.5; color: hsl(var(--muted-foreground)); margin: 0 0 14px; }
.bp-ask .bp-input { width: 100%; margin-bottom: 9px; }
.bp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.bp-two .bp-input { width: 100%; margin-bottom: 0; }
.bp-two + .bp-two { margin-top: 9px; }
.bp-two + .bp-input { margin-top: 9px; }
@media (max-width: 520px) { .bp-two { grid-template-columns: 1fr; gap: 9px; } .bp-two + .bp-two { margin-top: 9px; } }

/* The drawing. Files go straight to Uploadcare from the browser, same as the
   design help form, so the lead carries links rather than binaries. */
.bp-file { display: block; cursor: pointer; }
.bp-file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bp-file__btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 11px 18px; border-radius: 9px;
  border: 1px dashed hsl(var(--border-strong, var(--border)));
  background: hsl(var(--background)); color: hsl(var(--foreground));
  font-size: .9rem; transition: border-color .14s, background .14s;
}
.bp-file:hover .bp-file__btn { border-color: hsl(var(--primary) / 0.6); background: hsl(var(--background-elev-2)); }
.bp-file input[type="file"]:focus-visible + .bp-file__btn { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; }
.bp-file__hint { display: block; margin-top: 8px; font-size: .78rem; line-height: 1.5; color: hsl(var(--muted-foreground)); }
.bp-filelist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.bp-filelist li {
  display: flex; gap: 10px; justify-content: space-between; align-items: baseline;
  font-size: .82rem; color: hsl(var(--muted-foreground));
  padding: 7px 11px; border-radius: 7px; background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
}
.bp-filelist li.too-big { color: hsl(var(--destructive, 0 72% 56%)); border-color: hsl(var(--destructive, 0 72% 56%) / 0.5); }
.bp-filelist span:last-child { flex: none; opacity: .8; }
.bp-ask__fine { font-size: .78rem; line-height: 1.5; color: hsl(var(--muted-foreground)); margin: 12px 0 0; text-align: center; }

.bp-err { color: hsl(var(--destructive, 0 72% 56%)); font-size: .85rem; margin: 9px 0 0; }
.bp-done { text-align: center; padding: 8px 0 0; }
.bp-done__h {
  font-family: var(--font-display), 'Bebas Neue', sans-serif;
  font-size: clamp(1.3rem, 4vw, 1.7rem); text-transform: uppercase;
  color: hsl(var(--foreground)); margin: 0 0 8px;
}
.bp-done__p { font-size: .9rem; line-height: 1.55; color: hsl(var(--muted-foreground)); margin: 0 auto 16px; max-width: 46ch; }

@media (max-width: 600px) {
  .bp-card { padding: 20px 17px 22px; border-radius: 14px; }
  .bp-opts--2 { grid-template-columns: 1fr; }
  /* Only where the primary sits second in the DOM. Reversing every row put
     the ghost CTA above the primary one on the result. */
  .bp-actions { flex-direction: column; }
  .bp-actions--rev { flex-direction: column-reverse; }
  .bp-exact__row { flex-direction: column; }
}

/* Small phones. Everything here is about keeping the first question's four
   options on screen without a scroll at 360 x 740, which is the smallest
   viewport worth designing for. The per-question hints go: each option
   already carries its own one-line description. */
@media (max-width: 400px) {
  .bp-step__hint { display: none; }
}

/* ── Embedded on another page ──────────────────────────────────────────
   On /bar-plan/ the wizard is the page and sits in its own hero. Anywhere
   else it is a section inside a document, so it brings its own band: a
   headline, the card, and rules top and bottom to separate it from the
   prose above and below it. */
.bp-embed {
  /* Linked as #bar-plan from elsewhere, and the header is fixed, so the band
     has to stop short of it or an anchor jump buries the headline. */
  scroll-margin-top: 110px;
  padding: 56px 20px 60px;
  background:
    radial-gradient(900px 340px at 50% -10%, hsl(var(--primary) / 0.11), transparent 70%),
    hsl(var(--background-elev));
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}
.bp-embed__inner { max-width: 760px; margin: 0 auto; }
.bp-embed__head { text-align: center; margin-bottom: 24px; }
.bp-embed__eyebrow {
  font-family: 'Barlow Condensed', sans-serif; font-size: .76rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: hsl(var(--primary));
  margin-bottom: 9px;
}
.bp-embed__h {
  font-family: var(--font-display), sans-serif;
  font-size: clamp(1.75rem, 4.2vw, 2.5rem); line-height: 1.04;
  text-transform: uppercase; color: hsl(var(--foreground)); margin: 0 0 11px;
}
.bp-embed__h em { font-style: normal; color: hsl(var(--primary)); }
.bp-embed__p {
  font-size: .96rem; line-height: 1.6; color: hsl(var(--muted-foreground));
  margin: 0 auto; max-width: 56ch;
}
@media (max-width: 600px) {
  .bp-embed { padding: 42px 16px 46px; }
  .bp-embed__head { margin-bottom: 18px; }
  .bp-embed__p { font-size: .91rem; }
}
