1import{r as a,u as f,a as g,b as j,j as e,S as b,c as v,L as c,C as y,M as N,d as w,B as S,e as L}from"./index-BZjGjbqF.js";const C=()=>{const[t,m]=a.useState(""),[r,d]=a.useState(""),[l,i]=a.useState(!1),[o,n]=a.useState(""),{login:u}=f(),x=g(),p=j().state?.from?.pathname||"/dashboard",h=async s=>{s.preventDefault(),n(""),i(!0);try{await u(t,r),x(p,{replace:!0})}catch{n("Invalid email or password. Please try again.")}finally{i(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(b,{title:"Login | Policy Via",description:"Log in to your Policy Via account to manage your insurance quotes and policies."}),e.jsx("div",{className:"min-h-screen bg-background flex flex-col",children:e.jsx("main",{className:"flex-grow flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-md w-full space-y-8 bg-card p-8 rounded-2xl shadow-lg border border-border",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto h-12 w-12 bg-primary/10 rounded-xl flex items-center justify-center mb-4",children:e.jsx(v,{className:"h-8 w-8 text-primary"})}),e.jsx("h2",{className:"text-3xl font-extrabold text-foreground",children:"Welcome back"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Don't have an account?"," ",e.jsx(c,{to:"/signup",className:"font-medium text-primary hover:text-primary/80 transition-colors",children:"Sign up for free"})]})]}),e.jsxs("form",{className:"mt-8 space-y-6",onSubmit:h,children:[o&&e.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive p-3 rounded-lg flex items-center text-sm",children:[e.jsx(y,{className:"w-5 h-5 mr-2 flex-shrink-0"}),o]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"form-label-premium",htmlFor:"email",children:"Email address"}),e.jsxs("div",{className:"relative",children:[e.jsx(N,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),e.jsx("input",{id:"email",type:"email",required:!0,className:"form-input-premium pl-10",placeholder:"[email protected]",value:t,onChange:s=>m(s.target.value)})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"form-label-premium mb-0",htmlFor:"password",children:"Password"}),e.jsx(c,{to:"/forgot-password",className:"text-sm font-medium text-primary hover:underline",children:"Forgot password?"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(w,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),e.jsx("input",{id:"password",type:"password",required:!0,className:"form-input-premium pl-10",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:r,onChange:s=>d(s.target.value)})]})]})]}),e.jsx(S,{type:"submit",className:"w-full btn-cta",disabled:l,children:l?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"w-5 h-5 mr-2 animate-spin"})," Signing in..."]}):"Sign in"})]})]})})})]})};export{C 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.