// ─── K&N Elite — Login / OTP (unified light) ─── const { useState, useEffect } = React; function ScreenLogin({ onSuccess, prefillPhone }) { const { t } = useI18n(); const [step, setStep] = useState("phone"); const [phone, setPhone] = useState(prefillPhone || "+34 "); const [code, setCode] = useState(["", "", "", "", "", ""]); const [resend, setResend] = useState(60); useEffect(() => { if (step !== "code") return; const id = setInterval(() => setResend(r => Math.max(0, r - 1)), 1000); return () => clearInterval(id); }, [step]); const setDigit = (i, v) => { if (!/^\d?$/.test(v)) return; const arr = [...code]; arr[i] = v; setCode(arr); if (v && i < 5) { const next = document.getElementById("d-" + (i + 1)); next && next.focus(); } if (arr.every(x => x !== "")) setTimeout(() => onSuccess(phone), 400); }; return (