import Link from "next/link";
import { AUTH_ROUTES } from "@/features/auth/constants";
import FormMessage from "@/components/form-message";
import SignupForm from "@/features/auth/components/signup-form";
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card";
import { UserPlus } from "lucide-react";

export default async function SignupPage({
  searchParams,
}: {
  searchParams: Promise<{ message: string }>;
}) {
  const { message } = await searchParams;

  return (
    <div className="relative z-10 w-full max-w-md animate-in fade-in slide-in-from-bottom-4 duration-700">
      <FormMessage message={message} />

      <Card className="border-brand-200/30 bg-white/80 shadow-2xl shadow-brand-500/5 backdrop-blur-xl dark:border-brand-800/30 dark:bg-brand-950/70">
        <CardHeader className="space-y-3 text-center">
          <div className="mx-auto mb-2 flex h-16 w-16 items-center justify-center rounded-2xl bg-linear-to-br from-brand-500 to-brand-700 shadow-lg shadow-brand-500/25">
            <UserPlus className="h-7 w-7 text-white" />
          </div>
          <CardTitle className="text-3xl font-bold tracking-tight">
            회원가입
          </CardTitle>
          <CardDescription className="text-base">
            몇 가지 정보만 입력하면 바로 시작할 수 있습니다.
          </CardDescription>
        </CardHeader>

        <CardContent className="space-y-6">
          <SignupForm />

          <p className="text-center text-sm text-muted-foreground">
            이미 계정이 있으신가요?{" "}
            <Link
              href={AUTH_ROUTES.LOGIN}
              className="font-semibold text-brand-600 transition-colors hover:text-brand-700 dark:text-brand-400 dark:hover:text-brand-300"
            >
              로그인 하러 가기
            </Link>
          </p>
        </CardContent>
      </Card>
    </div>
  );
}
