/* The first-run wizard. No shell — there is no session to hang a shell on.

   Spec 018 P5 T053a: Sol's prototype at the comfortable size Omar chose — an 18px step title, 13px
   labels over 40px boxes in body type (44 on touch and phone), the DS `--gap` / `--pad`, tokens only.
   A step's questions are ruled rows inside its one card (never boxes inside the card), and a chosen
   answer is the DS segmented control's raised segment, not a teal fill: the one teal on a step is
   «التالي» / «جهّز المحل». onboarding.js keeps every class it writes; only values changed. */

.onb {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--gap);
  padding: var(--space-18);
  max-width: 960px;
  margin-inline: auto;
}

/* `done()` and `blockedCard()`: one card in the middle of the page. */
.onb:not(.onb-wizard) { grid-template-rows: none; align-content: center; max-width: 520px; }

.onb-head { display: grid; gap: var(--space-6); }
.onb-title { font-size: var(--t-18); font-weight: 650; line-height: 1.5; }

/* ---------------------------------------------------------------------------------------------
 * The wizard shell: a main pane (topbar + the step's own card) beside a fixed rail panel that
 * shows all four steps at once and the «كله بيتغيّر بعدين» reassurance — Onboarding.dc.html's
 * two-pane layout. `done()` and `blockedCard()` keep the plain single-column `.onb` above, since
 * neither has a rail to show.
 * --------------------------------------------------------------------------------------------- */

/* Column 1 is the grid's INLINE-START track — the right edge under `dir="rtl"` — which is where
   the artboard puts the rail. `.onb-main` and `.onb-rail-panel` pin themselves explicitly rather
   than relying on DOM order, so the main content can stay first in the DOM (reading order) while
   still landing on the left. */
.onb-wizard {
  display: grid;
  grid-template-columns: 300px 1fr;
  /* one row that fills the page, so the rail reaches the bottom edge (the `.onb` rows above are for
     the single-column cards) */
  grid-template-rows: 1fr;
  align-items: stretch;
  min-height: 100dvh;
  max-width: none;
  padding: 0;
  gap: 0;
}

.onb-main {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  align-self: start;
  gap: var(--gap);
  padding: calc(var(--space-18) + var(--space-10)) calc(var(--space-18) + var(--space-12));
  max-width: 780px;
}

.onb-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-12);
  flex-wrap: wrap;
}

.onb-topbar-title { display: grid; gap: var(--space-2); }
.onb-step-title { margin: 0; font-size: var(--t-18); font-weight: 650; line-height: 1.5; color: var(--ink); }
.onb-step-meta { margin: 0; color: var(--ink-3-text); font-weight: 500; font-size: var(--t-12); }

/* The step's card and its fields. */
.onb .card.stack { gap: var(--space-12); align-content: start; }
.onb .help { font-size: var(--t-12); font-weight: 500; line-height: 1.6; }
.onb .field { gap: var(--space-6); }
.onb .field label { font-size: var(--t-12); font-weight: 600; color: var(--ink-2); }
.onb .input {
  min-height: var(--ctl);
  padding-inline: var(--space-12);
  font-size: var(--t-13);
  font-weight: 600;
}
.onb .banner {
  min-height: 0;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--r-2);
  font-size: var(--t-13);
  font-weight: 600;
}

.onb-foot { display: flex; align-items: center; gap: var(--space-8); }
.onb-foot .btn { min-width: 120px; }

/* ------------------------------------------------------------------ the rail panel */

.onb-rail-panel {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: calc(var(--space-18) + var(--space-10)) var(--pad);
  background: var(--surface-2);
  border-inline-end: 1px solid var(--line);
}

.onb-rail-brand { font-size: var(--t-13); font-weight: 800; letter-spacing: 0.04em; color: var(--ink); }

.onb-rail-head h2 { margin: 0 0 var(--space-4); font-size: var(--t-15); font-weight: 650; }
.onb-rail-head p { margin: 0; }

.onb-rail { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); }

.onb-step {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  min-height: var(--ctl);
  padding: var(--space-6) var(--space-10);
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--t-12);
  font-weight: 600;
}
.onb-step[data-state='now'] {
  border-color: var(--teal);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 0 0 1px var(--teal) inset;
}
.onb-step[data-state='done'] {
  background: var(--green-bg);
  border-color: var(--green-line);
  color: var(--green);
}
.onb-step-num {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  font-size: var(--t-11);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.onb-step[data-state='now'] .onb-step-num { background: var(--teal); color: var(--on-teal); }
.onb-step[data-state='done'] .onb-step-num { background: var(--green); color: var(--on-green); }

.onb-rail-note {
  margin-block-start: auto;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-12);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.onb-rail-note-title { margin: 0; font-size: var(--t-13); font-weight: 650; color: var(--ink); }
.onb-rail-note p.help { margin: 0; }

/* ------------------------------------------------------------------ the yes/no questions */

/* A yes/no question: the sentence, what turning it on opens, and the two answers — ruled rows in
   the step's card. An empty `.onb-q` (step 3) is the rule between the owner's fields and the
   cashier's. */
.onb-q {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--line);
}
.onb-q:first-child { padding-top: 0; }
.onb-q:last-child { border-bottom: 0; padding-bottom: 0; }
.onb-q:empty { padding: 0; }
.onb-q-name { font-weight: 650; font-size: var(--t-15); }

/* The two answers are one DS segmented control: a sunk track, the chosen answer raised. The chosen
   one keeps `.btn-primary` for onboarding.js; here it is drawn as the pressed segment. */
.onb-answers {
  display: inline-flex;
  justify-self: start;
  gap: var(--space-2);
  margin-block-start: var(--space-4);
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
}
.onb-answers .btn {
  min-width: 88px;
  min-height: calc(var(--ctl) - 6px);
  border: 0;
  border-radius: var(--r-inner);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--t-12);
}
.onb-answers .btn:hover:not(:disabled) { background: transparent; color: var(--ink); }
.onb-answers .btn-primary,
.onb-answers .btn-primary:hover:not(:disabled),
.onb-answers .btn-primary:active:not(:disabled) {
  background: var(--seg-pressed);
  color: var(--ink);
  box-shadow: var(--shadow-1);
  font-weight: 700;
}

.onb-summary { display: grid; gap: 0; }
.onb-summary-row { display: flex; justify-content: space-between; gap: var(--space-12); padding: var(--space-8) 0; border-bottom: 1px solid var(--line); font-size: var(--t-13); }
.onb-summary-row:last-child { border-bottom: 0; }
.onb-summary-row strong { font-weight: 650; overflow-wrap: anywhere; text-align: end; }

@media (max-width: 900px) {
  .onb-wizard { grid-template-columns: 1fr; grid-template-rows: none; }
  .onb-main { grid-column: 1; grid-row: 1; max-width: none; padding: var(--space-18) var(--pad); }
  .onb-rail-panel { grid-column: 1; grid-row: 2; border-inline-end: 0; border-block-start: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .onb { padding: var(--space-12); }
  .onb-wizard { padding: 0; }
  .onb-topbar { flex-direction: column; align-items: stretch; }
  .onb-foot { flex-direction: column-reverse; width: 100%; }
  .onb-foot .btn { width: 100%; }
}

/* The two links on the finish card are buttons, and a button is not underlined. */
.onb a.btn { text-decoration: none; }
