{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "auth-tilt-spotlight",
  "type": "registry:component",
  "title": "Auth Tilt Spotlight",
  "description": "A sign-in card that tilts toward the pointer in 3D, with a rotating conic border and a spotlight that follows the cursor across the surface. Includes SSO, email and password with validation, a loading sweep and a drawn success check.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "auth",
    "auth",
    "login",
    "tilt",
    "spotlight",
    "animated border",
    "3d"
  ],
  "docs": "https://hyperblur.dev/effects/auth-tilt-spotlight",
  "files": [
    {
      "path": "registry/hyperblur/auth-tilt-spotlight.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/auth-tilt-spotlight.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface AuthTiltSpotlightValues {\n  email: string;\n  password: string;\n  remember: boolean;\n}\n\nexport interface AuthTiltSpotlightProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  brand?: string;\n  title?: string;\n  subtitle?: string;\n  tilt?: number;\n  defaultEmail?: string;\n  forgotHref?: string;\n  signup?: { label: string; href: string } | null;\n  onSso?: () => void;\n  onSubmit?: (values: AuthTiltSpotlightValues) => boolean | void | Promise<boolean | void>;\n  accent?: string;\n}\n\nconst css = `\n@property --hb-vf1-angle { syntax: \"<angle>\"; inherits: false; initial-value: 0deg; }\n.hb-vf1 {\n  --hb-vf1-accent: #7c5cff;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  min-height: 600px;\n  display: grid;\n  place-items: center;\n  padding: 56px 20px;\n  overflow: hidden;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n}\n.hb-vf1 *, .hb-vf1 *::before, .hb-vf1 *::after { box-sizing: border-box; }\n.hb-vf1 em, .hb-vf1 i { font-style: normal; }\n.hb-vf1::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  pointer-events: none;\n  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.2px);\n  background-size: 22px 22px;\n  mask: radial-gradient(ellipse 60% 70% at 50% 50%, #000 10%, transparent 75%);\n}\n.hb-vf1::after {\n  content: \"\";\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  width: 560px;\n  height: 560px;\n  transform: translate(-50%, -50%);\n  pointer-events: none;\n  background: radial-gradient(circle, color-mix(in srgb, var(--hb-vf1-accent) 22%, transparent), transparent 62%);\n  filter: blur(20px);\n}\n.hb-vf1-stage { position: relative; z-index: 1; width: 100%; max-width: 404px; perspective: 1100px; }\n.hb-vf1-tilt {\n  --hb-vf1-rx: 0deg;\n  --hb-vf1-ry: 0deg;\n  --hb-vf1-x: 50%;\n  --hb-vf1-y: 0%;\n  --hb-vf1-glow: 0;\n  position: relative;\n  border-radius: 22px;\n  padding: 1px;\n  transform: rotateX(var(--hb-vf1-rx)) rotateY(var(--hb-vf1-ry));\n  transform-style: preserve-3d;\n  transition: transform .5s cubic-bezier(.2,.8,.2,1);\n  will-change: transform;\n}\n.hb-vf1-tilt[data-active=\"true\"] { transition: transform .12s linear; }\n.hb-vf1-tilt::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  border-radius: inherit;\n  background: conic-gradient(from var(--hb-vf1-angle), transparent 0deg, color-mix(in srgb, var(--hb-vf1-accent) 90%, #fff) 40deg, transparent 110deg, transparent 180deg, color-mix(in srgb, var(--hb-vf1-accent) 55%, #22d3ee) 220deg, transparent 290deg);\n  animation: hb-vf1-spin 6s linear infinite;\n}\n.hb-vf1-tilt::after {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  border-radius: inherit;\n  background: radial-gradient(180px circle at var(--hb-vf1-x) var(--hb-vf1-y), rgba(255,255,255,.75), transparent 70%);\n  opacity: var(--hb-vf1-glow);\n  transition: opacity .4s;\n}\n.hb-vf1-card {\n  position: relative;\n  z-index: 1;\n  border-radius: 21px;\n  padding: 30px 30px 26px;\n  overflow: hidden;\n  background: linear-gradient(180deg, #151519, #0e0e11 60%);\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04);\n}\n.hb-vf1-card::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  pointer-events: none;\n  background: radial-gradient(260px circle at var(--hb-vf1-x) var(--hb-vf1-y), color-mix(in srgb, var(--hb-vf1-accent) 18%, transparent), transparent 70%);\n  opacity: calc(.35 + var(--hb-vf1-glow) * .65);\n  transition: opacity .4s;\n}\n.hb-vf1-body { position: relative; transform: translateZ(30px); }\n.hb-vf1-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }\n.hb-vf1-logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(140deg, color-mix(in srgb, var(--hb-vf1-accent) 85%, #fff), var(--hb-vf1-accent) 55%, color-mix(in srgb, var(--hb-vf1-accent) 50%, #000)); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 20px -6px var(--hb-vf1-accent); }\n.hb-vf1-title { margin: 0; font-size: 24px; line-height: 1.15; font-weight: 600; letter-spacing: -.025em; }\n.hb-vf1-sub { margin: 8px 0 22px; color: #8f8f8f; font-size: 14px; line-height: 1.55; }\n.hb-vf1-sub a { color: #ededed; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.25); }\n.hb-vf1-sso { width: 100%; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); color: #ededed; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .2s, border-color .2s, transform .2s cubic-bezier(.2,.8,.2,1); }\n.hb-vf1-sso:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); }\n.hb-vf1-sso:active { transform: scale(.985); }\n.hb-vf1-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #6b6b6b; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }\n.hb-vf1-or::before, .hb-vf1-or::after { content: \"\"; flex: 1; height: 1px; background: rgba(255,255,255,.08); }\n.hb-vf1-field { display: block; margin-bottom: 14px; }\n.hb-vf1-label { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 12.5px; color: #a1a1a1; }\n.hb-vf1-label a { color: #a1a1a1; text-decoration: none; transition: color .2s; }\n.hb-vf1-label a:hover { color: #ededed; }\n.hb-vf1-control { position: relative; }\n.hb-vf1-input { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.09); background: #0a0a0c; color: #ededed; font: inherit; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }\n.hb-vf1-input::placeholder { color: #5a5a5f; }\n.hb-vf1-input:focus { border-color: color-mix(in srgb, var(--hb-vf1-accent) 70%, #fff 0%); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-vf1-accent) 18%, transparent); }\n.hb-vf1-input[aria-invalid=\"true\"] { border-color: #f05d5e; box-shadow: 0 0 0 4px rgba(240,93,94,.14); }\n.hb-vf1-input[data-pad=\"true\"] { padding-right: 64px; }\n.hb-vf1-eye { position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #8f8f8f; font: inherit; font-size: 12px; cursor: pointer; transition: color .2s, background .2s; }\n.hb-vf1-eye:hover { color: #ededed; background: rgba(255,255,255,.06); }\n.hb-vf1-err { margin: 6px 0 0; color: #f58a8b; font-size: 12px; }\n.hb-vf1-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; }\n.hb-vf1-check { display: inline-flex; align-items: center; gap: 9px; color: #a1a1a1; font-size: 13px; cursor: pointer; user-select: none; }\n.hb-vf1-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }\n.hb-vf1-box { width: 17px; height: 17px; border-radius: 5px; border: 1px solid rgba(255,255,255,.18); display: grid; place-items: center; transition: background .2s, border-color .2s; }\n.hb-vf1-box svg { opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.5,1); }\n.hb-vf1-check input:checked + .hb-vf1-box { background: var(--hb-vf1-accent); border-color: var(--hb-vf1-accent); }\n.hb-vf1-check input:checked + .hb-vf1-box svg { opacity: 1; transform: scale(1); }\n.hb-vf1-check input:focus-visible + .hb-vf1-box { outline: 2px solid var(--hb-vf1-accent); outline-offset: 2px; }\n.hb-vf1-submit { position: relative; width: 100%; height: 46px; border: 0; border-radius: 12px; overflow: hidden; font: inherit; font-size: 14.5px; font-weight: 600; color: #fff; cursor: pointer; background: linear-gradient(180deg, color-mix(in srgb, var(--hb-vf1-accent) 88%, #fff), var(--hb-vf1-accent)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 30px -12px var(--hb-vf1-accent); transition: transform .2s cubic-bezier(.2,.8,.2,1), filter .2s; }\n.hb-vf1-submit:hover { filter: brightness(1.08); }\n.hb-vf1-submit:active { transform: scale(.985); }\n.hb-vf1-submit:disabled { cursor: progress; }\n.hb-vf1-submit::after { content: \"\"; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-100%); }\n.hb-vf1-submit:hover::after { transform: translateX(100%); transition: transform .8s cubic-bezier(.2,.8,.2,1); }\n.hb-vf1-spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; vertical-align: -3px; animation: hb-vf1-rot .7s linear infinite; }\n.hb-vf1-alert { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(240,93,94,.1); border: 1px solid rgba(240,93,94,.25); color: #f8a5a6; font-size: 13px; }\n.hb-vf1 :is(.hb-vf1-sso, .hb-vf1-submit, .hb-vf1-eye, .hb-vf1-sub a, .hb-vf1-label a, .hb-vf1-again):focus-visible { outline: 2px solid var(--hb-vf1-accent); outline-offset: 3px; }\n.hb-vf1-done { display: grid; justify-items: center; text-align: center; padding: 26px 0 8px; animation: hb-vf1-in .6s cubic-bezier(.2,.8,.2,1) both; }\n.hb-vf1-ring { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; background: radial-gradient(circle, color-mix(in srgb, var(--hb-vf1-accent) 30%, transparent), transparent 70%); }\n.hb-vf1-ring path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: hb-vf1-draw .55s .2s cubic-bezier(.65,0,.35,1) forwards; }\n.hb-vf1-ring circle { stroke-dasharray: 190; stroke-dashoffset: 190; animation: hb-vf1-draw .7s cubic-bezier(.65,0,.35,1) forwards; }\n.hb-vf1-again { margin-top: 18px; border: 0; background: none; color: #8f8f8f; font: inherit; font-size: 13px; cursor: pointer; border-radius: 6px; }\n.hb-vf1-again:hover { color: #ededed; }\n.hb-vf1-foot { margin: 18px 0 0; text-align: center; color: #6b6b6b; font-size: 12px; }\n@keyframes hb-vf1-spin { to { --hb-vf1-angle: 360deg; } }\n@keyframes hb-vf1-rot { to { transform: rotate(360deg); } }\n@keyframes hb-vf1-draw { to { stroke-dashoffset: 0; } }\n@keyframes hb-vf1-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-vf1-tilt, .hb-vf1-tilt::before, .hb-vf1-done, .hb-vf1-spin, .hb-vf1-submit::after { animation: none !important; transition: none !important; transform: none !important; }\n  .hb-vf1-ring path, .hb-vf1-ring circle { animation: none; stroke-dashoffset: 0; }\n}\n`;\n\nconst isEmail = (v: string) => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/.test(v.trim());\n\nexport function AuthTiltSpotlight({\n  brand = \"Northbeam\",\n  title = \"Welcome back\",\n  subtitle = \"Sign in to pick up where your team left off.\",\n  tilt = 9,\n  defaultEmail = \"\",\n  forgotHref = \"#forgot\",\n  signup = { label: \"Create an account\", href: \"#signup\" },\n  onSso,\n  onSubmit,\n  accent = \"#7c5cff\",\n  className,\n  style,\n  ...rest\n}: AuthTiltSpotlightProps) {\n  const id = React.useId();\n  const tiltRef = React.useRef<HTMLDivElement>(null);\n  const [email, setEmail] = React.useState(defaultEmail);\n  const [password, setPassword] = React.useState(\"\");\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<\"idle\" | \"loading\" | \"success\">(\"idle\");\n  const [error, setError] = React.useState<string | null>(null);\n\n  const emailError = touched && !isEmail(email) ? \"Enter a valid work email.\" : null;\n  const passError = touched && password.length < 8 ? \"Use at least 8 characters.\" : null;\n\n  const reduce = React.useCallback(() => typeof window !== \"undefined\" && window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches, []);\n\n  const onMove = (e: React.PointerEvent<HTMLDivElement>) => {\n    const el = tiltRef.current;\n    if (!el) return;\n    const r = el.getBoundingClientRect();\n    const px = (e.clientX - r.left) / r.width;\n    const py = (e.clientY - r.top) / r.height;\n    el.style.setProperty(\"--hb-vf1-x\", `${(px * 100).toFixed(1)}%`);\n    el.style.setProperty(\"--hb-vf1-y\", `${(py * 100).toFixed(1)}%`);\n    el.style.setProperty(\"--hb-vf1-glow\", \"1\");\n    if (!reduce()) {\n      el.style.setProperty(\"--hb-vf1-rx\", `${((0.5 - py) * tilt).toFixed(2)}deg`);\n      el.style.setProperty(\"--hb-vf1-ry\", `${((px - 0.5) * tilt).toFixed(2)}deg`);\n    }\n    el.dataset.active = \"true\";\n  };\n\n  const onLeave = () => {\n    const el = tiltRef.current;\n    if (!el) return;\n    el.style.setProperty(\"--hb-vf1-rx\", \"0deg\");\n    el.style.setProperty(\"--hb-vf1-ry\", \"0deg\");\n    el.style.setProperty(\"--hb-vf1-glow\", \"0\");\n    el.dataset.active = \"false\";\n  };\n\n  const submit = async (e: React.FormEvent) => {\n    e.preventDefault();\n    setTouched(true);\n    setError(null);\n    if (!isEmail(email) || password.length < 8) return;\n    setStatus(\"loading\");\n    try {\n      const result = onSubmit\n        ? await onSubmit({ email: email.trim(), password, remember })\n        : await new Promise<boolean>((res) => setTimeout(() => res(true), 1100));\n      if (result === false) {\n        setStatus(\"idle\");\n        setError(\"That email and password do not match.\");\n        return;\n      }\n      setStatus(\"success\");\n    } catch (err) {\n      setStatus(\"idle\");\n      setError(err instanceof Error ? err.message : \"Something went wrong. Try again.\");\n    }\n  };\n\n  return (\n    <section className={[\"hb-vf1\", className].filter(Boolean).join(\" \")} style={{ \"--hb-vf1-accent\": accent, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-auth-tilt-spotlight\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vf1-stage\">\n        <div ref={tiltRef} className=\"hb-vf1-tilt\" onPointerMove={onMove} onPointerLeave={onLeave}>\n          <div className=\"hb-vf1-card\">\n            <div className=\"hb-vf1-body\">\n              <div className=\"hb-vf1-mark\">\n                <span className=\"hb-vf1-logo\" aria-hidden=\"true\">\n                  <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"><path d=\"M3 12.5 8 3l5 9.5M5.4 8.5h5.2\" stroke=\"#fff\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n                </span>\n                {brand}\n              </div>\n              {status === \"success\" ? (\n                <div className=\"hb-vf1-done\" role=\"status\">\n                  <div className=\"hb-vf1-ring\">\n                    <svg width=\"56\" height=\"56\" viewBox=\"0 0 64 64\" fill=\"none\" aria-hidden=\"true\">\n                      <circle cx=\"32\" cy=\"32\" r=\"29\" stroke={accent} strokeWidth=\"2\" />\n                      <path d=\"M21 33l7.5 7.5L44 25\" stroke=\"#fff\" strokeWidth=\"3\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                    </svg>\n                  </div>\n                  <h2 className=\"hb-vf1-title\">You are in</h2>\n                  <p className=\"hb-vf1-sub\" style={{ margin: \"8px 0 0\" }}>Signed in as {email.trim()}. Loading your workspace.</p>\n                  <button type=\"button\" className=\"hb-vf1-again\" onClick={() => { setStatus(\"idle\"); setPassword(\"\"); setTouched(false); }}>Use another account</button>\n                </div>\n              ) : (\n                <form onSubmit={submit} noValidate>\n                  <h2 className=\"hb-vf1-title\">{title}</h2>\n                  <p className=\"hb-vf1-sub\">\n                    {subtitle}\n                    {signup ? <> New here? <a href={signup.href}>{signup.label}</a></> : null}\n                  </p>\n                  <button type=\"button\" className=\"hb-vf1-sso\" onClick={() => onSso?.()}>\n                    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><rect x=\"2.5\" y=\"7\" width=\"11\" height=\"7\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.4\" /><path d=\"M5 7V5a3 3 0 0 1 6 0v2\" stroke=\"currentColor\" strokeWidth=\"1.4\" /></svg>\n                    Continue with single sign-on\n                  </button>\n                  <div className=\"hb-vf1-or\">or with email</div>\n                  {error ? <p className=\"hb-vf1-alert\" role=\"alert\">{error}</p> : null}\n                  <div className=\"hb-vf1-field\">\n                    <label className=\"hb-vf1-label\" htmlFor={`${id}-e`}><span>Work email</span></label>\n                    <input id={`${id}-e`} className=\"hb-vf1-input\" type=\"email\" autoComplete=\"email\" placeholder=\"maya@northbeam.io\" value={email} onChange={(e) => setEmail(e.target.value)} aria-invalid={emailError ? true : undefined} aria-describedby={emailError ? `${id}-ee` : undefined} />\n                    {emailError ? <p id={`${id}-ee`} className=\"hb-vf1-err\">{emailError}</p> : null}\n                  </div>\n                  <div className=\"hb-vf1-field\">\n                    <div className=\"hb-vf1-label\"><label htmlFor={`${id}-p`}>Password</label><a href={forgotHref}>Forgot?</a></div>\n                    <div className=\"hb-vf1-control\">\n                      <input id={`${id}-p`} className=\"hb-vf1-input\" data-pad=\"true\" type={show ? \"text\" : \"password\"} autoComplete=\"current-password\" placeholder=\"At least 8 characters\" value={password} onChange={(e) => setPassword(e.target.value)} aria-invalid={passError ? true : undefined} aria-describedby={passError ? `${id}-pe` : undefined} />\n                      <button type=\"button\" className=\"hb-vf1-eye\" onClick={() => setShow((s) => !s)} aria-pressed={show} aria-label={show ? \"Hide password\" : \"Show password\"}>{show ? \"Hide\" : \"Show\"}</button>\n                    </div>\n                    {passError ? <p id={`${id}-pe`} className=\"hb-vf1-err\">{passError}</p> : null}\n                  </div>\n                  <div className=\"hb-vf1-row\">\n                    <label className=\"hb-vf1-check\">\n                      <input type=\"checkbox\" checked={remember} onChange={(e) => setRemember(e.target.checked)} />\n                      <span className=\"hb-vf1-box\" aria-hidden=\"true\"><svg width=\"11\" height=\"11\" viewBox=\"0 0 12 12\" fill=\"none\"><path d=\"M2.5 6.2 5 8.6l4.5-5\" stroke=\"#fff\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg></span>\n                      Keep me signed in\n                    </label>\n                  </div>\n                  <button type=\"submit\" className=\"hb-vf1-submit\" disabled={status === \"loading\"} aria-busy={status === \"loading\"}>\n                    {status === \"loading\" ? <><span className=\"hb-vf1-spin\" aria-hidden=\"true\" /> <span style={{ marginLeft: 8 }}>Signing in</span></> : \"Sign in\"}\n                  </button>\n                  <p className=\"hb-vf1-foot\">Protected by device checks and rate limiting.</p>\n                </form>\n              )}\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}