import type { Metadata } from "next";
import Link from "next/link";
import { ArrowLeft, KeyRound } from "lucide-react";
import { getSettings } from "@/lib/settings";

export const metadata: Metadata = { title: "Reset password" };

export default async function ForgotPasswordPage() {
  const settings = await getSettings();
  return (
    <div>
      <Link href="/login" className="inline-flex items-center gap-1 text-sm text-fg-muted hover:text-fg">
        <ArrowLeft className="size-4" /> Back to sign in
      </Link>
      <h1 className="mt-6 text-2xl font-semibold tracking-tight">Reset your password</h1>
      <p className="mt-1 text-sm text-fg-muted">{settings.businessName} is a private system: passwords are reset by the administrator, who sets a new one from your worker profile. You will be signed out of every device and can sign in with the new password immediately.</p>
      <div className="mt-8 rounded-lg border border-border bg-surface p-4 text-sm">
        <KeyRound className="mb-2 size-5 text-primary" />
        <p className="font-medium">Contact the administrator</p>
        <p className="mt-1 text-fg-muted">
          {settings.contactEmail} · {settings.contactPhone}
        </p>
      </div>
    </div>
  );
}
