1import{c as y,r as x,h as N,u as v,j as e,i as o,k as S}from"./index-CqMBQXEN.js";import{u as k}from"./index.esm-eKDYoqjg.js";import{t as E,o as I,s as h}from"./types-DuGpglP5.js";import{u as P}from"./useMutation-7A9ADe_g.js";import{A as C,a as A}from"./alert-CBQt2O5m.js";import{E as L}from"./eye-off-BNYYr1YN.js";import{E as R}from"./eye-DPVxlail.js";import{L as T}from"./loader-circle-Bq75OwXN.js";import{A as F}from"./arrow-right-DH43H8jY.js";import{C as _}from"./circle-check-BRrpG1IP.js";import{S as q}from"./shield-check-ClBMBS99.js";import{S as z}from"./star-BKTY4xWG.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const H=y("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]),K=[{icon:_,text:"Resume screening & AI scoring"},{icon:q,text:"Secure, compliant hiring workflows"},{icon:H,text:"Save 70% of recruiter time"}],M=I({email:h().email("Email is required"),password:h().min(1,"Password is required")}),u="w-full px-4 py-2.5 rounded-lg border border-gray-200 bg-gray-50 text-sm text-gray-900 placeholder:text-gray-400 hover:border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-400 focus:bg-white transition-all duration-150",g="w-full px-4 py-2.5 rounded-lg border border-red-400 bg-red-50 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-red-400 transition-all duration-150";function Z(){const[n,i]=x.useState(""),[c,p]=x.useState(!1),{toast:f}=N(),b=v(),{register:d,handleSubmit:w,formState:{errors:r}}=k({resolver:E(M),defaultValues:{email:"",password:""}}),a=P({mutationFn:async s=>{var t,m;i("");try{return await S.login(s)}catch(l){throw((t=l.response)==null?void 0:t.status)===401?new Error("Invalid credentials. Please try again."):((m=l.response)==null?void 0:m.status)===500?new Error("Server error. Please try again later."):new Error(l.message||"Something went wrong. Please try again.")}},onSuccess:s=>{f({title:"Login successful!"}),localStorage.removeItem("registrationInfo"),localStorage.setItem("organizationId",s.organization_id.toString()),localStorage.setItem("userId",s.user_id.toString()),localStorage.setItem("authToken",s.access_token),b("/dashboard")},onError:s=>{i(s.message||"Login failed. Please try again.")}}),j=s=>{i(""),a.mutate(s)};return e.jsx("div",{className:"bg-slate-50 py-10 px-4",children:e.jsxs("div",{className:"w-full max-w-5xl mx-auto rounded-2xl shadow-xl overflow-hidden flex min-h-[520px]",children:[e.jsxs("div",{className:"w-[46%] bg-white flex flex-col justify-center px-10 py-10",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 tracking-tight mb-1",children:"Sign in"}),e.jsxs("p",{className:"text-sm text-gray-500",children:["New here?"," ",e.jsx(o,{href:"/register",className:"text-blue-600 font-semibold hover:text-blue-700 transition-colors",children:"Create a free account"})]})]}),n&&e.jsx(C,{variant:"destructive",className:"mb-4 rounded-lg py-2.5 text-sm",children:e.jsx(A,{children:n})}),e.jsxs("form",{onSubmit:w(j),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs font-semibold text-gray-600 mb-1.5 uppercase tracking-wide",children:["Email address ",e.jsx("span",{className:"text-red-400 normal-case tracking-normal",children:"*"})]}),e.jsx("input",{...d("email"),type:"email",placeholder:"[email protected]",disabled:a.isPending,className:r.email?g:u}),r.email&&e.jsx("p",{className:"text-red-500 text-xs mt-1",children:r.email.message})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsxs("label",{className:"text-xs font-semibold text-gray-600 uppercase tracking-wide",children:["Password ",e.jsx("span",{className:"text-red-400 normal-case tracking-normal",children:"*"})]}),e.jsx(o,{href:"/forget-password",className:"text-xs text-blue-600 hover:text-blue-700 font-medium transition-colors",children:"Forgot password?"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{...d("password"),type:c?"text":"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",disabled:a.isPending,className:`${r.password?g:u} pr-11`}),e.jsx("button",{type:"button",onClick:()=>p(s=>!s),disabled:a.isPending,className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors",children:c?e.jsx(L,{className:"w-4 h-4"}):e.jsx(R,{className:"w-4 h-4"})})]}),r.password&&e.jsx("p",{className:"text-red-500 text-xs mt-1",children:r.password.message})]}),e.jsx("button",{type:"submit",disabled:a.isPending,className:"w-full flex items-center justify-center gap-2 bg-blue-600 hover:bg-blue-700 active:scale-[0.98] disabled:opacity-60 disabled:cursor-not-allowed text-white font-semibold rounded-lg py-2.5 text-sm transition-all duration-150",children:a.isPending?e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"w-4 h-4 animate-spin"}),"Signing inâ¦"]}):e.jsxs(e.Fragment,{children:["Sign In ",e.jsx(F,{className:"w-4 h-4"})]})})]}),e.jsx("p",{className:"mt-6 text-center text-xs text-gray-400",children:e.jsx(o,{href:"/",className:"hover:text-blue-600 transition-colors",children:"â Back to Homepage"})})]}),e.jsxs("div",{className:"flex-1 bg-gradient-to-br from-blue-900 via-blue-700 to-blue-600 flex flex-col justify-center p-10 relative overflow-hidden",children:[e.jsx("div",{className:"absolute -top-16 -right-16 w-64 h-64 bg-white/5 rounded-full blur-3xl pointer-events-none"}),e.jsx("div",{className:"absolute -bottom-16 -left-16 w-56 h-56 bg-black/10 rounded-full blur-3xl pointer-events-none"}),e.jsxs("div",{className:"relative z-10 flex flex-col gap-8",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-[1.9rem] font-extrabold text-white leading-tight tracking-tight mb-2",children:["Welcome back.",e.jsx("br",{}),e.jsx("span",{className:"text-blue-200",children:"Keep hiring smarter."})]}),e.jsx("p",{className:"text-blue-100/80 text-sm leading-relaxed",children:"Your AI-powered hiring platform is ready."})]}),e.jsx("div",{className:"space-y-2.5",children:K.map(({icon:s,text:t})=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-7 h-7 bg-white/15 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(s,{className:"w-3.5 h-3.5 text-white"})}),e.jsx("span",{className:"text-white/85 text-sm font-medium",children:t})]},t))}),e.jsxs("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/15",children:[e.jsx("div",{className:"flex gap-0.5 mb-2",children:[...Array(5)].map((s,t)=>e.jsx(z,{className:"w-3.5 h-3.5 text-yellow-400 fill-yellow-400"},t))}),e.jsx("p",{className:"text-white/90 text-sm leading-relaxed mb-3",children:'"Intrvew.AI cut our screening time in half. We hire better candidates faster than ever."'}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-white/20 flex items-center justify-center text-white text-[10px] font-bold flex-shrink-0",children:"SR"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-xs font-semibold",children:"Sarah R."}),e.jsx("p",{className:"text-blue-200/70 text-[11px]",children:"Head of Talent, TechCorp"})]})]})]})]})]})]})})}export{Z as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.