/* Signup flow A (2026-11-25): progress, step labels, playful but quiet motion. */
.flow .flow-progress {
  height: 8px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  margin: 0.25rem 0 0.75rem;
}
.flow .flow-progress span {
  display: block;
  height: 100%;
  width: 25%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sun), var(--brand));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
html[dir="rtl"] .flow .flow-progress span { margin-inline-start: 0; }

.flow-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 0.5rem;
}
.flow-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.flow-steps b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--paper);
  font-size: 0.85rem;
  transition: transform 0.35s ease, background 0.35s ease, border-color 0.35s ease, color 0.35s;
}
.flow-steps li.is-on { color: var(--ink); font-weight: 700; }
.flow-steps li.is-on b {
  border-color: var(--brand);
  background: var(--brand);
  color: #FFFDF8;
  transform: scale(1.12);
  animation: flow-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.flow-steps li.is-done b {
  border-color: var(--brand);
  color: transparent;
  background: color-mix(in srgb, var(--brand) 14%, var(--paper));
  position: relative;
}
.flow-steps li.is-done b::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 800;
}
.flow-now {
  text-align: center;
  font-weight: 700;
  margin: 0 0 1.1rem;
}

/* panels slide in from the reading side */
.flow-panel.is-in { animation: flow-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes flow-in {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: none; }
}
@keyframes flow-pop {
  0% { transform: scale(0.7); }
  100% { transform: scale(1.12); }
}

/* shop type chips */
.flow-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.flow-types legend { grid-column: 1 / -1; }
.flow-types .type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.7rem 0.3rem;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--paper);
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}
.flow-types .type input { position: absolute; opacity: 0; pointer-events: none; }
.flow-types .type-ic { font-size: 1.6rem; line-height: 1; }
.flow-types .type:hover { transform: translateY(-2px); }
.flow-types .type:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent);
  transform: translateY(-2px);
}
.flow-types .type:has(input:checked) .type-ic { animation: flow-wiggle 0.5s ease; }
.flow-types .type:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
@keyframes flow-wiggle {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-12deg) scale(1.15); }
  60% { transform: rotate(8deg) scale(1.1); }
}

.flow .flow-next { min-width: 12rem; }
.flow .btn.is-busy { opacity: 0.85; cursor: progress; }
.flow .btn.is-busy::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-inline-end-color: transparent;
  animation: flow-spin 0.7s linear infinite;
}
@keyframes flow-spin { to { transform: rotate(360deg); } }

.flow-center { text-align: center; justify-content: center; }
.flow-link { color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.flow-link.as-btn { background: none; border: 0; cursor: pointer; font: inherit; padding: 0.5rem; }

.flow-hero { text-align: center; margin: 0.5rem 0 0.25rem; }
.flow-hero h2 { margin: 0.75rem 0 0.35rem; color: var(--heading); }

/* fingerprint: soft pulse, turns green on success */
.finger {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--paper));
}
.finger .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
  animation: flow-pulse 2.2s ease-out infinite;
}
.finger .r2 { animation-delay: 1.1s; }
@keyframes flow-pulse {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(1.6); opacity: 0; }
}
.finger.is-ok { background: var(--brand); color: #FFFDF8; transition: background 0.3s, color 0.3s; }
.finger.is-ok .ring { animation: none; opacity: 0; }

.flow-code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; animation: flow-in 0.5s 0.1s both; }
.flow input.is-ok { border-color: var(--brand) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }

/* done: check draws itself (signup.css) + a few gold sparks */
.flow-done { position: relative; width: 72px; height: 72px; margin: 0 auto; }
.flow-done i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--sun);
  opacity: 0;
  animation: flow-spark 0.9s 0.35s ease-out both;
}
.flow-done .c2 { background: var(--brand); --dx: -44px; --dy: -30px; }
.flow-done .c1 { --dx: 46px; --dy: -34px; }
.flow-done .c3 { --dx: -50px; --dy: 22px; }
.flow-done .c4 { background: var(--brand); --dx: 52px; --dy: 26px; }
.flow-done .c5 { --dx: 4px; --dy: -56px; }
.flow-done .c6 { background: var(--brand); --dx: -6px; --dy: 54px; }
@keyframes flow-spark {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4) rotate(0); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(1) rotate(160deg); }
}

.signup-error.shake { animation: flow-shake 0.4s ease; }
@keyframes flow-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .flow *, .flow *::before, .flow *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* login (flow A phase 2) */
.login.flow { max-width: 28rem; margin-inline: auto; padding: 2rem 16px 4rem; box-sizing: border-box; }
.rec-help { margin-top: 1.25rem; border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 1rem; }
.rec-help summary { cursor: pointer; font-weight: 700; color: var(--brand); min-height: 44px; display: flex; align-items: center; }
.rec-help-list { margin: 0.5rem 0 0; padding-inline-start: 1.1rem; display: grid; gap: 0.5rem; line-height: 1.7; }
.login-staff { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.login-staff summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.login-staff[open] summary { color: var(--ink); margin-bottom: 0.5rem; }
.finger.small-finger { width: 84px; height: 84px; }
