<!--Cabecalho -->
<?php $this->load->view('commons/cabecalho'); ?>
<!--Header -->
<?php $this->load->view('commons/header'); ?>
<style>
    .list-inline {
        padding-left: 0;
        margin-left: -5px;
        list-style: none;
    }
    .list-inline > li {
        display: inline-block;
        padding-right: 5px;
        padding-left: 5px;
    }
    .g-signin2 {
        background-color: #2ba447;
    }
     <?php $this->load->library('user_agent'); 
    $agent = $this->agent->browser();
    if ($agent == 'Firefox') {
    echo '.btn-google-li {position: absolute;}';     
    }
    ?>
</style>
<link rel="stylesheet" href="<?php echo base_url('assets/css/materialize-social.css') ?>">
<br>
<div class="container"> 
    <div class="row">
        <div class="col m2"></div>
        <div class="col s12 m8">
            <h4 style="font-size: 30pt;" class="text-mobile center"><b>Faça o seu login</b></h4>
            <div id="form_login_site"></div>
            <form method="POST" id="form-dinamico" autocomplete="off">
                <div class="row">
                    <div class="input-field col s12">
                        <input id="email_login"  class="autocomplete" onkeyup="maiuscula(this)" autocomplete="off"  type="email" name="email" required="">
                        <label for="email">Digite o seu e-mail</label>
                        <input id="emailAux" class="aux">
                    </div>
                    <div id="senha"></div>
                </div>
                <div align="center">
                    <button class="btn waves-effect waves-light  btn-logd col s12 m12" type="submit" name="action" style="background-color: #2ba447;">Acessar</button>
                    <br><br>
                    <button class="btn waves-effect waves-light  btn-logd col s12 m12"  onclick="recu_senha()"   name="recuperar" style="background-color: #005b95;">Recuperar Senha</button>
              
                </div>
                <br><br>
               
            </form>  
            
            
           
            <div class="login-social">
                <ul class="list-inline">
                    <li class="btn-facebook-li"><button class="btn-facebook waves-effect waves-light btn social facebook">&nbsp;&nbsp; Login com Facebook</button></li>
                    <li class="btn-google-li"><button class="g-signin2" onclick="google()" data-onsuccess="onSignIn" data-width="180"style="background-color: white !important; border:none !important;"></button></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<br>
<?php $this->load->view('commons/rodape'); ?>
<script>
$('body').delegate('input[name=senha-login]', 'keypress', function (e) {
    if (e.which === 32) {
       e.preventDefault();
    }
});
</script>

<script>
 function recu_senha () {

    var URL_BASE = "<?php echo base_url('recuperasenha'); ?>";
    var email = $("#email_login").val();
 
 $.ajax({
 
   method: "POST",
   url: URL_BASE,
   data: {email: email}
});
    // impede o envio do form
    alert('Senha Enviada!');
    e.preventDefault();
}
</script>
