(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[626],{3334:function(e,r,n){Promise.resolve().then(n.bind(n,8991))},9376:function(e,r,n){"use strict";var t=n(5475);n.o(t,"usePathname")&&n.d(r,{usePathname:function(){return t.usePathname}}),n.o(t,"useRouter")&&n.d(r,{useRouter:function(){return t.useRouter}})},8991:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return d}});var t=n(7437),a=n(2265),s=n(9376);function d(){let[e,r]=(0,a.useState)(""),[n,d]=(0,a.useState)(""),[o,c]=(0,a.useState)(""),[l,u]=(0,a.useState)(!1),i=(0,s.useRouter)(),b=async r=>{r.preventDefault(),u(!0),c(""),(await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:n})})).ok?i.push("/dashboard"):c("Invalid username or password"),u(!1)};return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-brand-bg px-4",children:(0,t.jsxs)("div",{className:"w-full max-w-md",children:[(0,t.jsxs)("div",{className:"text-center mb-8",children:[(0,t.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-brand-accent/10 border border-brand-accent/20 mb-4",children:(0,t.jsx)("svg",{className:"w-8 h-8 text-brand-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"})})}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-brand-text",children:"OSKV Labs"}),(0,t.jsx)("p",{className:"text-brand-muted text-sm mt-1",children:"Launch Dashboard"})]}),(0,t.jsxs)("form",{onSubmit:b,className:"bg-brand-card border border-brand-border rounded-xl p-6 space-y-4",children:[o&&(0,t.jsx)("div",{className:"bg-red-500/10 border border-red-500/20 text-red-400 text-sm rounded-lg p-3",children:o}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-brand-muted mb-1.5",children:"Username"}),(0,t.jsx)("input",{type:"text",value:e,onChange:e=>r(e.target.value),className:"w-full bg-brand-bg border border-brand-border rounded-lg px-3 py-2.5 text-brand-text placeholder-brand-muted/50 focus:outline-none focus:border-brand-accent focus:ring-1 focus:ring-brand-accent transition-colors",placeholder:"Enter your username",autoFocus:!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-brand-muted mb-1.5",children:"Password"}),(0,t.jsx)("input",{type:"password",value:n,onChange:e=>d(e.target.value),className:"w-full bg-brand-bg border border-brand-border rounded-lg px-3 py-2.5 text-brand-text placeholder-brand-muted/50 focus:outline-none focus:border-brand-accent focus:ring-1 focus:ring-brand-accent transition-colors",placeholder:"Enter your password"})]}),(0,t.jsx)("button",{type:"submit",disabled:l,className:"w-full bg-brand-accent hover:bg-brand-accent-hover text-white font-medium rounded-lg px-4 py-2.5 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:l?"Signing in...":"Sign In"})]})]})})}}},function(e){e.O(0,[971,117,744],function(){return e(e.s=3334)}),_N_E=e.O()}]);