(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{42309:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>a});var n=t(95155),o=t(12115),i=t(73321);function a(){return(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg)"},children:(0,n.jsx)("div",{style:{color:"var(--text-muted)",fontSize:14},children:"Loading…"})}),children:(0,n.jsx)(s,{})})}function s(){let[e,r]=(0,o.useState)(""),[t,a]=(0,o.useState)(null),[s,d]=(0,o.useState)(!1),l=(0,i.useSearchParams)().get("redirect")??"/",u=async r=>{if(r.preventDefault(),e.trim()){d(!0),a(null);try{let r=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(r.ok)window.location.href=l;else{let e=await r.json();a(e.error??"Login failed")}}catch{a("Network error")}finally{d(!1)}}};return(0,n.jsx)("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg)"},children:(0,n.jsxs)("div",{style:{width:340,padding:"32px 28px",background:"var(--bg-panel)",border:"1px solid var(--border)",borderRadius:12,boxShadow:"0 4px 24px rgba(0,0,0,0.08)"},children:[(0,n.jsxs)("div",{style:{textAlign:"center",marginBottom:24},children:[(0,n.jsx)("div",{style:{fontSize:26,fontWeight:750,color:"var(--text)",marginBottom:4,letterSpacing:"-0.01em"},children:"AnnoVibe"}),(0,n.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)"},children:"Enter password to continue"})]}),(0,n.jsxs)("form",{onSubmit:u,children:[(0,n.jsx)("input",{type:"password",value:e,onChange:e=>r(e.target.value),placeholder:"Password",autoFocus:!0,style:{width:"100%",padding:"10px 14px",fontSize:14,background:"var(--bg)",border:`1px solid ${t?"rgba(239,68,68,0.4)":"var(--border)"}`,borderRadius:8,color:"var(--text)",outline:"none",marginBottom:t?8:16},onFocus:e=>{e.currentTarget.style.borderColor="var(--accent)"},onBlur:e=>{e.currentTarget.style.borderColor=t?"rgba(239,68,68,0.4)":"var(--border)"}}),t&&(0,n.jsx)("div",{style:{fontSize:12,color:"#ef4444",marginBottom:12,padding:"6px 10px",background:"rgba(239,68,68,0.06)",borderRadius:6},children:t}),(0,n.jsx)("button",{type:"submit",disabled:s||!e.trim(),style:{width:"100%",padding:"10px 0",fontSize:14,fontWeight:600,background:e.trim()?"var(--accent)":"var(--bg-hover)",color:e.trim()?"#fff":"var(--text-dim)",border:"none",borderRadius:8,cursor:e.trim()?"pointer":"not-allowed",transition:"background 0.15s"},children:s?"Signing in…":"Sign in"})]})]})})}},55444:(e,r,t)=>{Promise.resolve().then(t.bind(t,42309))},73321:(e,r,t)=>{"use strict";var n=t(74645);t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=55444)),_N_E=e.O()}]);