"use client";

import { useLogin } from "@/hooks/useLogin";
import { LoginHeader } from "@/components/auth/LoginHeader";
import { LoginForm } from "@/components/auth/LoginForm";
import { LoginFooter } from "@/components/auth/LoginFooter";

export default function LoginPage() {
  const {
    formData,
    isLoading,
    error,
    showPassword,
    isPopMode,
    handleInputChange,
    handleLogin,
    togglePasswordVisibility,
    togglePopMode,
  } = useLogin();

  return (
    <div className="flex min-h-screen flex-col items-center justify-center bg-muted/40 p-4">
      <div className="w-full max-w-md space-y-6">
        <LoginHeader />

        <LoginForm
          formData={formData}
          isLoading={isLoading}
          error={error}
          showPassword={showPassword}
          isPopMode={isPopMode}
          onInputChange={handleInputChange}
          onSubmit={handleLogin}
          onTogglePassword={togglePasswordVisibility}
          onTogglePop={togglePopMode}
        />

        <LoginFooter />
      </div>
    </div>
  );
}
