/* ============================================ LOGIN — Centered card, two inputs, primary + SSO ============================================ */ function LoginScreen({ onLogin }) { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [loading, setLoading] = useState(false); const [showPw, setShowPw] = useState(false); const [error, setError] = useState(null); const submit = async (e) => { e?.preventDefault(); setError(null); if (!/.+@.+\..+/.test(email.trim())) { setError("Enter a valid email."); return; } if (!password) { setError("Password is required."); return; } setLoading(true); try { const { token, user } = await window.API.login(email.trim(), password); window.API.setToken(token); onLogin(user); } catch (err) { setError(err.message || "Login failed."); } finally { setLoading(false); } }; return (
Retrieval-augmented assistance over 4,128 indexed manuals across CNC, hydraulic, electrical, and safety domains. Every answer is citation-grounded and auditable.