{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "auth-signup-steps",
  "type": "registry:component",
  "title": "Auth Signup Steps",
  "description": "A three-step sign-up wizard for account, workspace and team invites, with a progress rail, sliding step transitions and validation on every step.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "auth",
    "auth",
    "sign up",
    "wizard",
    "stepper",
    "onboarding",
    "form"
  ],
  "docs": "https://hyperblur.dev/effects/auth-signup-steps",
  "files": [
    {
      "path": "registry/hyperblur/auth-signup-steps.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/auth-signup-steps.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface AuthSignupStepsLink {\n  label: string;\n  href: string;\n}\n\nexport interface AuthSignupStepsStep {\n  title: string;\n  heading: string;\n  description: string;\n}\n\nexport interface AuthSignupStepsValues {\n  name: string;\n  email: string;\n  password: string;\n  workspace: string;\n  slug: string;\n  teamSize: string;\n  role: string;\n  invites: string[];\n}\n\nexport interface AuthSignupStepsProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  brand?: string;\n  domain?: string;\n  steps?: AuthSignupStepsStep[];\n  teamSizes?: string[];\n  roles?: string[];\n  signin?: AuthSignupStepsLink | null;\n  successCta?: AuthSignupStepsLink;\n  onStepChange?: (step: number) => void;\n  onSubmit?: (values: AuthSignupStepsValues) => void | Promise<unknown>;\n  accent?: string;\n}\n\nconst css = `\n@keyframes hb-kf2-next {\n  from { opacity: 0; transform: translate3d(28px, 0, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n@keyframes hb-kf2-prev {\n  from { opacity: 0; transform: translate3d(-28px, 0, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n@keyframes hb-kf2-in {\n  from { opacity: 0; transform: translate3d(0, 6px, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n@keyframes hb-kf2-spin { to { transform: rotate(360deg); } }\n@keyframes hb-kf2-pop {\n  0% { opacity: 0; transform: scale(.5); }\n  70% { transform: scale(1.08); }\n  100% { opacity: 1; transform: scale(1); }\n}\n@keyframes hb-kf2-draw { to { stroke-dashoffset: 0; } }\n@keyframes hb-kf2-glow {\n  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hb-kf2-accent) 45%, transparent); }\n  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--hb-kf2-accent) 0%, transparent); }\n}\n.hb-kf2 {\n  --hb-kf2-accent: #10b981;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  padding: 64px 16px 80px;\n  overflow: hidden;\n  container-type: inline-size;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-kf2 *, .hb-kf2 *::before, .hb-kf2 *::after { box-sizing: border-box; }\n.hb-kf2::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.2px);\n  background-size: 22px 22px;\n  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000, transparent 80%);\n  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000, transparent 80%);\n  pointer-events: none;\n}\n.hb-kf2::after {\n  content: \"\";\n  position: absolute;\n  top: -260px;\n  left: 50%;\n  width: 720px;\n  height: 420px;\n  border-radius: 50%;\n  background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-kf2-accent) 22%, transparent), transparent);\n  transform: translateX(-50%);\n  pointer-events: none;\n}\n.hb-kf2-inner { position: relative; z-index: 1; max-width: 940px; margin: 0 auto; }\n.hb-kf2-head { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 36px; text-align: center; }\n.hb-kf2-eyebrow {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  padding: 5px 12px 5px 8px;\n  border: 1px solid rgba(255, 255, 255, .1);\n  border-radius: 999px;\n  background: rgba(255, 255, 255, .03);\n  color: #a1a1a1;\n  font-size: 12px;\n}\n.hb-kf2-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--hb-kf2-accent); animation: hb-kf2-glow 2.4s ease-in-out infinite; }\n.hb-kf2-title { margin: 0; font-size: clamp(28px, 5cqw, 42px); font-weight: 650; line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; }\n.hb-kf2-sub { max-width: 520px; margin: 0; color: #8f8f8f; font-size: 15px; line-height: 1.55; }\n.hb-kf2-card {\n  display: grid;\n  grid-template-columns: 1fr;\n  overflow: hidden;\n  border: 1px solid rgba(255, 255, 255, .08);\n  border-radius: 22px;\n  background: linear-gradient(180deg, #121212, #0e0e0e);\n  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .05);\n}\n.hb-kf2-rail {\n  display: flex;\n  flex-direction: column;\n  gap: 20px;\n  padding: 20px;\n  border-bottom: 1px solid rgba(255, 255, 255, .07);\n  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent);\n}\n.hb-kf2-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; }\n.hb-kf2-mark {\n  display: grid;\n  place-items: center;\n  width: 28px;\n  height: 28px;\n  border-radius: 8px;\n  background: var(--hb-kf2-accent);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 18px -6px var(--hb-kf2-accent);\n  color: #04130d;\n}\n.hb-kf2-steps { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }\n.hb-kf2-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }\n.hb-kf2-num {\n  position: relative;\n  z-index: 1;\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 30px;\n  height: 30px;\n  border: 1px solid rgba(255, 255, 255, .14);\n  border-radius: 50%;\n  background: #141414;\n  color: #8f8f8f;\n  font-size: 12px;\n  font-weight: 650;\n  font-variant-numeric: tabular-nums;\n  transition: background .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;\n}\n.hb-kf2-step[data-state=\"current\"] .hb-kf2-num {\n  border-color: var(--hb-kf2-accent);\n  color: #fff;\n  box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-kf2-accent) 20%, transparent);\n}\n.hb-kf2-step[data-state=\"done\"] .hb-kf2-num { border-color: var(--hb-kf2-accent); background: var(--hb-kf2-accent); color: #04130d; }\n.hb-kf2-step:not(:last-child)::after {\n  content: \"\";\n  position: absolute;\n  top: 15px;\n  left: calc(50% + 20px);\n  width: calc(100% - 32px);\n  height: 2px;\n  border-radius: 2px;\n  background: linear-gradient(90deg, var(--hb-kf2-accent) var(--hb-kf2-fill, 0%), rgba(255, 255, 255, .1) var(--hb-kf2-fill, 0%));\n  transition: --hb-kf2-fill .4s ease;\n}\n.hb-kf2-step[data-state=\"done\"]::after { --hb-kf2-fill: 100%; }\n.hb-kf2-stext { display: flex; flex-direction: column; gap: 2px; }\n.hb-kf2-stitle { font-size: 12px; font-weight: 600; color: #a1a1a1; transition: color .3s ease; }\n.hb-kf2-step[data-state=\"current\"] .hb-kf2-stitle, .hb-kf2-step[data-state=\"done\"] .hb-kf2-stitle { color: #ededed; }\n.hb-kf2-sdesc { display: none; font-size: 12px; line-height: 1.45; color: #6f6f6f; }\n.hb-kf2-railfoot { display: none; margin-top: auto; color: #8f8f8f; font-size: 13px; line-height: 1.5; }\n.hb-kf2-a { color: #ededed; font-weight: 550; text-decoration: none; border-radius: 4px; }\n.hb-kf2-a:hover { color: var(--hb-kf2-accent); }\n.hb-kf2-a:focus-visible { outline: 2px solid var(--hb-kf2-accent); outline-offset: 2px; }\n.hb-kf2-panel { display: flex; flex-direction: column; min-width: 0; padding: 24px 20px 20px; }\n.hb-kf2-pane { display: flex; flex-direction: column; gap: 18px; animation: hb-kf2-next .45s cubic-bezier(.2, .8, .2, 1) both; }\n.hb-kf2-pane[data-dir=\"prev\"] { animation-name: hb-kf2-prev; }\n.hb-kf2-count { margin: 0; color: var(--hb-kf2-accent); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }\n.hb-kf2-h { margin: 4px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; outline: none; }\n.hb-kf2-p { margin: 6px 0 0; color: #8f8f8f; font-size: 14px; line-height: 1.5; }\n.hb-kf2-row { display: grid; grid-template-columns: 1fr; gap: 16px; }\n.hb-kf2-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; border: 0; margin: 0; padding: 0; }\n.hb-kf2-label { padding: 0; font-size: 13px; font-weight: 550; color: #d4d4d4; }\n.hb-kf2-field legend { margin-bottom: 7px; }\n.hb-kf2-opt { color: #6f6f6f; font-weight: 400; }\n.hb-kf2-input, .hb-kf2-select {\n  display: block;\n  width: 100%;\n  height: 42px;\n  padding: 0 13px;\n  border: 1px solid rgba(255, 255, 255, .1);\n  border-radius: 11px;\n  background: #0b0b0b;\n  color: #ededed;\n  font: inherit;\n  font-size: 14px;\n  outline: none;\n  transition: border-color .18s ease, box-shadow .18s ease;\n}\n.hb-kf2-select {\n  appearance: none;\n  padding-right: 36px;\n  background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%238f8f8f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5l3-3'/%3E%3C/svg%3E\");\n  background-repeat: no-repeat;\n  background-position: right 13px center;\n  cursor: pointer;\n}\n.hb-kf2-select option { background: #111; color: #ededed; }\n.hb-kf2-input::placeholder { color: #565656; }\n.hb-kf2-input:hover, .hb-kf2-select:hover { border-color: rgba(255, 255, 255, .18); }\n.hb-kf2-input:focus, .hb-kf2-select:focus { border-color: var(--hb-kf2-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-kf2-accent) 20%, transparent); }\n.hb-kf2-input[aria-invalid=\"true\"], .hb-kf2-select[aria-invalid=\"true\"] { border-color: #f87171; }\n.hb-kf2-input[aria-invalid=\"true\"]:focus, .hb-kf2-select[aria-invalid=\"true\"]:focus { box-shadow: 0 0 0 4px rgba(248, 113, 113, .18); }\n.hb-kf2-affix { display: flex; align-items: stretch; border: 1px solid rgba(255, 255, 255, .1); border-radius: 11px; background: #0b0b0b; transition: border-color .18s ease, box-shadow .18s ease; }\n.hb-kf2-affix:focus-within { border-color: var(--hb-kf2-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-kf2-accent) 20%, transparent); }\n.hb-kf2-affix[data-invalid=\"true\"] { border-color: #f87171; }\n.hb-kf2-affix span { display: flex; align-items: center; padding: 0 0 0 13px; color: #6f6f6f; font-size: 14px; white-space: nowrap; }\n.hb-kf2-affix .hb-kf2-input { border: 0; background: transparent; padding-left: 1px; box-shadow: none; }\n.hb-kf2-err { margin: 0; color: #fca5a5; font-size: 12px; animation: hb-kf2-in .2s ease both; }\n.hb-kf2-hint { margin: 0; color: #6f6f6f; font-size: 12px; }\n.hb-kf2-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }\n.hb-kf2-meter i { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); transition: background .3s ease; }\n.hb-kf2-meter[data-score=\"1\"] i:nth-child(-n + 1) { background: #f87171; }\n.hb-kf2-meter[data-score=\"2\"] i:nth-child(-n + 2) { background: #fbbf24; }\n.hb-kf2-meter[data-score=\"3\"] i:nth-child(-n + 3) { background: color-mix(in srgb, var(--hb-kf2-accent) 70%, #fbbf24); }\n.hb-kf2-meter[data-score=\"4\"] i { background: var(--hb-kf2-accent); }\n.hb-kf2-mrow { display: flex; justify-content: space-between; color: #6f6f6f; font-size: 12px; }\n.hb-kf2-seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }\n.hb-kf2-chip { position: relative; }\n.hb-kf2-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }\n.hb-kf2-chip span {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  height: 40px;\n  border: 1px solid rgba(255, 255, 255, .1);\n  border-radius: 10px;\n  background: #0b0b0b;\n  color: #a1a1a1;\n  font-size: 13px;\n  font-variant-numeric: tabular-nums;\n  transition: border-color .18s ease, color .18s ease, background .18s ease;\n}\n.hb-kf2-chip input:hover + span { border-color: rgba(255, 255, 255, .2); color: #ededed; }\n.hb-kf2-chip input:checked + span { border-color: var(--hb-kf2-accent); background: color-mix(in srgb, var(--hb-kf2-accent) 12%, #0b0b0b); color: #fff; }\n.hb-kf2-chip input:focus-visible + span { outline: 2px solid var(--hb-kf2-accent); outline-offset: 2px; }\n.hb-kf2-seg[data-invalid=\"true\"] .hb-kf2-chip span { border-color: rgba(248, 113, 113, .6); }\n.hb-kf2-invites { display: flex; flex-direction: column; gap: 8px; }\n.hb-kf2-irow { display: flex; gap: 8px; }\n.hb-kf2-irow .hb-kf2-input { flex: 1; }\n.hb-kf2-icon {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 42px;\n  height: 42px;\n  padding: 0;\n  border: 1px solid rgba(255, 255, 255, .1);\n  border-radius: 11px;\n  background: transparent;\n  color: #8f8f8f;\n  cursor: pointer;\n}\n.hb-kf2-icon:hover { color: #ededed; border-color: rgba(255, 255, 255, .2); }\n.hb-kf2-icon:focus-visible { outline: 2px solid var(--hb-kf2-accent); outline-offset: 2px; }\n.hb-kf2-add {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  width: fit-content;\n  padding: 6px 2px;\n  border: 0;\n  background: transparent;\n  color: var(--hb-kf2-accent);\n  font: inherit;\n  font-size: 13px;\n  font-weight: 550;\n  cursor: pointer;\n  border-radius: 6px;\n}\n.hb-kf2-add:hover { text-decoration: underline; text-underline-offset: 3px; }\n.hb-kf2-add:focus-visible { outline: 2px solid var(--hb-kf2-accent); outline-offset: 2px; }\n.hb-kf2-terms { display: flex; align-items: flex-start; gap: 10px; color: #a1a1a1; font-size: 13px; line-height: 1.45; cursor: pointer; }\n.hb-kf2-terms input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--hb-kf2-accent); cursor: pointer; }\n.hb-kf2-terms input:focus-visible { outline: 2px solid var(--hb-kf2-accent); outline-offset: 2px; }\n.hb-kf2-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .07); }\n.hb-kf2-btn {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  height: 42px;\n  padding: 0 18px;\n  border: 1px solid rgba(255, 255, 255, .12);\n  border-radius: 11px;\n  background: transparent;\n  color: #ededed;\n  font: inherit;\n  font-size: 14px;\n  font-weight: 550;\n  text-decoration: none;\n  cursor: pointer;\n  transition: background .2s ease, filter .2s ease, transform .2s ease, opacity .2s ease;\n}\n.hb-kf2-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .05); }\n.hb-kf2-btn:disabled { opacity: .4; cursor: default; }\n.hb-kf2-btn:focus-visible { outline: 2px solid var(--hb-kf2-accent); outline-offset: 2px; }\n.hb-kf2-btn[data-primary=\"true\"] {\n  border-color: transparent;\n  background: var(--hb-kf2-accent);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px -12px var(--hb-kf2-accent);\n  color: #03140d;\n  font-weight: 650;\n}\n.hb-kf2-btn[data-primary=\"true\"]:hover:not(:disabled) { background: var(--hb-kf2-accent); filter: brightness(1.1); }\n.hb-kf2-btn[data-primary=\"true\"]:disabled { opacity: .8; cursor: progress; }\n.hb-kf2-btn svg { transition: transform .2s ease; }\n.hb-kf2-btn[data-primary=\"true\"]:hover:not(:disabled) svg { transform: translateX(2px); }\n.hb-kf2-spin { width: 15px; height: 15px; border: 2px solid rgba(3, 20, 13, .3); border-top-color: #03140d; border-radius: 50%; animation: hb-kf2-spin .7s linear infinite; }\n.hb-kf2-alert { margin: 0; padding: 10px 12px; border: 1px solid rgba(248, 113, 113, .3); border-radius: 10px; background: rgba(248, 113, 113, .08); color: #fecaca; font-size: 13px; }\n.hb-kf2-done { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; animation: hb-kf2-in .4s ease both; }\n.hb-kf2-ok {\n  display: grid;\n  place-items: center;\n  width: 56px;\n  height: 56px;\n  border-radius: 16px;\n  background: var(--hb-kf2-accent);\n  color: #03140d;\n  box-shadow: 0 16px 40px -14px var(--hb-kf2-accent);\n  animation: hb-kf2-pop .5s cubic-bezier(.2, .9, .3, 1.2) both;\n}\n.hb-kf2-ok path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: hb-kf2-draw .4s .25s ease forwards; }\n.hb-kf2-sum { display: grid; gap: 1px; width: 100%; margin: 4px 0 0; padding: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; background: rgba(255, 255, 255, .08); }\n.hb-kf2-sum div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; background: #101010; font-size: 13px; }\n.hb-kf2-sum dt { color: #8f8f8f; }\n.hb-kf2-sum dd { margin: 0; color: #ededed; font-weight: 550; text-align: right; overflow-wrap: anywhere; }\n.hb-kf2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@property --hb-kf2-fill { syntax: \"<percentage>\"; inherits: false; initial-value: 0%; }\n@container (min-width: 560px) {\n  .hb-kf2-row { grid-template-columns: 1fr 1fr; }\n  .hb-kf2-seg { grid-template-columns: repeat(4, 1fr); }\n}\n@container (min-width: 780px) {\n  .hb-kf2 { padding: 88px 24px 104px; }\n  .hb-kf2-card { grid-template-columns: 270px 1fr; min-height: 480px; }\n  .hb-kf2-rail { padding: 28px 24px; border-bottom: 0; border-right: 1px solid rgba(255, 255, 255, .07); }\n  .hb-kf2-steps { grid-template-columns: 1fr; gap: 26px; margin-top: 12px; }\n  .hb-kf2-step { flex-direction: row; align-items: flex-start; gap: 14px; text-align: left; }\n  .hb-kf2-step:not(:last-child)::after {\n    top: 36px;\n    left: 14px;\n    width: 2px;\n    height: calc(100% - 16px);\n    background: linear-gradient(180deg, var(--hb-kf2-accent) var(--hb-kf2-fill, 0%), rgba(255, 255, 255, .1) var(--hb-kf2-fill, 0%));\n  }\n  .hb-kf2-stext { padding-top: 5px; }\n  .hb-kf2-stitle { font-size: 14px; }\n  .hb-kf2-sdesc { display: block; }\n  .hb-kf2-railfoot { display: block; }\n  .hb-kf2-panel { padding: 32px 36px 28px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-kf2-pane, .hb-kf2-err, .hb-kf2-done, .hb-kf2-ok, .hb-kf2-ok path, .hb-kf2-eyebrow i { animation: none; }\n  .hb-kf2-ok path { stroke-dashoffset: 0; }\n  .hb-kf2-num, .hb-kf2-step::after, .hb-kf2-input, .hb-kf2-select, .hb-kf2-chip span, .hb-kf2-btn, .hb-kf2-btn svg, .hb-kf2-meter i { transition: none; }\n  .hb-kf2-spin { animation-duration: 2s; }\n}\n`;\n\nconst defaultSteps: AuthSignupStepsStep[] = [\n  { title: \"Account\", heading: \"Create your account\", description: \"Your name, email and a password.\" },\n  { title: \"Workspace\", heading: \"Set up your workspace\", description: \"Name it and pick your address.\" },\n  { title: \"Invite team\", heading: \"Invite your team\", description: \"Bring teammates in, or skip for now.\" },\n];\n\nconst defaultTeamSizes = [\"1-10\", \"11-50\", \"51-200\", \"200+\"];\nconst defaultRoles = [\"Engineering\", \"Product\", \"Design\", \"Operations\", \"Founder\"];\nconst emailPattern = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/;\nconst slugPattern = /^[a-z0-9](?:[a-z0-9-]{1,30})[a-z0-9]$/;\nconst strengthLabels = [\"Too short\", \"Weak\", \"Fair\", \"Good\", \"Strong\"];\n\nfunction slugify(value: string) {\n  return value\n    .toLowerCase()\n    .trim()\n    .replace(/[^a-z0-9]+/g, \"-\")\n    .replace(/^-+|-+$/g, \"\")\n    .slice(0, 32);\n}\n\nfunction strength(password: string) {\n  if (password.length < 8) return password.length ? 1 : 0;\n  let score = 1;\n  if (/[a-z]/.test(password) && /[A-Z]/.test(password)) score++;\n  if (/\\d/.test(password)) score++;\n  if (/[^A-Za-z0-9]/.test(password) || password.length >= 14) score++;\n  return Math.min(score, 4);\n}\n\nfunction wait(result: unknown) {\n  return result instanceof Promise ? result : new Promise((resolve) => setTimeout(resolve, 1000));\n}\n\ntype FieldErrors = Record<string, string>;\n\nfunction ArrowIcon({ back = false }: { back?: boolean }) {\n  return (\n    <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      {back ? <path d=\"M13 8H3m4-4L3 8l4 4\" /> : <path d=\"M3 8h10M9 4l4 4-4 4\" />}\n    </svg>\n  );\n}\n\nexport function AuthSignupSteps({\n  eyebrow = \"14-day free trial, no card required\",\n  title = \"Set up Relay in three short steps\",\n  subtitle = \"Create your account, name your workspace and bring your team. It takes about two minutes.\",\n  brand = \"Relay\",\n  domain = \"relay.so\",\n  steps = defaultSteps,\n  teamSizes = defaultTeamSizes,\n  roles = defaultRoles,\n  signin = { label: \"Sign in\", href: \"#signin\" },\n  successCta = { label: \"Open your workspace\", href: \"#workspace\" },\n  onStepChange,\n  onSubmit,\n  accent = \"#10b981\",\n  className = \"\",\n  style,\n  ...rest\n}: AuthSignupStepsProps) {\n  const uid = React.useId();\n  const [step, setStep] = React.useState(0);\n  const [dir, setDir] = React.useState<\"next\" | \"prev\">(\"next\");\n  const [tried, setTried] = React.useState([false, false, false]);\n  const [status, setStatus] = React.useState<\"idle\" | \"loading\" | \"success\">(\"idle\");\n  const [formError, setFormError] = React.useState(\"\");\n  const [name, setName] = React.useState(\"\");\n  const [email, setEmail] = React.useState(\"\");\n  const [password, setPassword] = React.useState(\"\");\n  const [workspace, setWorkspace] = React.useState(\"\");\n  const [slugDraft, setSlugDraft] = React.useState(\"\");\n  const [slugEdited, setSlugEdited] = React.useState(false);\n  const [teamSize, setTeamSize] = React.useState(\"\");\n  const [role, setRole] = React.useState(\"\");\n  const [invites, setInvites] = React.useState([\"\", \"\"]);\n  const [terms, setTerms] = React.useState(false);\n  const headingRef = React.useRef<HTMLHeadingElement>(null);\n  const formRef = React.useRef<HTMLFormElement>(null);\n  const moved = React.useRef(false);\n\n  const slug = slugEdited ? slugDraft : slugify(workspace);\n  const score = strength(password);\n\n  React.useEffect(() => {\n    if (!moved.current) return;\n    moved.current = false;\n    headingRef.current?.focus();\n  }, [step, status]);\n\n  function errorsFor(index: number): FieldErrors {\n    const e: FieldErrors = {};\n    if (index === 0) {\n      if (name.trim().length < 2) e.name = \"Enter your full name.\";\n      if (!email.trim()) e.email = \"Enter your work email.\";\n      else if (!emailPattern.test(email.trim())) e.email = \"That email looks incomplete.\";\n      if (password.length < 8) e.password = \"Use at least 8 characters.\";\n      else if (!/\\d/.test(password)) e.password = \"Add at least one number.\";\n    }\n    if (index === 1) {\n      if (workspace.trim().length < 3) e.workspace = \"Workspace names need at least 3 characters.\";\n      if (!slugPattern.test(slug)) e.slug = \"Use 3 to 32 lowercase letters, numbers or dashes.\";\n      if (!teamSize) e.teamSize = \"Pick a team size.\";\n      if (!role) e.role = \"Choose the role that fits best.\";\n    }\n    if (index === 2) {\n      invites.forEach((value, i) => {\n        if (value.trim() && !emailPattern.test(value.trim())) e[`invite${i}`] = \"Enter a valid email or leave it empty.\";\n      });\n      if (!terms) e.terms = \"Accept the terms to create your workspace.\";\n    }\n    return e;\n  }\n\n  const errors = tried[step] ? errorsFor(step) : {};\n\n  function fieldProps(key: string) {\n    const message = errors[key];\n    return {\n      \"aria-invalid\": message ? true : undefined,\n      \"aria-describedby\": message ? `${uid}-${key}-err` : undefined,\n    } as const;\n  }\n\n  function errorText(key: string) {\n    const message = errors[key];\n    return message ? (\n      <p className=\"hb-kf2-err\" id={`${uid}-${key}-err`}>\n        {message}\n      </p>\n    ) : null;\n  }\n\n  function go(next: number) {\n    moved.current = true;\n    setDir(next > step ? \"next\" : \"prev\");\n    setStep(next);\n    onStepChange?.(next);\n  }\n\n  function focusFirstInvalid() {\n    window.requestAnimationFrame(() => {\n      const target = formRef.current?.querySelector<HTMLElement>('[aria-invalid=\"true\"], [data-invalid=\"true\"] input');\n      target?.focus();\n    });\n  }\n\n  async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    if (status === \"loading\") return;\n    setTried((t) => t.map((v, i) => (i === step ? true : v)));\n    setFormError(\"\");\n    if (Object.keys(errorsFor(step)).length) {\n      focusFirstInvalid();\n      return;\n    }\n    if (step < 2) {\n      go(step + 1);\n      return;\n    }\n    setStatus(\"loading\");\n    try {\n      await wait(\n        onSubmit?.({\n          name: name.trim(),\n          email: email.trim(),\n          password,\n          workspace: workspace.trim(),\n          slug,\n          teamSize,\n          role,\n          invites: invites.map((v) => v.trim()).filter(Boolean),\n        }),\n      );\n      moved.current = true;\n      setStatus(\"success\");\n    } catch (error) {\n      setStatus(\"idle\");\n      setFormError(error instanceof Error && error.message ? error.message : \"Something went wrong creating your workspace. Try again.\");\n    }\n  }\n\n  const loading = status === \"loading\";\n  const vars = { \"--hb-kf2-accent\": accent, ...style } as React.CSSProperties;\n  const firstName = name.trim().split(\" \")[0] || \"there\";\n  const sentInvites = invites.filter((v) => v.trim()).length;\n\n  return (\n    <section className={`hb-kf2 ${className}`} style={vars} aria-labelledby={`${uid}-title`} {...rest}>\n      <style href=\"hb-auth-signup-steps\" precedence=\"default\">{css}</style>\n      <div className=\"hb-kf2-inner\">\n        <header className=\"hb-kf2-head\">\n          {eyebrow ? (\n            <span className=\"hb-kf2-eyebrow\">\n              <i aria-hidden=\"true\" />\n              {eyebrow}\n            </span>\n          ) : null}\n          <h2 className=\"hb-kf2-title\" id={`${uid}-title`}>\n            {title}\n          </h2>\n          {subtitle ? <p className=\"hb-kf2-sub\">{subtitle}</p> : null}\n        </header>\n        <div className=\"hb-kf2-card\">\n          <aside className=\"hb-kf2-rail\">\n            <div className=\"hb-kf2-brand\">\n              <span className=\"hb-kf2-mark\" aria-hidden=\"true\">\n                <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n                  <path d=\"M3 3h6.5a3.5 3.5 0 0 1 1.2 6.8L13 13h-3l-2-3H6v3H3V3Zm3 2.5V8h3.3a1.25 1.25 0 0 0 0-2.5H6Z\" />\n                </svg>\n              </span>\n              {brand}\n            </div>\n            <ol className=\"hb-kf2-steps\" aria-label=\"Sign-up progress\">\n              {defaultSteps.map((fallback, i) => {\n                const s = steps[i] ?? fallback;\n                const state = status === \"success\" || i < step ? \"done\" : i === step ? \"current\" : \"upcoming\";\n                return (\n                  <li key={s.title} className=\"hb-kf2-step\" data-state={state} aria-current={state === \"current\" ? \"step\" : undefined}>\n                    <span className=\"hb-kf2-num\" aria-hidden=\"true\">\n                      {state === \"done\" ? (\n                        <svg width=\"13\" height=\"13\" viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                          <path d=\"M2.5 6.2 5 8.5l4.5-5\" />\n                        </svg>\n                      ) : (\n                        i + 1\n                      )}\n                    </span>\n                    <span className=\"hb-kf2-stext\">\n                      <span className=\"hb-kf2-stitle\">\n                        {s.title}\n                        <span className=\"hb-kf2-sr\">{state === \"done\" ? \", completed\" : state === \"current\" ? \", current step\" : \"\"}</span>\n                      </span>\n                      <span className=\"hb-kf2-sdesc\">{s.description}</span>\n                    </span>\n                  </li>\n                );\n              })}\n            </ol>\n            {signin ? (\n              <p className=\"hb-kf2-railfoot\">\n                Already on {brand}?{\" \"}\n                <a className=\"hb-kf2-a\" href={signin.href}>\n                  {signin.label}\n                </a>\n              </p>\n            ) : null}\n          </aside>\n          <div className=\"hb-kf2-panel\">\n            {status === \"success\" ? (\n              <div className=\"hb-kf2-done\" role=\"status\">\n                <span className=\"hb-kf2-ok\" aria-hidden=\"true\">\n                  <svg width=\"26\" height=\"26\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                    <path d=\"M5 12.5l4.5 4.5L19 7.5\" />\n                  </svg>\n                </span>\n                <div>\n                  <h3 className=\"hb-kf2-h\" ref={headingRef} tabIndex={-1}>\n                    {workspace.trim()} is ready, {firstName}\n                  </h3>\n                  <p className=\"hb-kf2-p\">We sent a confirmation to {email.trim()}. Your 14-day trial starts now.</p>\n                </div>\n                <dl className=\"hb-kf2-sum\">\n                  <div>\n                    <dt>Address</dt>\n                    <dd>\n                      {slug}.{domain}\n                    </dd>\n                  </div>\n                  <div>\n                    <dt>Team size</dt>\n                    <dd>{teamSize} people</dd>\n                  </div>\n                  <div>\n                    <dt>Invitations</dt>\n                    <dd>{sentInvites ? `${sentInvites} sent` : \"None yet\"}</dd>\n                  </div>\n                </dl>\n                <a className=\"hb-kf2-btn\" data-primary=\"true\" href={successCta.href}>\n                  {successCta.label}\n                  <ArrowIcon />\n                </a>\n              </div>\n            ) : (\n              <form ref={formRef} noValidate onSubmit={handleSubmit} aria-busy={loading || undefined}>\n                <div className=\"hb-kf2-pane\" key={step} data-dir={dir}>\n                  <div>\n                    <p className=\"hb-kf2-count\">\n                      Step {step + 1} of 3\n                    </p>\n                    <h3 className=\"hb-kf2-h\" ref={headingRef} tabIndex={-1}>\n                      {steps[step]?.heading ?? defaultSteps[step].heading}\n                    </h3>\n                    <p className=\"hb-kf2-p\">{steps[step]?.description ?? defaultSteps[step].description}</p>\n                  </div>\n                  {formError ? (\n                    <p className=\"hb-kf2-alert\" role=\"alert\">\n                      {formError}\n                    </p>\n                  ) : null}\n                  {step === 0 ? (\n                    <>\n                      <div className=\"hb-kf2-row\">\n                        <div className=\"hb-kf2-field\">\n                          <label className=\"hb-kf2-label\" htmlFor={`${uid}-name`}>\n                            Full name\n                          </label>\n                          <input id={`${uid}-name`} className=\"hb-kf2-input\" autoComplete=\"name\" placeholder=\"Maya Lindqvist\" value={name} onChange={(e) => setName(e.target.value)} {...fieldProps(\"name\")} />\n                          {errorText(\"name\")}\n                        </div>\n                        <div className=\"hb-kf2-field\">\n                          <label className=\"hb-kf2-label\" htmlFor={`${uid}-email`}>\n                            Work email\n                          </label>\n                          <input id={`${uid}-email`} className=\"hb-kf2-input\" type=\"email\" autoComplete=\"email\" placeholder=\"maya@northwind.io\" value={email} onChange={(e) => setEmail(e.target.value)} {...fieldProps(\"email\")} />\n                          {errorText(\"email\")}\n                        </div>\n                      </div>\n                      <div className=\"hb-kf2-field\">\n                        <label className=\"hb-kf2-label\" htmlFor={`${uid}-password`}>\n                          Password\n                        </label>\n                        <input\n                          id={`${uid}-password`}\n                          className=\"hb-kf2-input\"\n                          type=\"password\"\n                          autoComplete=\"new-password\"\n                          placeholder=\"8+ characters with a number\"\n                          value={password}\n                          onChange={(e) => setPassword(e.target.value)}\n                          {...fieldProps(\"password\")}\n                        />\n                        <div className=\"hb-kf2-meter\" data-score={score} aria-hidden=\"true\">\n                          <i />\n                          <i />\n                          <i />\n                          <i />\n                        </div>\n                        <div className=\"hb-kf2-mrow\" aria-live=\"polite\">\n                          <span>Strength: {strengthLabels[score]}</span>\n                          <span>{password.length} characters</span>\n                        </div>\n                        {errorText(\"password\")}\n                      </div>\n                    </>\n                  ) : null}\n                  {step === 1 ? (\n                    <>\n                      <div className=\"hb-kf2-row\">\n                        <div className=\"hb-kf2-field\">\n                          <label className=\"hb-kf2-label\" htmlFor={`${uid}-workspace`}>\n                            Workspace name\n                          </label>\n                          <input id={`${uid}-workspace`} className=\"hb-kf2-input\" autoComplete=\"organization\" placeholder=\"Northwind Labs\" value={workspace} onChange={(e) => setWorkspace(e.target.value)} {...fieldProps(\"workspace\")} />\n                          {errorText(\"workspace\")}\n                        </div>\n                        <div className=\"hb-kf2-field\">\n                          <label className=\"hb-kf2-label\" htmlFor={`${uid}-slug`}>\n                            Address\n                          </label>\n                          <div className=\"hb-kf2-affix\" data-invalid={errors.slug ? \"true\" : undefined}>\n                            <input\n                              id={`${uid}-slug`}\n                              className=\"hb-kf2-input\"\n                              placeholder=\"northwind\"\n                              value={slug}\n                              onChange={(e) => {\n                                setSlugEdited(true);\n                                setSlugDraft(slugify(e.target.value) + (e.target.value.endsWith(\"-\") ? \"-\" : \"\"));\n                              }}\n                              {...fieldProps(\"slug\")}\n                            />\n                            <span aria-hidden=\"true\">.{domain}&nbsp;&nbsp;</span>\n                          </div>\n                          {errorText(\"slug\")}\n                        </div>\n                      </div>\n                      <fieldset className=\"hb-kf2-field\" aria-describedby={errors.teamSize ? `${uid}-teamSize-err` : undefined}>\n                        <legend className=\"hb-kf2-label\">\n                          Team size\n                        </legend>\n                        <div className=\"hb-kf2-seg\" data-invalid={errors.teamSize ? \"true\" : undefined}>\n                          {teamSizes.map((size) => (\n                            <label className=\"hb-kf2-chip\" key={size}>\n                              <input type=\"radio\" name={`${uid}-size`} value={size} checked={teamSize === size} onChange={() => setTeamSize(size)} />\n                              <span>{size}</span>\n                            </label>\n                          ))}\n                        </div>\n                        {errorText(\"teamSize\")}\n                      </fieldset>\n                      <div className=\"hb-kf2-field\">\n                        <label className=\"hb-kf2-label\" htmlFor={`${uid}-role`}>\n                          Your role\n                        </label>\n                        <select id={`${uid}-role`} className=\"hb-kf2-select\" value={role} onChange={(e) => setRole(e.target.value)} {...fieldProps(\"role\")}>\n                          <option value=\"\" disabled>\n                            Select a role\n                          </option>\n                          {roles.map((r) => (\n                            <option key={r} value={r}>\n                              {r}\n                            </option>\n                          ))}\n                        </select>\n                        {errorText(\"role\")}\n                      </div>\n                    </>\n                  ) : null}\n                  {step === 2 ? (\n                    <>\n                      <div className=\"hb-kf2-field\">\n                        <span className=\"hb-kf2-label\" id={`${uid}-inv`}>\n                          Teammate emails <span className=\"hb-kf2-opt\">(optional)</span>\n                        </span>\n                        <div className=\"hb-kf2-invites\" role=\"group\" aria-labelledby={`${uid}-inv`}>\n                          {invites.map((value, i) => (\n                            <div key={i}>\n                              <div className=\"hb-kf2-irow\">\n                                <input\n                                  className=\"hb-kf2-input\"\n                                  type=\"email\"\n                                  aria-label={`Teammate ${i + 1} email`}\n                                  placeholder={i === 0 ? \"jonas@northwind.io\" : \"teammate@northwind.io\"}\n                                  value={value}\n                                  onChange={(e) => setInvites((list) => list.map((v, j) => (j === i ? e.target.value : v)))}\n                                  {...fieldProps(`invite${i}`)}\n                                />\n                                {invites.length > 1 ? (\n                                  <button type=\"button\" className=\"hb-kf2-icon\" aria-label={`Remove teammate ${i + 1}`} onClick={() => setInvites((list) => list.filter((_, j) => j !== i))}>\n                                    <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" aria-hidden=\"true\">\n                                      <path d=\"M4 4l8 8M12 4l-8 8\" />\n                                    </svg>\n                                  </button>\n                                ) : null}\n                              </div>\n                              {errorText(`invite${i}`)}\n                            </div>\n                          ))}\n                        </div>\n                        {invites.length < 5 ? (\n                          <button type=\"button\" className=\"hb-kf2-add\" onClick={() => setInvites((list) => [...list, \"\"])}>\n                            <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" aria-hidden=\"true\">\n                              <path d=\"M8 3v10M3 8h10\" />\n                            </svg>\n                            Add another\n                          </button>\n                        ) : (\n                          <p className=\"hb-kf2-hint\">You can invite more people from Settings later.</p>\n                        )}\n                      </div>\n                      <div className=\"hb-kf2-field\">\n                        <label className=\"hb-kf2-terms\">\n                          <input type=\"checkbox\" checked={terms} onChange={(e) => setTerms(e.target.checked)} {...fieldProps(\"terms\")} />\n                          <span>I agree to the Terms of Service and the Data Processing Addendum.</span>\n                        </label>\n                        {errorText(\"terms\")}\n                      </div>\n                    </>\n                  ) : null}\n                </div>\n                <div className=\"hb-kf2-foot\">\n                  <button type=\"button\" className=\"hb-kf2-btn\" disabled={step === 0 || loading} onClick={() => go(step - 1)}>\n                    <ArrowIcon back />\n                    Back\n                  </button>\n                  <button type=\"submit\" className=\"hb-kf2-btn\" data-primary=\"true\" disabled={loading}>\n                    {loading ? <span className=\"hb-kf2-spin\" aria-hidden=\"true\" /> : null}\n                    {loading ? \"Creating workspace\" : step === 2 ? \"Create workspace\" : \"Continue\"}\n                    {loading ? null : <ArrowIcon />}\n                  </button>\n                </div>\n                <span className=\"hb-kf2-sr\" role=\"status\">\n                  {loading ? \"Creating your workspace\" : \"\"}\n                </span>\n              </form>\n            )}\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}