(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{29623:(e,r,t)=>{"use strict";t.d(r,{default:()=>c});var s=t(73365),l=t(1521),n=t(50627),o=t(66542),a=t(18510),u=t(59534),d=t.n(u);function c(){let[e,r]=(0,l.useState)(""),[t,u]=(0,l.useState)(""),[c,i]=(0,l.useState)(""),[b,m]=(0,l.useState)(""),x=(0,n.useRouter)(),{mutate:h,isLoading:p}=(0,o.vz)(),f=(0,l.useRef)(null);(0,l.useEffect)(()=>{a.Ay.fromTo(f.current,{opacity:0,y:40},{opacity:1,y:0,duration:1.2,ease:"power3.out"})},[]);let g=async r=>{r.preventDefault(),i(""),m(""),h({identifier:e,password:t},{onSuccess:e=>{m("Login successful! Redirecting..."),setTimeout(()=>{x.push("/dashboard/".concat(e.user.role))},1e3)},onError:e=>{i(e.message)}})};return(0,s.jsx)("section",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-blue-100 px-6 mt-6",children:(0,s.jsxs)("div",{ref:f,className:"w-full max-w-md p-8 rounded-2xl bg-white/60 backdrop-blur-md shadow-2xl border border-blue-100",children:[(0,s.jsx)("h2",{className:"text-3xl font-bold text-blue-900 mb-6 text-center",children:"Welcome Back"}),c&&(0,s.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 my-3 rounded",children:c}),b&&(0,s.jsx)("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 my-3 rounded",children:b}),(0,s.jsxs)("form",{className:"space-y-5 text-black",onSubmit:g,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-blue-800 mb-1 font-medium",children:"Email or Phone Number"}),(0,s.jsx)("input",{type:"text",className:"w-full px-4 py-2 rounded-lg border border-blue-200 focus:ring-2 focus:ring-blue-400 focus:outline-none",placeholder:"you@example.com or +2348012345678",required:!0,value:e,onChange:e=>r(e.target.value)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-blue-800 mb-1 font-medium",children:"Password"}),(0,s.jsx)("input",{type:"password",className:"w-full px-4 py-2 rounded-lg border border-blue-200 focus:ring-2 focus:ring-blue-400 focus:outline-none",placeholder:"••••••••",required:!0,value:t,onChange:e=>u(e.target.value)})]}),(0,s.jsx)("button",{type:"submit",disabled:p,className:"w-full bg-blue-800 hover:bg-blue-900 text-white font-semibold py-2 rounded-lg transition-all duration-300 ".concat(p?"opacity-50 cursor-not-allowed":""),children:p?"Signing in...":"Sign in"})]}),(0,s.jsxs)("p",{className:"text-sm text-blue-800 mt-4 text-center",children:["Don’t have an account?"," ",(0,s.jsx)(d(),{href:"/signup",className:"underline hover:text-blue-600",children:"Sign up"})]}),(0,s.jsxs)("p",{className:"text-sm text-blue-800 mt-4 text-center",children:["Forgot Password?"," ",(0,s.jsx)(d(),{href:"/forgot-password",className:"underline hover:text-blue-600",children:"Click Here"})]})]})})}},59552:(e,r,t)=>{Promise.resolve().then(t.bind(t,46326)),Promise.resolve().then(t.bind(t,81267)),Promise.resolve().then(t.bind(t,29623))}},e=>{var r=r=>e(e.s=r);e.O(0,[3393,5826,9534,1303,2412,3192,4e3,1262,2347,4870,7358],()=>r(59552)),_N_E=e.O()}]);