/* The onboarding pages outside the app frame: the dark head at the top, parts divided by
   lines and the decision in one bar at the bottom. The welcome, choosing a plan, connecting an installed app, choosing a
   company or typing an address, the app connection and learn more pages, and the wizard in marketplace onboarding. */

/* ---------- The frame ---------- */
.ob-shell {
  --gutter: 28px;
  --column: max(1180px, 76vw);
  --pad-x: max(var(--gutter), calc((100% - var(--column)) / 2));
  display: flex; flex-direction: column; min-height: 100vh; background: var(--panel); color: var(--ink);
}
/* The column grows with a wide screen; mid and narrow hold running text and forms, which keep a readable width. */
.ob-shell.wide { --column: max(1480px, 90vw); }
.ob-shell.mid { --column: 980px; }
.ob-shell.narrow { --column: 780px; }
@media (max-width: 860px) { .ob-shell { --gutter: 16px; } }

.ob-main { flex: 1; display: flex; flex-direction: column; min-width: 0; container: page / inline-size; }
/* The wizard draws its own .pickrow cards; on these pages a pick row stays a row of its list. */
.ob-shell .rl-row.pickrow { grid-template-columns: var(--rl-cols); align-items: center; padding: 14px var(--zr, var(--pad-x)) 14px var(--zl, var(--pad-x)); border-bottom: 1px solid var(--line-soft); }
.ob-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px;
  padding: 14px var(--pad-x); border-top: 1px solid var(--line); background: var(--panel); font-size: var(--fs-xs); color: var(--ink-4);
}
.ob-foot .links { display: flex; gap: 16px; }
.ob-foot a { color: var(--ink-3); }
.ob-foot a:hover { color: var(--ink); }

/* ---------- Two tiles joined in the head: who asks and who answers ---------- */
.ob-join { display: inline-flex; align-items: center; margin-bottom: 16px; }
.ob-tile { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--paper); }
.ob-tile > img { width: 30px; height: 30px; object-fit: contain; }
.ob-tile.wide { width: auto; padding: 0; overflow: hidden; }
.ob-tile .brandmark { width: 136px; height: 52px; padding: 0 14px; border: 0; border-radius: 0; box-shadow: none; }
.ob-tile .crm-plate { width: 136px; height: 52px; border-radius: 14px; }
.ob-join-line { position: relative; width: 64px; height: 2px; background: repeating-linear-gradient(90deg, var(--stage-flow) 0 6px, transparent 6px 11px); }
.ob-join-line > span {
  position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--stage-bg); box-shadow: inset 0 0 0 1px var(--stage-flow); color: var(--stage-ink);
}
.ob-join-line > span svg { width: 13px; height: 13px; }
.ob-join-line.ok > span { box-shadow: inset 0 0 0 1px var(--stage-ok); color: var(--stage-ok); }
.ob-join-line.bad { background: repeating-linear-gradient(90deg, var(--stage-bad) 0 6px, transparent 6px 11px); }
.ob-join-line.bad > span { box-shadow: inset 0 0 0 1px var(--stage-bad); color: var(--stage-bad); }
.ob-join-line.off { background: repeating-linear-gradient(90deg, var(--stage-grid) 0 6px, transparent 6px 11px); }
.ob-join-line.off > span { box-shadow: inset 0 0 0 1px var(--stage-grid); color: var(--stage-muted); }

/* ---------- Lists of plain lines: what a choice means, numbered steps, a pick of one ---------- */
.ob-list { --rl-cols: 30px minmax(0, 1fr); }
.ob-list .rl-row { min-height: 52px; padding-top: 12px; padding-bottom: 12px; }
.ob-list .rl-row:hover { background: none; }
.ob-list .rl-name b, .ob-steps-list .rl-name b { white-space: normal; font-weight: 500; font-size: var(--fs-s); line-height: 1.5; }
.ob-list .rl-row:hover .rl-name b, .ob-steps-list .rl-row:hover .rl-name b { color: var(--ink); }
.ob-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.ob-mark svg { width: 14px; height: 14px; }
.ob-mark.yes { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.ob-mark.no { background: color-mix(in srgb, var(--bad) 10%, var(--bad-base)); color: var(--bad); }

.ob-steps-list { --rl-cols: 34px minmax(0, 1fr); }
.ob-steps-list .rl-row:hover { background: none; }
.ob-steps-list .rl-name b { font-weight: 600; }
.ob-steps-list .rl-name small { font-size: var(--fs-xs); line-height: 1.55; color: var(--ink-4); }
.ob-num {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand-text); font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums;
}

.ob-choices { --rl-cols: 20px minmax(0, 1fr) 160px; }
.ob-choices input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.ob-choices .rl-row:has(input:checked) { background: color-mix(in srgb, var(--brand-text) 6%, var(--panel)); }
.ob-choices .rl-row:has(input:focus-visible) { box-shadow: inset var(--focus-ring); }
.ob-mono { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A field in a settings row takes the row's width, its hint under it. */
.ob-field input, .ob-field select { width: 100%; }
.ob-field .hint { margin-top: 6px; font-size: var(--fs-xs); line-height: 1.5; color: var(--ink-4); }
.ob-field + .ob-field { margin-top: 12px; }

/* Regions to sign in to: a choice of one, side by side. */
.ob-regions { --opts: 2; }
.ob-regions .opt b { font-size: var(--fs-m); }

/* A line that says something is happening, under the head. */
.ob-progress { position: relative; flex: none; height: 3px; overflow: hidden; background: var(--panel-3); }
.ob-progress::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 34%; background: var(--brand); animation: ob-progress 1.4s var(--ease) infinite; }
.ob-spin { transform-origin: center; animation: ob-spin 1s linear infinite; }
.ob-lines { display: grid; gap: 2px; line-height: 1.5; }
.phead-ic.ob-ok { --rtc: var(--ok); }
.phead-ic.ob-bad { --rtc: var(--bad); }
.phead-ic.ob-info { --rtc: var(--brand-text); }

/* ---------- Choosing a plan ---------- */
.ob-plans { padding-top: 6px; }

/* ---------- The app connection page ---------- */
.ob-companies { --rl-cols: minmax(0, 1fr) minmax(0, 1.3fr) 140px 150px; --rl-cols-md: minmax(0, 1fr) 140px 150px; }
.ob-uses { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ob-uses a { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-s); font-weight: 500; }
.ob-companies .rl-do .btn { min-width: 132px; }

/* ---------- Learn more ---------- */
.ob-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-inline: var(--pad-x); border-bottom: 1px solid var(--line); }
.ob-point { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 22px 26px 24px; }
.ob-point:first-child { padding-left: 0; }
.ob-point:last-child { padding-right: 0; }
.ob-point + .ob-point { border-left: 1px solid var(--line); }
.ob-point .head-ic { width: 36px; height: 36px; margin-bottom: 6px; border-radius: var(--r-m); }
.ob-point b { font-size: var(--fs-m); font-weight: 600; color: var(--ink); }
.ob-point p { margin: 0; font-size: var(--fs-s); line-height: 1.55; color: var(--ink-3); }
.ob-answer { margin: 0; font-size: var(--fs-s); line-height: 1.6; color: var(--ink-2); }

/* ---------- The wizard in marketplace onboarding keeps its locked system ---------- */

@keyframes ob-progress { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@keyframes ob-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ob-spin { animation: none; }
  .ob-progress::before { width: 60%; animation: none; }
}

/* ---------- Narrower pages ---------- */
@container page (max-width: 820px) {
  .ob-points { grid-template-columns: minmax(0, 1fr); }
  .ob-point, .ob-point:first-child, .ob-point:last-child { padding-left: 0; padding-right: 0; }
  .ob-point + .ob-point { border-left: 0; border-top: 1px solid var(--line); }
}
@container page (max-width: 640px) {
  .ob-choices { --rl-cols: 20px minmax(0, 1fr); }
  .ob-choices .ob-mono { display: none; }
  .ob-companies { --rl-cols: minmax(0, 1fr) auto; --rl-cols-md: minmax(0, 1fr) auto; }
  .ob-companies .ob-uses, .ob-companies .rl-status { display: none; }
  .ob-tile .brandmark, .ob-tile .crm-plate { width: 112px; }
  .ob-join-line { width: 44px; }
}
