import { jsx as e, jsxs as t, Fragment as d } from "react/jsx-runtime";
import { useState as a } from "react";
import { useTranslation as b } from "react-i18next";
import { Link as p } from "react-router-dom";
import { Mail as m, AlertCircle as v, Loader2 as w, CheckCircle2 as N, ArrowLeft as y } from "lucide-react";
import { T as P, d as j } from "./index-CeEMms9z.js";
function E() {
  const { t: r } = b("auth"), [s, f] = a(""), [o, i] = a(!1), [c, n] = a(null), [u, x] = a(!1), g = async (l) => {
    l.preventDefault(), n(null), i(!0);
    try {
      await j.forgotPassword(s), x(!0);
    } catch (h) {
      n(h?.message || r("common:error"));
    } finally {
      i(!1);
    }
  };
  return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center bg-[var(--bg-primary)] p-8", children: /* @__PURE__ */ t("div", { className: "w-full max-w-md", children: [
    /* @__PURE__ */ e("div", { className: "flex justify-end mb-8", children: /* @__PURE__ */ e(P, {}) }),
    /* @__PURE__ */ t("div", { className: "bg-[var(--bg-secondary)] rounded-2xl shadow-xl p-8", children: [
      u ? /* @__PURE__ */ t("div", { className: "text-center", children: [
        /* @__PURE__ */ e("div", { className: "w-16 h-16 bg-[var(--success-bg)] rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ e(N, { className: "w-10 h-10 text-[var(--success-text)]" }) }),
        /* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-[var(--text-primary)] mb-2", children: r("forgotPasswordPage.successTitle") }),
        /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)] mb-6", children: r("forgotPasswordPage.successMessage", { email: s }) }),
        /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-tertiary)]", children: r("forgotPasswordPage.checkSpam") })
      ] }) : /* @__PURE__ */ t(d, { children: [
        /* @__PURE__ */ t("div", { className: "text-center mb-8", children: [
          /* @__PURE__ */ e("div", { className: "w-16 h-16 bg-[var(--info-bg)] rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ e(m, { className: "w-8 h-8 text-[var(--info-text)]" }) }),
          /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-[var(--text-primary)] mb-2", children: r("forgotPasswordPage.pageTitle") }),
          /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)]", children: r("forgotPasswordPage.description") })
        ] }),
        c && /* @__PURE__ */ t("div", { className: "mb-6 p-4 bg-[var(--error-bg)] border border-[var(--error-border)] rounded-lg flex items-start gap-3", children: [
          /* @__PURE__ */ e(v, { className: "w-5 h-5 text-[var(--error-text)] flex-shrink-0 mt-0.5" }),
          /* @__PURE__ */ e("p", { className: "text-sm text-[var(--error-text)]", children: c })
        ] }),
        /* @__PURE__ */ t("form", { onSubmit: g, className: "space-y-4", children: [
          /* @__PURE__ */ t("div", { children: [
            /* @__PURE__ */ e("label", { htmlFor: "email", className: "block text-sm font-medium text-[var(--text-secondary)] mb-2", children: r("forgotPasswordPage.email") }),
            /* @__PURE__ */ t("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(m, { className: "h-5 w-5 text-[var(--text-tertiary)]" }) }),
              /* @__PURE__ */ e(
                "input",
                {
                  id: "email",
                  type: "email",
                  value: s,
                  onChange: (l) => f(l.target.value),
                  className: "block w-full pl-10 pr-3 py-2.5 border border-[var(--border-color)] rounded-lg bg-[var(--bg-card)] text-[var(--text-primary)] placeholder-[var(--text-tertiary)] focus:ring-2 focus:ring-[var(--info-border)] focus:border-transparent",
                  placeholder: r("forgotPasswordPage.emailPlaceholder"),
                  required: !0,
                  autoComplete: "email",
                  disabled: o
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ e(
            "button",
            {
              type: "submit",
              disabled: o,
              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: o ? /* @__PURE__ */ t(d, { children: [
                /* @__PURE__ */ e(w, { className: "h-5 w-5 animate-spin" }),
                r("forgotPasswordPage.submitting")
              ] }) : r("forgotPasswordPage.submitButton")
            }
          )
        ] })
      ] }),
      /* @__PURE__ */ e("div", { className: "mt-6 pt-6 border-t border-[var(--border-color)]", children: /* @__PURE__ */ t(
        p,
        {
          to: "/login",
          className: "flex items-center justify-center gap-2 text-sm text-[var(--text-secondary)] hover:text-[var(--info-text)] transition-colors",
          children: [
            /* @__PURE__ */ e(y, { className: "w-4 h-4" }),
            r("forgotPasswordPage.backToLogin")
          ]
        }
      ) })
    ] })
  ] }) });
}
export {
  E as ForgotPasswordPage
};
//# sourceMappingURL=ForgotPasswordPage-CdsDMnq1.js.map
