/* ─────────────────────────────────────────────────────────────────────────────
   BuiltOS onboarding — a four-step qualifier that opens from any CTA.

   Everything is scoped under .bo-ob so none of it can reach the theme. Colour
   comes from tokens defined twice: the bare :root block is the dark palette,
   because the theme treats dark as the default and only stamps
   data-color-scheme="light" when a visitor picks light.

   Accent is the theme's own --jkd-accent-rgb (0,255,133); the type is
   GeneralSans, the same face the rest of the site loads.
   ───────────────────────────────────────────────────────────────────────────── */

.bo-ob {
  --bo-accent: rgb(var(--jkd-accent-rgb, 0, 255, 133));
  --bo-accent-ink: #06210f;
  --bo-ground: #0e0f11;
  --bo-raise: #16181b;
  --bo-line: rgba(255, 255, 255, .11);
  --bo-line-2: rgba(255, 255, 255, .2);
  --bo-ink: #ffffff;
  --bo-ink-2: rgba(255, 255, 255, .64);
  --bo-ink-3: rgba(255, 255, 255, .4);
  --bo-veil: rgba(3, 4, 5, .74);
  --bo-field: rgba(255, 255, 255, .04);
  --bo-shadow: 0 40px 120px rgba(0, 0, 0, .6);
  --bo-tick: var(--bo-accent);
}

:root[data-color-scheme="light"] .bo-ob {
  --bo-accent-ink: #06210f;
  --bo-ground: #ffffff;
  --bo-raise: #f4f5f3;
  --bo-line: rgba(16, 20, 14, .12);
  --bo-line-2: rgba(16, 20, 14, .26);
  --bo-ink: #101410;
  --bo-ink-2: rgba(16, 20, 14, .66);
  --bo-ink-3: rgba(16, 20, 14, .45);
  --bo-veil: rgba(232, 234, 228, .8);
  --bo-field: rgba(16, 20, 14, .035);
  --bo-shadow: 0 40px 120px rgba(20, 26, 18, .22);
  --bo-tick: #0a7a45;
}

/* ── shell ────────────────────────────────────────────────────────────────── */
.bo-ob {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: generalsans, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.bo-ob.is-open { display: flex; }
.bo-ob__veil {
  position: absolute; inset: 0;
  background: var(--bo-veil);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.bo-ob__card {
  position: relative; z-index: 1;
  width: min(680px, 100%);
  /* vh is the viewport with the browser chrome retracted, so a phone hides the
     top of the card behind the URL bar. dvh tracks what is actually visible;
     the vh line stays first as the fallback. */
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  background: var(--bo-ground);
  color: var(--bo-ink);
  border: 1px solid var(--bo-line);
  border-radius: 24px;
  box-shadow: var(--bo-shadow);
  overflow: hidden;
  animation: bo-rise .34s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes bo-rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .bo-ob__card { animation: none; } }

/* ── head ─────────────────────────────────────────────────────────────────── */
.bo-ob__head { padding: 26px 30px 0; flex: 0 0 auto; }
/* the rail stops short of the close button rather than running under it */
.bo-ob__rail { display: flex; gap: 6px; margin: 0 46px 20px 0; }
.bo-ob__rail i {
  height: 3px; flex: 1 1 0; border-radius: 2px;
  background: var(--bo-line);
  transition: background .3s ease;
}
.bo-ob__rail i.done { background: var(--bo-accent); }
.bo-ob__step {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--bo-ink-3); margin: 0 0 8px;
}
.bo-ob__title {
  font-size: clamp(21px, 3.4vw, 27px); font-weight: 600; letter-spacing: -.018em;
  line-height: 1.15; margin: 0 0 7px; color: var(--bo-ink);
}
.bo-ob__sub { font-size: 14.5px; line-height: 1.5; color: var(--bo-ink-2); margin: 0; max-width: 52ch; }
.bo-ob__close {
  position: absolute; top: 18px; right: 20px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bo-field); border: 1px solid var(--bo-line);
  color: var(--bo-ink); cursor: pointer; opacity: .72;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s ease, border-color .2s ease;
  font-size: 17px; line-height: 1; padding: 0;
}
.bo-ob__close:hover, .bo-ob__close:focus-visible { opacity: 1; border-color: var(--bo-line-2); }

/* ── body ─────────────────────────────────────────────────────────────────── */
.bo-ob__body { padding: 22px 30px 4px; overflow-y: auto; flex: 1 1 auto; }
.bo-ob__pane { display: none; }
.bo-ob__pane.is-on { display: block; animation: bo-fade .26s ease both; }
@keyframes bo-fade { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .bo-ob__pane.is-on { animation: none; } }

/* choice cards */
.bo-ob__grid { display: grid; gap: 10px; }
.bo-ob__grid.two { grid-template-columns: 1fr 1fr; }
.bo-ob__grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) {
  .bo-ob__grid.two, .bo-ob__grid.four { grid-template-columns: 1fr 1fr; }
}
.bo-ob__opt {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  text-align: left; width: 100%;
  padding: 14px 15px;
  background: var(--bo-field);
  border: 1px solid var(--bo-line);
  border-radius: 13px;
  color: var(--bo-ink); cursor: pointer;
  font: inherit;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.bo-ob__opt:hover { border-color: var(--bo-line-2); transform: translateY(-1px); }
.bo-ob__opt:focus-visible { outline: 2px solid var(--bo-accent); outline-offset: 2px; }
.bo-ob__opt[aria-pressed="true"] {
  border-color: var(--bo-accent);
  background: color-mix(in srgb, var(--bo-accent) 12%, transparent);
}
.bo-ob__opt b { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.bo-ob__opt span { font-size: 12.5px; color: var(--bo-ink-2); line-height: 1.4; }
.bo-ob__opt em {
  position: absolute; top: 12px; right: 13px;
  font-style: normal; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--bo-accent); opacity: 0; transition: opacity .18s ease;
}
.bo-ob__opt[aria-pressed="true"] em { opacity: 1; }

/* fields */
.bo-ob__fields { display: grid; gap: 12px; }
.bo-ob__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .bo-ob__row { grid-template-columns: 1fr; } }
.bo-ob__f { display: flex; flex-direction: column; gap: 6px; }
.bo-ob__f label {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--bo-ink-3);
}
.bo-ob__f input, .bo-ob__f textarea {
  width: 100%; font: inherit; font-size: 14.5px;
  padding: 12px 14px;
  background: var(--bo-field);
  border: 1px solid var(--bo-line);
  border-radius: 11px;
  color: var(--bo-ink);
  transition: border-color .18s ease;
}
.bo-ob__f textarea { resize: vertical; min-height: 84px; }
.bo-ob__f input::placeholder, .bo-ob__f textarea::placeholder { color: var(--bo-ink-3); }
.bo-ob__f input:focus, .bo-ob__f textarea:focus { outline: none; border-color: var(--bo-accent); }
.bo-ob__f input[aria-invalid="true"] { border-color: #ff6b5e; }
.bo-ob__err { font-size: 12px; color: #ff8377; margin: 2px 0 0; min-height: 0; }

.bo-ob__consent {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; color: var(--bo-ink-2); line-height: 1.45; margin-top: 2px;
}
.bo-ob__consent input { margin: 2px 0 0; accent-color: var(--bo-accent); flex: 0 0 auto; }
.bo-ob__consent a { color: var(--bo-ink); text-underline-offset: 2px; }

/* recap on the last step */
.bo-ob__recap {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none;
}
.bo-ob__recap li {
  font-size: 11.5px; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 20px;
  background: var(--bo-field); border: 1px solid var(--bo-line); color: var(--bo-ink-2);
}

/* ── foot ─────────────────────────────────────────────────────────────────── */
.bo-ob__foot {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 30px 26px; flex: 0 0 auto;
}
.bo-ob__back {
  background: none; border: 0; padding: 6px 2px; font: inherit; font-size: 13.5px;
  color: var(--bo-ink-3); cursor: pointer; transition: color .18s ease;
}
.bo-ob__back:hover { color: var(--bo-ink); }
.bo-ob__back[hidden] { display: none; }
.bo-ob__spacer { flex: 1 1 auto; }
.bo-ob__next {
  font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 12px 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--bo-accent); color: var(--bo-accent-ink);
  display: inline-flex; align-items: center; gap: 9px;
  transition: transform .18s ease, opacity .18s ease;
}
.bo-ob__next:hover { transform: translateY(-1px); }
.bo-ob__next:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.bo-ob__next svg { width: 15px; height: 15px; }
.bo-ob__hint { font-size: 12px; color: var(--bo-ink-3); }

/* ── done ─────────────────────────────────────────────────────────────────── */
.bo-ob__done { text-align: center; padding: 12px 0 8px; }
.bo-ob__tick {
  width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%;
  background: color-mix(in srgb, var(--bo-accent) 16%, transparent);
  border: 1px solid var(--bo-accent);
  display: flex; align-items: center; justify-content: center;
}
.bo-ob__tick svg { width: 24px; height: 24px; color: var(--bo-tick); fill: none; }
.bo-ob__done .bo-ob__title { margin-bottom: 9px; }
.bo-ob__done .bo-ob__sub { margin: 0 auto; }

.bo-ob__hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
/* the document scrolls on <html> in this theme, so both get the lock */
html.bo-ob-open, html.bo-ob-open body { overflow: hidden; }

.bo-ob__doneBtn { margin-top: 22px; }

/* ── narrow ───────────────────────────────────────────────────────────────── */
/* The foot is a flex row, so at phone widths the hint was stealing room from
   the button and breaking "Send it" across two lines. Neither control shrinks
   now; the hint takes whatever is left. */
.bo-ob__next, .bo-ob__back { flex: 0 0 auto; white-space: nowrap; }
.bo-ob__hint { flex: 1 1 auto; min-width: 0; text-align: right; line-height: 1.3; }

@media (max-width: 560px) {
  .bo-ob { padding: 12px; }
  .bo-ob__card { max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 20px; }
  .bo-ob__head { padding: 22px 20px 0; }
  .bo-ob__body { padding: 18px 20px 4px; }
  .bo-ob__foot { padding: 14px 20px 20px; gap: 10px; }
  .bo-ob__rail { margin-right: 42px; }
  .bo-ob__next { padding: 11px 18px; font-size: 14px; }
  .bo-ob__hint { font-size: 11.5px; }
  .bo-ob__close { top: 15px; right: 16px; }
}
