import { jsx as e, jsxs as r, Fragment as o } from "react/jsx-runtime";
import { useState as t } from "react";
import { Link as x } from "react-router-dom";
import { Mail as c, AlertCircle as b, Loader2 as p, CheckCircle2 as f, ArrowLeft as y } from "lucide-react";
import { T as v, a as N } from "./index-Bs-WcWsP.js";
function A() {
  const [a, m] = t(""), [l, i] = t(!1), [n, d] = t(null), [u, h] = t(!1);
  return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-8", children: /* @__PURE__ */ r("div", { className: "w-full max-w-md", children: [
    /* @__PURE__ */ e("div", { className: "flex justify-end mb-8", children: /* @__PURE__ */ e(v, {}) }),
    /* @__PURE__ */ r("div", { className: "bg-white dark:bg-gray-800 rounded-2xl shadow-xl p-8", children: [
      u ? /* @__PURE__ */ r("div", { className: "text-center", children: [
        /* @__PURE__ */ e("div", { className: "w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ e(f, { className: "w-10 h-10 text-green-600 dark:text-green-400" }) }),
        /* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Email envoyé !" }),
        /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: [
          "Si un compte existe avec l'adresse ",
          /* @__PURE__ */ e("strong", { children: a }),
          ", vous recevrez un lien de réinitialisation."
        ] }),
        /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "N'oubliez pas de vérifier vos spams." })
      ] }) : /* @__PURE__ */ r(o, { children: [
        /* @__PURE__ */ r("div", { className: "text-center mb-8", children: [
          /* @__PURE__ */ e("div", { className: "w-16 h-16 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ e(c, { className: "w-8 h-8 text-blue-600 dark:text-blue-400" }) }),
          /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white mb-2", children: "Mot de passe oublié ?" }),
          /* @__PURE__ */ e("p", { className: "text-gray-600 dark:text-gray-400", children: "Entrez votre email et nous vous enverrons un lien pour réinitialiser votre mot de passe." })
        ] }),
        n && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-500/10 border border-red-500/20 rounded-lg flex items-start gap-3", children: [
          /* @__PURE__ */ e(b, { className: "w-5 h-5 text-red-500 flex-shrink-0 mt-0.5" }),
          /* @__PURE__ */ e("p", { className: "text-sm text-red-500", children: n })
        ] }),
        /* @__PURE__ */ r("form", { onSubmit: async (s) => {
          s.preventDefault(), d(null), i(!0);
          try {
            await N.forgotPassword(a), h(!0);
          } catch (g) {
            d(g?.message || "Une erreur est survenue");
          } finally {
            i(!1);
          }
        }, className: "space-y-4", children: [
          /* @__PURE__ */ r("div", { children: [
            /* @__PURE__ */ e("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: "Adresse email" }),
            /* @__PURE__ */ r("div", { className: "relative", children: [
              /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ e(c, { className: "h-5 w-5 text-gray-400" }) }),
              /* @__PURE__ */ e(
                "input",
                {
                  id: "email",
                  type: "email",
                  value: a,
                  onChange: (s) => m(s.target.value),
                  className: "block w-full pl-10 pr-3 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent",
                  placeholder: "vous@exemple.com",
                  required: !0,
                  autoComplete: "email",
                  disabled: l
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ e(
            "button",
            {
              type: "submit",
              disabled: l,
              className: "w-full flex items-center justify-center gap-2 px-4 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white rounded-lg font-medium hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 transition-all",
              children: l ? /* @__PURE__ */ r(o, { children: [
                /* @__PURE__ */ e(p, { className: "h-5 w-5 animate-spin" }),
                "Envoi en cours..."
              ] }) : "Envoyer le lien"
            }
          )
        ] })
      ] }),
      /* @__PURE__ */ e("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ r(
        x,
        {
          to: "/login",
          className: "flex items-center justify-center gap-2 text-sm text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",
          children: [
            /* @__PURE__ */ e(y, { className: "w-4 h-4" }),
            "Retour à la connexion"
          ]
        }
      ) })
    ] })
  ] }) });
}
export {
  A as ForgotPasswordPage
};
//# sourceMappingURL=ForgotPasswordPage-D1S5AEwg.js.map
