import{r as n,j as e,L as c,A as x}from"./index-XAQEFxR0.js";const b=()=>{const[l,m]=n.useState(""),[s,t]=n.useState("idle"),[i,r]=n.useState(""),u=async a=>{a.preventDefault(),t("loading"),r("");try{const o=await fetch(`${x}/api/auth/forgot-password`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l})}),d=await o.json();o.ok?(t("success"),r(d.message||"Password reset email sent. Please check your inbox.")):(t("error"),r(d.message||"Failed to send reset email."))}catch{t("error"),r("An error occurred. Please try again.")}};return e.jsxs("div",{className:"min-h-screen bg-infosec-bg flex items-center justify-center px-4 relative overflow-hidden",children:[e.jsxs("div",{className:"absolute top-0 left-0 w-full h-full overflow-hidden z-0 pointer-events-none",children:[e.jsx("div",{className:"absolute top-[-10%] right-[-10%] w-[40%] h-[40%] bg-infosec-accent/10 rounded-full blur-[100px]"}),e.jsx("div",{className:"absolute bottom-[-10%] left-[-10%] w-[40%] h-[40%] bg-blue-600/10 rounded-full blur-[100px]"})]}),e.jsxs("div",{className:"max-w-md w-full bg-[#1a1b1e]/80 backdrop-blur-xl border border-gray-800 rounded-2xl p-8 shadow-2xl relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h2",{className:"text-3xl font-bold text-white mb-2",children:"Forgot Password?"}),e.jsx("p",{className:"text-gray-400",children:"Enter your email address and we'll send you a link to reset your password."})]}),s==="success"?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-green-500/10 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx("svg",{className:"w-8 h-8 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("div",{className:"p-4 bg-green-500/10 border border-green-500/50 rounded-lg text-green-500 text-sm mb-6",children:i}),e.jsx(c,{to:"/login",className:"text-infosec-accent hover:text-white font-medium transition",children:"Back to Login"})]}):e.jsxs("form",{onSubmit:u,className:"space-y-6",children:[s==="error"&&e.jsx("div",{className:"p-4 bg-red-500/10 border border-red-500/50 rounded-lg text-red-500 text-sm",children:i}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Email Address"}),e.jsx("input",{type:"email",required:!0,className:"w-full px-4 py-3 bg-[#0e0f11]/50 border border-gray-700 rounded-xl text-white focus:ring-2 focus:ring-infosec-accent focus:border-transparent transition",placeholder:"name@company.com",value:l,onChange:a=>m(a.target.value)})]}),e.jsx("button",{type:"submit",disabled:s==="loading",className:"w-full py-3 px-4 bg-gradient-to-r from-infosec-accent to-purple-600 hover:from-infosec-accentHover hover:to-purple-700 text-white font-bold rounded-xl shadow-lg shadow-infosec-accent/20 transition transform hover:scale-[1.02] disabled:opacity-50 disabled:cursor-not-allowed",children:s==="loading"?"Sending...":"Send Reset Link"}),e.jsx("div",{className:"text-center",children:e.jsx(c,{to:"/login",className:"text-gray-400 hover:text-white text-sm transition",children:"Back to Login"})})]})]})]})};export{b as default};
