import React, { useState } from "react"; import { Link, useNavigate } from "react-router-dom"; import { motion } from "framer-motion"; import { BrainCircuit, Mail, Lock, ArrowRight } from "lucide-react"; import { Button } from "../../components/ui/Button"; import { Input } from "../../components/ui/Input"; import { useToast } from "../../components/ui/Toast"; import { supabase } from "../../utils/supabaseClient"; export default function Login() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [isLoading, setIsLoading] = useState(false); const navigate = useNavigate(); const { addToast } = useToast(); const handleLogin = async (e) => { e.preventDefault(); setIsLoading(true); try { const { data, error } = await supabase.auth.signInWithPassword({ email, password, }); if (error) throw error; addToast({ title: "Welcome Back!", description: "Successfully logged into ExamCraft.AI", variant: "success", }); navigate("/app"); } catch (error) { addToast({ title: "Login Failed", description: error.message || "Invalid credentials. Please try again.", variant: "destructive", }); } finally { setIsLoading(false); } }; return (
{/* Left split screen (Illustration/Info) */} {/* Animated fluid blob */}
ExamCraft.AI

Streamline your
Exam Preparation.

The premium AI toolkit for modern educators. Upload, configure, and generate in seconds.

{/* Decorative Graphic or Testimonial Placeholder */}

"ExamCraft.AI cut my paper-setting time from hours to literally minutes. The AI quality is astounding."

JD

Dr. Jane Doe

University Professor

{/* Right split screen (Form) */}
ExamCraft.AI

Sign in

Don't have an account? Create one

setEmail(e.target.value)} required className="pl-10 h-12 text-base" />
setPassword(e.target.value)} required className="pl-10 h-12 text-base" />
Forgot password?
Secure Login
); }