import{ad as g,$ as t,K as e,N as d,M as f,c as p,a as j,E as N,a9 as c}from"./index-CqfREQhZ.js";import{A as w,b as v}from"./admin-B-WQz-EM.js";import"./products-Q1MHi1iw.js";function F(){const x=g(),[a,m]=t.useState(w),[l,h]=t.useState(""),[n,u]=t.useState(!1),[r,i]=t.useState(!1),b=async s=>{s.preventDefault(),i(!0);const o=await v(a,l);i(!1),o.ok?(c.success("Welcome back, Admin"),x({to:"/admin"})):c.error(o.error||"Invalid credentials")};return e.jsxs("div",{className:"min-h-screen grid lg:grid-cols-2",children:[e.jsxs("div",{className:"relative hidden lg:flex flex-col justify-between p-12 bg-[#002D72] text-white overflow-hidden",children:[e.jsxs("div",{className:"relative z-10 flex items-center gap-3",children:[e.jsx("img",{src:d,alt:"",className:"w-12 h-12 bg-white rounded-xl p-1.5"}),e.jsxs("div",{className:"font-display font-extrabold text-xl",children:["AMAZING ",e.jsx("span",{className:"text-[#FF7A00]",children:"SOKO"})]})]}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("h2",{className:"text-4xl font-extrabold leading-tight mb-4",children:"Manage your store with confidence."}),e.jsx("p",{className:"text-white/70 max-w-md",children:"Premium ecommerce admin built for speed, clarity and growth."})]}),e.jsx("div",{className:"relative z-10 text-xs text-white/50",children:"© 2026 Amazing Soko."}),e.jsx("div",{className:"absolute -top-32 -right-32 w-96 h-96 bg-[#FF7A00]/30 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute -bottom-40 -left-20 w-96 h-96 bg-white/10 rounded-full blur-3xl"})]}),e.jsx("div",{className:"flex items-center justify-center p-6 md:p-12 bg-background",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"lg:hidden flex items-center gap-2 mb-8 justify-center",children:[e.jsx("img",{src:d,alt:"",className:"w-12 h-12"}),e.jsxs("div",{className:"font-display font-extrabold text-xl text-[#002D72]",children:["AMAZING ",e.jsx("span",{className:"text-[#FF7A00]",children:"SOKO"})]})]}),e.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Admin Sign in"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:"Enter your credentials to access the dashboard"}),e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-foreground/80 mb-1.5 block",children:"Email"}),e.jsxs("div",{className:"flex items-center bg-secondary rounded-xl px-4 h-12 border border-transparent focus-within:border-[#FF7A00]",children:[e.jsx(f,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("input",{value:a,onChange:s=>m(s.target.value),type:"email",required:!0,maxLength:255,className:"bg-transparent flex-1 px-3 text-sm outline-none",placeholder:"Info@amazingsoko.com"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-foreground/80 mb-1.5 block",children:"Password"}),e.jsxs("div",{className:"flex items-center bg-secondary rounded-xl px-4 h-12 border border-transparent focus-within:border-[#FF7A00]",children:[e.jsx(p,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("input",{value:l,onChange:s=>h(s.target.value),type:n?"text":"password",required:!0,maxLength:100,className:"bg-transparent flex-1 px-3 text-sm outline-none",placeholder:"••••••••"}),e.jsx("button",{type:"button",onClick:()=>u(s=>!s),className:"text-muted-foreground",children:n?e.jsx(j,{className:"w-4 h-4"}):e.jsx(N,{className:"w-4 h-4"})})]})]}),e.jsx("button",{disabled:r,type:"submit",className:"w-full h-12 rounded-xl bg-[#FF7A00] text-white font-semibold hover:opacity-90 transition disabled:opacity-60",children:r?"Signing in…":"Sign in to Dashboard"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-8 text-center",children:"Protected area. Authorized personnel only."})]})})]})}export{F as component};
