/* ───────────────────────────── حاسبي · guided setup (M19, ADR 0019)
   The join page on the apex, the hand-over to a new station's address, the four-step setup, the first-steps card on
   the owner's home and the counter's walkthrough. Same deep-space glass and purple → blue neon as the rest. */

/* ── shared bits */

.join .small,
.setup .small,
.steps-card .small {
  font-size: 13px;
}

/* In these flows an error line takes room only when it says something. */
.join .field-error:empty,
.setup .field-error:empty {
  display: none;
}

.spinner.sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.join-title {
  font: 600 24px/1.35 var(--font-display);
  color: var(--text-0);
  text-wrap: balance;
}

.join-sub {
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.65;
  margin-top: -6px;
}

/* A step bar: one glowing segment per step, the current one breathing. */
.join-progress {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.join-progress.four {
  grid-template-columns: repeat(4, 1fr);
}

.join-progress i {
  height: 5px;
  border-radius: 999px;
  background: rgba(var(--fg-rgb), 0.08);
  overflow: hidden;
  position: relative;
}

.join-progress i::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad-brand);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease-out);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.8);
}

.join-progress i.on::after {
  transform: scaleX(1);
}

.join-progress i.now::after {
  animation: step-glow 2.4s ease-in-out infinite;
}

@keyframes step-glow {
  50% {
    filter: brightness(1.35);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.95);
  }
}

.join-step {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}

.join-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.join-actions .grow {
  flex: 1;
}

.join-add {
  align-self: flex-start;
  color: var(--violet-300);
}

.join-add[hidden] {
  display: none;
}

.join-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 0;
  text-align: center;
  color: var(--text-1);
}

/* ── the join page (apex) */

.screen.join {
  justify-content: flex-start;
  gap: 16px;
  padding-top: calc(22px + var(--safe-top));
}

.join-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.join-head.no-steps .join-progress {
  visibility: hidden;
}

.join-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.join-name {
  font: 700 30px/1.3 var(--font-display);
  text-shadow: 0 0 30px rgba(139, 92, 246, 0.35);
}

.join-card {
  padding: 22px 18px;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.join-foot {
  align-self: center;
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
}

.join-foot:hover {
  color: var(--violet-200);
  background: rgba(var(--fg-rgb), 0.04);
}

/* The address: what they type, then the brand domain, read left to right. */
.addr-row {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--field-bg);
  padding-inline-start: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.addr-row:focus-within {
  border-color: rgba(196, 181, 253, 0.7);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18);
}

.addr-row .ico {
  color: var(--violet-300);
  flex: none;
}

.addr-row .input {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-width: 0;
  flex: 1;
  padding-inline: 8px 2px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.addr-row .input:focus {
  box-shadow: none;
}

.addr-suffix {
  flex: none;
  padding-inline-end: 12px;
  color: var(--text-2);
  font-size: 14px;
  white-space: nowrap;
}

.addr-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  font-size: 13.5px;
  color: var(--text-2);
  flex-wrap: wrap;
}

.addr-status.ok {
  color: var(--ok);
}

.addr-status.ok .ltr {
  font-weight: 600;
}

.addr-status.taken,
.addr-status.reserved,
.addr-status.format {
  color: var(--bad);
}

.station-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.station-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.station-row .input {
  flex: 1;
  min-width: 0;
}

.station-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font: 600 13px/1 var(--font-display);
  color: var(--violet-200);
  background: var(--grad-brand-soft);
  border: 1px solid var(--line-2);
}

/* Setting up: the mark breathes while the pieces tick in. */
.join-creating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0 6px;
  text-align: center;
}

.join-orb {
  position: relative;
  display: grid;
  place-items: center;
}

.join-orb::before {
  content: '';
  position: absolute;
  inset: -26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.42), rgba(59, 130, 246, 0.14) 45%, transparent 70%);
  animation: breathe 2.6s ease-in-out infinite;
}

.join-creating.done .join-orb::before {
  background: radial-gradient(circle, rgba(52, 211, 153, 0.4), rgba(59, 130, 246, 0.12) 48%, transparent 72%);
}

.prep-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 300px);
  padding: 0;
  margin: 0;
}

.prep-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgba(var(--fg-rgb), 0.04);
  border: 1px solid var(--line);
  color: var(--text-1);
  font-size: 14.5px;
  animation-duration: 0.55s;
}

.prep-list li .ico {
  color: var(--ok);
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.7));
}

.join-invalid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.join-invalid-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: var(--bad);
  background: var(--bad-soft);
  border: 1px solid rgba(251, 113, 133, 0.35);
}

/* ── the hand-over (a new station's address, /start) */

.screen.start .start-name {
  font-size: 40px;
}

.start-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ── the four-step setup */

.screen.setup {
  gap: 14px;
}

.setup-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setup-title {
  font: 600 20px/1.3 var(--font-display);
}

.setup-card {
  padding: 22px 18px;
}

.svc-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.svc-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.svc-group-title {
  font: 600 13.5px/1.3 var(--font-display);
  color: var(--violet-300);
  letter-spacing: 0.01em;
}

.svc-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    'ico name sw'
    'ico price sw';
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  padding: 12px;
  border-radius: var(--r-md, 16px);
  background: rgba(var(--fg-rgb), 0.04);
  border: 1px solid var(--line);
  transition: opacity 0.25s, border-color 0.25s, background 0.25s;
}

.svc-row.off {
  opacity: 0.5;
}

.svc-row.off .money-input {
  pointer-events: none;
}

.svc-row.bad {
  border-color: rgba(251, 113, 133, 0.6);
  background: var(--bad-soft);
}

.svc-ico {
  grid-area: ico;
  align-self: start;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--violet-200);
  background: var(--grad-brand-soft);
  border: 1px solid var(--line-2);
}

.svc-name {
  grid-area: name;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}

.svc-row > .money-input,
.svc-open {
  grid-area: price;
}

.svc-row > .switch {
  grid-area: sw;
}

.svc-row .money-input .input {
  padding-block: 8px;
  padding-inline-end: 52px;
  font-size: 18px;
}

.svc-row .money-cur {
  right: 14px;
  font-size: 13.5px;
}

.svc-open {
  line-height: 1.4;
}

.svc-add {
  display: flex;
  flex-direction: column;
}

.svc-goods-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 4px;
  line-height: 1.5;
}

.svc-goods-hint svg {
  flex: none;
  margin-top: 2px;
}

.svc-add-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px;
  border-radius: var(--r-md, 16px);
}

.people {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* The cashier step's approvals (ADR 0041): set the approval PIN, or «بلا موافقات». */
.setup-appr-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-appr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.setup-appr-actions:empty {
  display: none;
}

.people:empty {
  display: none;
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md, 16px);
}

.person .grow {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.person.ok {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.35);
}

.person.ok .set-title {
  color: var(--text-0);
}

.pin-input {
  letter-spacing: 0.5em;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

/* Numbered how-to: big neon numerals. */
.how-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.how-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text-1);
  line-height: 1.5;
}

.how-list li b {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font: 700 15px/1 var(--font-display);
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 0 16px -2px rgba(139, 92, 246, 0.8);
}

.addr-chip {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--violet-200);
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid var(--line-2);
}

.code-host {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.code-host .waiting {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: breathe 2.4s ease-in-out infinite;
}

.linked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
  color: var(--ok);
  font: 600 18px/1.3 var(--font-display);
}

.linked .ico {
  filter: drop-shadow(0 0 14px rgba(52, 211, 153, 0.8));
}

.setup-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.setup-done .how-list {
  width: 100%;
  text-align: start;
}

.done-orb {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 40%), linear-gradient(135deg, #34d399, #3b82f6);
  box-shadow:
    0 0 0 8px rgba(52, 211, 153, 0.12),
    0 0 48px -6px rgba(52, 211, 153, 0.75);
  animation: done-pop 0.7s var(--ease-out) both;
}

@keyframes done-pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

/* ── the first-steps card (owner home) */

.steps-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  transition: opacity 0.25s, transform 0.25s;
}

.steps-card[hidden] {
  display: none;
}

.steps-card.leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.steps-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.steps-orb {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 0 18px -4px rgba(139, 92, 246, 0.9);
  flex: none;
}

.steps-title {
  flex: 1;
  font: 600 17px/1.3 var(--font-display);
}

.steps-count {
  font-size: 13px;
  color: var(--violet-200);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.14);
}

.steps-hide {
  width: 34px;
  height: 34px;
  color: var(--text-2);
}

.steps-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(var(--fg-rgb), 0.07);
  overflow: hidden;
}

.steps-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad-live);
  transform: scaleX(var(--p, 0));
  transform-origin: right;
  transition: transform 0.8s var(--ease-out);
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.9);
}

.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  margin: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 12px;
  color: var(--text-1);
  font-size: 14.5px;
}

.step.done {
  color: var(--text-3);
}

.step.done .step-text > span:first-child {
  text-decoration: line-through;
  text-decoration-color: rgba(157, 151, 199, 0.5);
}

.step.now {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.16), rgba(59, 130, 246, 0.08));
  border: 1px solid var(--line-2);
  color: var(--text-0);
  padding: 10px;
}

.step-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font: 600 12.5px/1 var(--font-display);
  color: var(--text-2);
  border: 1px solid var(--line-2);
}

.step.done .step-dot {
  color: #04140d;
  background: var(--ok);
  border-color: transparent;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.step.now .step-dot {
  color: #fff;
  background: var(--grad-brand);
  border-color: transparent;
  animation: step-glow 2.4s ease-in-out infinite;
}

.step-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.step-text .pill {
  align-self: flex-start;
}

.step-go {
  flex: none;
}

.steps-card.next .steps-next-text {
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.6;
}

.steps-actions {
  display: flex;
  gap: 8px;
}

/* ── the counter's walkthrough */

.tour {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: calc(16px + var(--safe-top)) var(--gutter) calc(16px + var(--safe-bottom));
  background: var(--scrim);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade-in 0.3s var(--ease-out) both;
}

.tour.out {
  opacity: 0;
  transition: opacity 0.22s;
}

.tour-panel {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 20px 18px;
  text-align: center;
}

.tour-panel.swap .tour-art,
.tour-panel.swap .tour-title,
.tour-panel.swap .tour-text {
  animation: enter 0.5s var(--ease-out) both;
}

.tour-panel.swap .tour-title {
  animation-delay: 60ms;
}

.tour-panel.swap .tour-text {
  animation-delay: 110ms;
}

.tour-art {
  min-height: 120px;
  display: grid;
  place-items: center;
}

.tour-orb {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 42%), linear-gradient(135deg, #f59e0b, #a855f7);
  box-shadow: 0 0 52px -8px rgba(245, 158, 11, 0.75);
}

.tour-orb.night {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.3), transparent 42%), linear-gradient(135deg, #6366f1, #1e1b4b);
  box-shadow: 0 0 52px -8px rgba(99, 102, 241, 0.85);
}

.tour-taps {
  display: flex;
  gap: 12px;
}

.tour-tap {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 20px;
  color: var(--violet-200);
  background: var(--grad-brand-soft);
  border: 1px solid var(--line-2);
  animation: tap 2.4s var(--ease-out) infinite;
  animation-delay: calc(var(--i, 0) * 0.45s);
}

.tour-tap b {
  position: absolute;
  top: -8px;
  inset-inline-end: -8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  color: #fff;
  background: var(--grad-brand);
}

@keyframes tap {
  0%,
  30%,
  100% {
    transform: none;
    box-shadow: none;
  }
  12% {
    transform: scale(0.92);
    box-shadow: 0 0 22px rgba(139, 92, 246, 0.85);
    border-color: rgba(196, 181, 253, 0.7);
  }
}

.tour-title {
  font: 600 22px/1.35 var(--font-display);
}

.tour-text {
  color: var(--text-1);
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 340px;
}

.tour-dots {
  display: flex;
  gap: 6px;
}

.tour-dots i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(var(--fg-rgb), 0.2);
  transition: width 0.3s var(--ease-out), background 0.3s;
}

.tour-dots i.on {
  width: 22px;
  background: var(--grad-brand);
}

.tour-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.tour-actions .grow {
  flex: 1;
}

.tour-actions [hidden] {
  display: none;
}

/* ── motion off */

@media (prefers-reduced-motion: reduce) {
  .join-progress i.now::after,
  .step.now .step-dot,
  .join-orb::before,
  .code-host .waiting,
  .tour-tap,
  .done-orb {
    animation: none;
  }
  .tour-panel.swap .tour-art,
  .tour-panel.swap .tour-title,
  .tour-panel.swap .tour-text {
    animation: none;
  }
}

@media (min-width: 700px) {
  .join-card,
  .setup-card {
    padding: 28px 26px;
  }
}

/* ── the guided stock and payroll setups (M24): one row per good or person, its fields open when it is picked */

.good-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.good-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--field-bg);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.good-row.is-on {
  border-color: var(--line-3);
  background: rgba(139, 92, 246, 0.1);
}

.good-row.is-have {
  opacity: 0.7;
}

.good-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.good-name {
  color: var(--text-0);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.good-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.good-fields[hidden] {
  display: none;
}

.good-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.good-field[hidden] {
  display: none;
}

.good-custom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.warn-text {
  color: var(--warn-ink);
}

/* The save button stays in reach under a long list. */
.setup-sticky {
  position: sticky;
  bottom: calc(10px + var(--safe-bottom));
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface-bar);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

@media (prefers-reduced-motion: reduce) {
  .good-row {
    transition: none;
  }
}

.good-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
