+ {/* Background layers */}
+
+
+
+ {/* Card with ShineBorder */}
+
+
+
+
+

+
+
+
+ {step === "mfa" ? "Multi‑Factor Authentication" : ""}
- )}
-
-
- >
- )}
-
-
+
+ {step === "credentials" ? (
+ <>
+
Username
+
setUsername(e.target.value)}
+ margin="dense"
+ InputProps={{ sx: { borderRadius: 2 } }}
+ />
+
+ Password
+ setPassword(e.target.value)}
+ margin="dense"
+ InputProps={{ sx: { borderRadius: 2 } }}
+ />
+
+ {error && {error}
}
+
+
+ >
+ ) : (
+ <>
+ {mfaStage === "setup" ? (
+ <>
+
+ Scan the QR code with your authenticator app, then enter the 6‑digit code to
+ complete setup for {username}.
+
+ {setupQr ? (
+
+
+
+ ) : null}
+ {formattedSecret ? (
+
+
Manual code
+
{formattedSecret}
+
+ ) : null}
+ {setupUri ? (
+
+ {setupUri}
+
+ ) : null}
+ >
+ ) : (
+
+ Enter the 6‑digit code from your authenticator app for {username}.
+
+ )}
+
+ One‑time code
+ {
+ const raw = e.target.value || "";
+ const digits = raw.replace(/\D/g, "").slice(0, 6);
+ setMfaCode(digits);
+ }}
+ disabled={isSubmitting}
+ margin="dense"
+ inputProps={{
+ inputMode: "numeric",
+ pattern: "[0-9]*",
+ maxLength: 6,
+ style: { letterSpacing: "0.4rem", textAlign: "center", fontSize: "1.15rem" }
+ }}
+ autoComplete="one-time-code"
+ placeholder="• • • • • •"
+ />
+
+ {error && {error}
}
+
+
+
+
+ >
+ )}
+
+
+
+
+ >
);
}
+