-
Interactive OTP Sign In form
HTML
CSS
JavaScript
SECURE AUTH
Sign in
Access your account via secure code.
Phone
Email
Phone Number
πΊπΈ +1
Email Address
Get Code
Enter Code
Sent to
Invalid code. Demo: 246810
Verify Identity
β Back to options
β¨
Success!
You've successfully authenticated.
Return to Home
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap'); :root { --primary: #7F77DD; --primary-glow: rgba(127, 119, 221, 0.3); --bg-body: #0f1115; --bg-card: #1c1f26; --bg-input: #12141a; --text-main: #ffffff; --text-sub: #9ca3af; --border: #2d3139; --radius: 16px; } * { box-sizing: border-box; margin: 0; padding: 0; } body { background: var(--bg-body); font-family: 'DM Sans', sans-serif; display: flex; justify-content: center; align-items: center; min-height: 100vh; color: var(--text-main); } .card { background: var(--bg-card); width: 100%; max-width: 400px; padding: 2.5rem; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); position: relative; overflow: hidden; } /* Animated Accent Bar */ .card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #7F77DD, #1D9E75, #7F77DD); background-size: 200% 100%; animation: shimmer 4s linear infinite; } @keyframes shimmer { 0% { background-position: 0% 0%; } 100% { background-position: 200% 0%; } } .badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.05); padding: 6px 12px; border-radius: 99px; font-size: 11px; font-family: 'Space Mono', monospace; color: var(--text-sub); margin-bottom: 1.5rem; border: 1px solid var(--border); } .badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #1D9E75; box-shadow: 0 0 8px #1D9E75; } .step { display: none; } .step.active { display: block; animation: fadeIn 0.4s ease; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .method-toggle { display: flex; background: var(--bg-input); padding: 4px; border-radius: 10px; margin-bottom: 2rem; border: 1px solid var(--border); } .method-btn { flex: 1; padding: 10px; border: none; background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 8px; color: var(--text-sub); transition: 0.3s; } .method-btn.active { background: var(--border); color: #fff; } h2 { font-size: 24px; margin-bottom: 8px; } p.sub { font-size: 14px; color: var(--text-sub); margin-bottom: 1.5rem; line-height: 1.5; } label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; color: var(--text-sub); } .input-row { display: flex; gap: 10px; margin-bottom: 1.5rem; } input { width: 100%; height: 48px; padding: 0 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; font-size: 15px; color: #fff; outline: none; transition: 0.2s; } input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); } .btn { width: 100%; height: 48px; background: var(--primary); color: white; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 15px rgba(127, 119, 221, 0.4); } .btn:hover { transform: translateY(-1px); opacity: 0.95; } .btn:active { transform: translateY(0); } .otp-container { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 2rem; } .otp-input { width: 48px; height: 60px; text-align: center; font-size: 22px; font-family: 'Space Mono', monospace; font-weight: 700; background: var(--bg-input); } .error { color: #ff5f5f; font-size: 13px; text-align: center; margin-bottom: 1rem; display: none; } .back-link { display: block; text-align: center; margin-top: 1.5rem; font-size: 13px; color: var(--text-sub); cursor: pointer; transition: 0.2s; } .back-link:hover { color: #fff; }
let currentMethod = 'phone'; const DEMO_CODE = "246810"; function setMethod(method) { currentMethod = method; document.querySelectorAll('.method-btn').forEach(btn => btn.classList.remove('active')); event.target.classList.add('active'); document.getElementById('phoneField').style.display = method === 'phone' ? 'block' : 'none'; document.getElementById('emailField').style.display = method === 'email' ? 'block' : 'none'; } function sendCode() { const target = currentMethod === 'phone' ? document.getElementById('phoneInput').value : document.getElementById('emailInput').value; if (!target) return; document.getElementById('displayTarget').innerText = target; document.getElementById('step1').classList.remove('active'); document.getElementById('step2').classList.add('active'); document.querySelectorAll('.otp-input')[0].focus(); } function moveNext(el, index) { const inputs = document.querySelectorAll('.otp-input'); if (el.value && index < 5) { inputs[index + 1].focus(); } } function verifyCode() { const inputs = document.querySelectorAll('.otp-input'); let code = ""; inputs.forEach(input => code += input.value); if (code === DEMO_CODE) { document.getElementById('step2').classList.remove('active'); document.getElementById('step3').classList.add('active'); } else { document.getElementById('errorCode').style.display = 'block'; inputs.forEach(input => { input.value = ""; input.style.borderColor = "#ff5f5f"; }); inputs[0].focus(); } } function goBack() { document.getElementById('step2').classList.remove('active'); document.getElementById('step1').classList.add('active'); document.getElementById('errorCode').style.display = 'none'; }
Live Preview