{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sign-in-split",
  "title": "Split sign-in",
  "description": "Brand-forward sign-in with a live product mock, rotating testimonials, social login and polished error, reset and success states.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "checkbox",
    "input",
    "label"
  ],
  "files": [
    {
      "path": "registry/blocks/auth/sign-in-split.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { AlertCircle, ArrowRight, CalendarCheck, CheckCircle2, Eye, EyeOff, Loader2, Lock, Mail, Quote } from \"lucide-react\"\nimport { Button } from \"@/components/ui/button\"\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport { Input } from \"@/components/ui/input\"\nimport { Label } from \"@/components/ui/label\"\nimport { cn } from \"@/lib/utils\"\n\nconst TESTIMONIALS = [\n  { quote: \"No-shows dropped by 38% in the first month. The reminders alone paid for the plan.\", name: \"Priya Nair\", role: \"Owner, Lumen Skin Clinic\", initials: \"PN\" },\n  { quote: \"Our front desk used to live on the phone. Now 80% of bookings come in online overnight.\", name: \"Marcus Bell\", role: \"Manager, Fade Republic Barbers\", initials: \"MB\" },\n  { quote: \"Six studios, one calendar. Moving instructors between locations takes two clicks.\", name: \"Hannah Lindqvist\", role: \"COO, Northside Pilates\", initials: \"HL\" },\n]\n\nconst AGENDA = [\n  { col: 0, top: 6, h: 22, label: \"Balayage\", tone: \"var(--chart-1)\" },\n  { col: 1, top: 14, h: 16, label: \"Trim\", tone: \"var(--chart-2)\" },\n  { col: 2, top: 4, h: 28, label: \"Massage\", tone: \"var(--chart-3)\" },\n  { col: 0, top: 34, h: 14, label: \"Brow tint\", tone: \"var(--chart-4)\" },\n  { col: 1, top: 38, h: 26, label: \"Full color\", tone: \"var(--chart-5)\" },\n  { col: 2, top: 40, h: 18, label: \"Facial\", tone: \"var(--chart-1)\" },\n  { col: 0, top: 54, h: 20, label: \"Gel nails\", tone: \"var(--chart-3)\" },\n  { col: 2, top: 64, h: 14, label: \"Consult\", tone: \"var(--chart-2)\" },\n]\n\ntype Status = \"idle\" | \"loading\" | \"success\"\ntype Provider = \"google\" | \"apple\"\n\nexport default function SignInSplit() {\n  const [mode, setMode] = React.useState<\"signin\" | \"signup\">(\"signin\")\n  const [form, setForm] = React.useState({ name: \"\", email: \"\", password: \"\" })\n  const [remember, setRemember] = React.useState(true)\n  const [show, setShow] = React.useState(false)\n  const [touched, setTouched] = React.useState(false)\n  const [status, setStatus] = React.useState<Status>(\"idle\")\n  const [provider, setProvider] = React.useState<Provider | null>(null)\n  const [authError, setAuthError] = React.useState<string | null>(null)\n  const [attempts, setAttempts] = React.useState(3)\n  const [notice, setNotice] = React.useState<string | null>(null)\n  const [slide, setSlide] = React.useState(0)\n  const [signedInAs, setSignedInAs] = React.useState(\"\")\n\n  React.useEffect(() => {\n    const id = setInterval(() => setSlide((s) => (s + 1) % TESTIMONIALS.length), 6000)\n    return () => clearInterval(id)\n  }, [slide])\n\n  const errors = {\n    name: mode === \"signup\" && form.name.trim().length < 2 ? \"Enter your full name\" : null,\n    email: !form.email ? \"Email is required\" : !/^\\S+@\\S+\\.\\S+$/.test(form.email) ? \"Enter a valid email address\" : null,\n    password: !form.password ? \"Password is required\" : mode === \"signup\" && form.password.length < 8 ? \"Use at least 8 characters\" : null,\n  }\n  const show_ = (k: keyof typeof errors) => touched && errors[k]\n  const busy = status === \"loading\" || provider !== null\n\n  const submit = (e: React.FormEvent) => {\n    e.preventDefault()\n    setTouched(true)\n    setAuthError(null)\n    setNotice(null)\n    if (errors.name || errors.email || errors.password) return\n    if (attempts === 0) return\n    setStatus(\"loading\")\n    setTimeout(() => {\n      if (mode === \"signin\" && form.password === \"wrong\") {\n        const left = attempts - 1\n        setAttempts(left)\n        setAuthError(left === 0 ? \"Too many attempts. We've emailed you a link to unlock your account.\" : `Incorrect email or password. ${left} attempt${left === 1 ? \"\" : \"s\"} left.`)\n        setStatus(\"idle\")\n        return\n      }\n      setSignedInAs((mode === \"signup\" ? form.name.split(\" \")[0] : form.email.split(\"@\")[0]) ?? \"\")\n      setStatus(\"success\")\n    }, 1100)\n  }\n\n  const social = (p: Provider) => {\n    setProvider(p)\n    setAuthError(null)\n    setTimeout(() => {\n      setProvider(null)\n      setSignedInAs(p === \"google\" ? \"Google account\" : \"Apple ID\")\n      setStatus(\"success\")\n    }, 1300)\n  }\n\n  const forgot = () => {\n    setTouched(true)\n    if (errors.email) {\n      setNotice(null)\n      return\n    }\n    setNotice(`Reset link sent to ${form.email}. It expires in 30 minutes.`)\n  }\n\n  const reset = () => {\n    setStatus(\"idle\")\n    setForm({ name: \"\", email: \"\", password: \"\" })\n    setTouched(false)\n    setAuthError(null)\n    setAttempts(3)\n    setNotice(null)\n  }\n\n  const t = TESTIMONIALS[slide]!\n\n  return (\n    <div className=\"grid min-h-svh bg-background lg:grid-cols-[1.05fr_1fr]\">\n      {/* Brand panel */}\n      <aside className=\"relative hidden overflow-hidden bg-zinc-950 text-white lg:flex lg:flex-col lg:justify-between lg:p-10\">\n        <div className=\"pointer-events-none absolute inset-0 opacity-80\" style={{ background: \"radial-gradient(60% 50% at 20% 10%, color-mix(in oklch, var(--chart-1) 55%, transparent), transparent), radial-gradient(50% 45% at 90% 80%, color-mix(in oklch, var(--chart-3) 45%, transparent), transparent)\" }} />\n        <svg className=\"pointer-events-none absolute inset-0 size-full opacity-[0.07]\" aria-hidden>\n          <defs>\n            <pattern id=\"sis-grid\" width=\"32\" height=\"32\" patternUnits=\"userSpaceOnUse\">\n              <path d=\"M32 0H0V32\" fill=\"none\" stroke=\"white\" strokeWidth=\"1\" />\n            </pattern>\n          </defs>\n          <rect width=\"100%\" height=\"100%\" fill=\"url(#sis-grid)\" />\n        </svg>\n\n        <div className=\"relative flex items-center gap-2 text-lg font-semibold\">\n          <span className=\"flex size-8 items-center justify-center rounded-lg bg-white text-zinc-950\"><CalendarCheck className=\"size-4\" /></span>\n          Slotwise\n        </div>\n\n        {/* Product mock */}\n        <div className=\"relative mx-auto w-full max-w-md\">\n          <div className=\"rotate-[-2deg] rounded-2xl border border-white/10 bg-white/[0.06] p-4 shadow-2xl backdrop-blur-md\">\n            <div className=\"mb-3 flex items-center justify-between\">\n              <div>\n                <div className=\"text-[11px] text-white/50\">Thursday</div>\n                <div className=\"text-sm font-semibold\">14 bookings · $1,860</div>\n              </div>\n              <div className=\"flex gap-1\">\n                <span className=\"size-2 rounded-full bg-white/30\" />\n                <span className=\"size-2 rounded-full bg-white/30\" />\n                <span className=\"size-2 rounded-full bg-white/60\" />\n              </div>\n            </div>\n            <div className=\"grid grid-cols-3 gap-2 text-[10px] text-white/60\">\n              {[\"Sofia\", \"Liam\", \"Amara\"].map((n) => <div key={n} className=\"rounded-md bg-white/5 px-2 py-1\">{n}</div>)}\n            </div>\n            <div className=\"relative mt-2 h-56\">\n              {[0, 25, 50, 75].map((y) => <div key={y} className=\"absolute inset-x-0 border-t border-dashed border-white/10\" style={{ top: `${y}%` }} />)}\n              {AGENDA.map((a, i) => (\n                <div\n                  key={i}\n                  className=\"absolute overflow-hidden rounded-md border-l-2 px-1.5 py-1 text-[10px] font-medium\"\n                  style={{ left: `calc(${a.col} * 33.333% + 2px)`, width: \"calc(33.333% - 6px)\", top: `${a.top}%`, height: `${a.h}%`, borderColor: a.tone, background: `color-mix(in oklch, ${a.tone} 30%, transparent)` }}\n                >\n                  {a.label}\n                </div>\n              ))}\n            </div>\n          </div>\n          <div className=\"absolute -right-4 -bottom-6 flex items-center gap-2 rounded-xl border border-white/10 bg-zinc-900/90 px-3 py-2 text-xs shadow-xl\">\n            <span className=\"flex size-6 items-center justify-center rounded-full bg-emerald-500/20 text-emerald-400\"><CheckCircle2 className=\"size-3.5\" /></span>\n            New booking · Gel nails 3:30 PM\n          </div>\n        </div>\n\n        {/* Testimonial */}\n        <div className=\"relative max-w-md\">\n          <Quote className=\"mb-3 size-6 text-white/40\" />\n          <p key={slide} className=\"animate-in text-lg leading-relaxed font-medium duration-500 fade-in slide-in-from-bottom-2\">{t.quote}</p>\n          <div className=\"mt-4 flex items-center justify-between\">\n            <div className=\"flex items-center gap-3\">\n              <span className=\"flex size-9 items-center justify-center rounded-full bg-white/10 text-xs font-semibold\">{t.initials}</span>\n              <div>\n                <div className=\"text-sm font-medium\">{t.name}</div>\n                <div className=\"text-xs text-white/60\">{t.role}</div>\n              </div>\n            </div>\n            <div className=\"flex gap-1.5\">\n              {TESTIMONIALS.map((x, i) => (\n                <button key={x.name} type=\"button\" aria-label={`Show testimonial ${i + 1}`} onClick={() => setSlide(i)} className={cn(\"h-1.5 rounded-full transition-all\", i === slide ? \"w-6 bg-white\" : \"w-1.5 bg-white/30 hover:bg-white/60\")} />\n              ))}\n            </div>\n          </div>\n        </div>\n      </aside>\n\n      {/* Form */}\n      <main className=\"flex items-center justify-center px-4 py-10 sm:px-8\">\n        <div className=\"w-full max-w-sm\">\n          {status === \"success\" ? (\n            <div className=\"flex animate-in flex-col items-center text-center duration-300 fade-in zoom-in-95\">\n              <div className=\"flex size-14 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400\"><CheckCircle2 className=\"size-7\" /></div>\n              <h1 className=\"mt-4 text-2xl font-semibold tracking-tight\">{mode === \"signup\" ? \"Account created\" : \"Welcome back\"}</h1>\n              <p className=\"mt-1 text-sm text-muted-foreground\">Signed in as <span className=\"font-medium text-foreground\">{signedInAs}</span>. Taking you to your calendar…</p>\n              <div className=\"mt-6 h-1 w-full overflow-hidden rounded-full bg-muted\">\n                <div className=\"h-full w-full origin-left animate-in rounded-full bg-primary duration-[2500ms] ease-out slide-in-from-left-full\" />\n              </div>\n              <Button variant=\"ghost\" className=\"mt-6\" onClick={reset}>Sign out</Button>\n            </div>\n          ) : (\n            <>\n              <div className=\"mb-8 flex items-center gap-2 font-semibold lg:hidden\">\n                <span className=\"flex size-7 items-center justify-center rounded-lg bg-primary text-primary-foreground\"><CalendarCheck className=\"size-4\" /></span>\n                Slotwise\n              </div>\n              <h1 className=\"text-2xl font-semibold tracking-tight\">{mode === \"signin\" ? \"Sign in to Slotwise\" : \"Start your free trial\"}</h1>\n              <p className=\"mt-1 text-sm text-muted-foreground\">{mode === \"signin\" ? \"Manage bookings, staff and payments in one place.\" : \"14 days free. No card required.\"}</p>\n\n              <div className=\"mt-6 grid grid-cols-2 gap-2\">\n                <Button variant=\"outline\" size=\"lg\" disabled={busy} onClick={() => social(\"google\")}>\n                  {provider === \"google\" ? <Loader2 className=\"animate-spin\" /> : <GoogleLogo />} Google\n                </Button>\n                <Button variant=\"outline\" size=\"lg\" disabled={busy} onClick={() => social(\"apple\")}>\n                  {provider === \"apple\" ? <Loader2 className=\"animate-spin\" /> : <AppleLogo />} Apple\n                </Button>\n              </div>\n\n              <div className=\"my-6 flex items-center gap-3 text-xs text-muted-foreground\">\n                <div className=\"h-px flex-1 bg-border\" /> or with email <div className=\"h-px flex-1 bg-border\" />\n              </div>\n\n              {authError && (\n                <div role=\"alert\" className=\"mb-4 flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2.5 text-sm text-destructive\">\n                  <AlertCircle className=\"mt-0.5 size-4 shrink-0\" /> {authError}\n                </div>\n              )}\n              {notice && (\n                <div role=\"status\" className=\"mb-4 flex items-start gap-2 rounded-lg border border-emerald-500/30 bg-emerald-500/10 px-3 py-2.5 text-sm text-emerald-700 dark:text-emerald-400\">\n                  <Mail className=\"mt-0.5 size-4 shrink-0\" /> {notice}\n                </div>\n              )}\n\n              <form noValidate onSubmit={submit} className=\"flex flex-col gap-4\">\n                {mode === \"signup\" && (\n                  <div className=\"flex flex-col gap-1.5\">\n                    <Label htmlFor=\"sis-name\">Full name</Label>\n                    <Input id=\"sis-name\" className=\"h-10\" autoComplete=\"name\" placeholder=\"Emma Clarke\" value={form.name} aria-invalid={!!show_(\"name\")} onChange={(e) => setForm({ ...form, name: e.target.value })} />\n                    {show_(\"name\") && <p className=\"text-xs text-destructive\">{errors.name}</p>}\n                  </div>\n                )}\n                <div className=\"flex flex-col gap-1.5\">\n                  <Label htmlFor=\"sis-email\">Work email</Label>\n                  <div className=\"relative\">\n                    <Mail className=\"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground\" />\n                    <Input id=\"sis-email\" type=\"email\" className=\"h-10 pl-9\" autoComplete=\"email\" placeholder=\"you@yourstudio.com\" value={form.email} aria-invalid={!!show_(\"email\")} onChange={(e) => setForm({ ...form, email: e.target.value })} />\n                  </div>\n                  {show_(\"email\") && <p className=\"text-xs text-destructive\">{errors.email}</p>}\n                </div>\n                <div className=\"flex flex-col gap-1.5\">\n                  <div className=\"flex items-center justify-between\">\n                    <Label htmlFor=\"sis-password\">Password</Label>\n                    {mode === \"signin\" && <button type=\"button\" onClick={forgot} className=\"text-xs font-medium text-primary hover:underline\">Forgot password?</button>}\n                  </div>\n                  <div className=\"relative\">\n                    <Lock className=\"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground\" />\n                    <Input id=\"sis-password\" type={show ? \"text\" : \"password\"} className=\"h-10 px-9\" autoComplete={mode === \"signin\" ? \"current-password\" : \"new-password\"} placeholder=\"••••••••\" value={form.password} aria-invalid={!!show_(\"password\")} onChange={(e) => setForm({ ...form, password: e.target.value })} />\n                    <button type=\"button\" onClick={() => setShow(!show)} aria-label={show ? \"Hide password\" : \"Show password\"} className=\"absolute top-1/2 right-2 flex size-7 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground\">\n                      {show ? <EyeOff className=\"size-4\" /> : <Eye className=\"size-4\" />}\n                    </button>\n                  </div>\n                  {show_(\"password\") && <p className=\"text-xs text-destructive\">{errors.password}</p>}\n                </div>\n                {mode === \"signin\" && (\n                  <label className=\"flex items-center gap-2 text-sm\">\n                    <Checkbox checked={remember} onCheckedChange={(v) => setRemember(v === true)} />\n                    Keep me signed in for 30 days\n                  </label>\n                )}\n                <Button type=\"submit\" size=\"lg\" className=\"h-10\" disabled={busy || attempts === 0}>\n                  {status === \"loading\" ? <><Loader2 className=\"animate-spin\" /> {mode === \"signin\" ? \"Signing in…\" : \"Creating account…\"}</> : <>{mode === \"signin\" ? \"Sign in\" : \"Create account\"} <ArrowRight /></>}\n                </Button>\n                {attempts === 0 && <Button type=\"button\" variant=\"link\" onClick={reset}>Try again with a different account</Button>}\n              </form>\n\n              <p className=\"mt-6 text-center text-sm text-muted-foreground\">\n                {mode === \"signin\" ? \"New to Slotwise? \" : \"Already have an account? \"}\n                <button type=\"button\" className=\"font-medium text-primary hover:underline\" onClick={() => { setMode(mode === \"signin\" ? \"signup\" : \"signin\"); setTouched(false); setAuthError(null); setNotice(null) }}>\n                  {mode === \"signin\" ? \"Start a free trial\" : \"Sign in\"}\n                </button>\n              </p>\n              <p className=\"mt-8 rounded-lg bg-muted px-3 py-2 text-center text-xs text-muted-foreground\">Demo: any password signs you in. Type <code className=\"font-mono font-semibold text-foreground\">wrong</code> to see the error state.</p>\n            </>\n          )}\n        </div>\n      </main>\n    </div>\n  )\n}\n\nfunction GoogleLogo() {\n  return (\n    <svg viewBox=\"0 0 24 24\" className=\"size-4\" aria-hidden>\n      <path fill=\"#4285F4\" d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.27-4.74 3.27-8.1z\" />\n      <path fill=\"#34A853\" d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z\" />\n      <path fill=\"#FBBC05\" d=\"M5.84 14.1a6.6 6.6 0 0 1 0-4.2V7.07H2.18a11 11 0 0 0 0 9.86l3.66-2.84z\" />\n      <path fill=\"#EA4335\" d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1A11 11 0 0 0 2.18 7.07l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z\" />\n    </svg>\n  )\n}\n\nfunction AppleLogo() {\n  return (\n    <svg viewBox=\"0 0 24 24\" className=\"size-4\" fill=\"currentColor\" aria-hidden>\n      <path d=\"M16.37 12.6c-.03-2.6 2.12-3.85 2.22-3.91-1.21-1.77-3.09-2.01-3.76-2.04-1.6-.16-3.12.94-3.93.94-.81 0-2.06-.92-3.39-.89-1.74.03-3.35 1.01-4.25 2.57-1.81 3.14-.46 7.79 1.3 10.34.86 1.25 1.89 2.65 3.24 2.6 1.3-.05 1.79-.84 3.36-.84 1.57 0 2.01.84 3.39.81 1.4-.02 2.29-1.27 3.14-2.53.99-1.45 1.4-2.85 1.42-2.93-.03-.01-2.72-1.04-2.74-4.12zM13.79 4.96c.72-.87 1.2-2.07 1.07-3.27-1.03.04-2.28.69-3.02 1.55-.66.77-1.24 1.99-1.09 3.17 1.15.09 2.32-.58 3.04-1.45z\" />\n    </svg>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/goodui/sign-in-split.tsx"
    }
  ],
  "categories": [
    "auth"
  ],
  "type": "registry:block"
}