<div class="row small-space-xs" id="container-login">
  <div class="col-xs-12">
    <span class="text-small visible-block"><?php echo $text_returning_customer_subtitle; ?></span>

    <form id="form-login" action="<?php echo $action ?>" method="post" enctype="multipart/form-data" name="formlogin">
      <label class="field field-medium top-margin-x-large">
        <span class="field-label">E-mail</span>
        <input type="text" name="email_login" id="email-login" value="<?php echo $email_login; ?>" placeholder="<?php echo $entry_email_placeholder; ?>" class="field-entry validaemail">
      </label>
      <label class="field field-medium vertical-margin-medium">
        <span class="field-label">Senha</span>
        <input type="password" name="password" id="password-login" value="" placeholder="<?php echo $entry_password_placeholder; ?>" class="field-entry">
      </label>
      <div class="row no-space-xs middle-xs">
        <div class="col-xs">
          <a href="#" class="link-default text-medium text-decoration-none" id="link-forgotten">
            <span><?php echo $text_forgotten; ?></span>
          </a>
        </div>
        <div class="col-xs text-right">
          <button type="submit" class="btn-default btn-medium btn-login">
            <span><?php echo $text_enter; ?></span>
          </button>
        </div>
      </div>

      <?php if ($redirect) { ?>
        <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
      <?php } ?>
    </form>
  </div>
  <?php if ($this->data['facebook_enable'] || $this->data['google_enable']) { ?>
    <div class="col-xs-12 text-center">
      <p class="text-small bottom-margin-large top-margin-x-small separator">
        <span class="separator-text"><?php echo $text_login_rede_social; ?></span>
      </p>
      <?php if($this->data['facebook_enable']) { ?>
        <a onclick="loginFacebook()" class="visible-inline-block margin-x-small">
          <button data-facebook-id="<?php echo $facebook_id; ?>" id="btnAppFacebook" type="button" data-tipo-validacao-social='login' class="btn-default btn-medium btn-facebook">
            <i class="fab fa-facebook-f right-margin-small text-large" aria-hidden="true"></i>
            <b class="vertical-middle">Facebook</b>
          </button>
        </a>
      <?php }?>
      <?php if($this->data['google_enable']) { ?>
          <button data-google-id="<?php echo $google_id; ?>" type="button" data-tipo-validacao-social='login' id="btngoogle" class="btn-default btn-medium btn-google">
            <i class="fab fa-google right-margin-small text-large" aria-hidden="true"></i>
            <b class="vertical-middle">Google</b>
          </button>
        </a>
      <?php } ?>
    </div>
  <?php } ?>
</div>

  <!-- <?php //echo $content_top; ?>
  <?php //echo $content_bottom; ?> -->

<script type="text/javascript">
  window.waitEvent('scripts_document', function() {
    <?php if ($success) { ?>notificationMsg('<?php echo $success; ?>','success');<?php } ?>
    <?php if ($error_warning) { ?> notificationMsg('<?php echo $error_warning; ?>','warning'); <?php } ?>
  });

  window.waitEvent('scripts_document', function() {
    function animationLoginForgotten(getOut, getIn) {
      $(getOut).animate({
        'opacity': '0',
        'margin-top': '40px'
      }, 300, function() {
        $(getOut).addClass('hidden');
        $(getIn).removeClass('hidden').css({'opacity': '0', 'margin-top':'40px'}).animate({
          'opacity': '1',
          'margin-top': '-.5rem'
        }, 300);
      });
    }
    $('#link-forgotten').on('click', function(event) {
      event.preventDefault();
      animationLoginForgotten('#container-login, .js-title-login', '#container-forgotten, .js-title-forgotten');
    });
    $('#link-login').on('click', function(event) {
      event.preventDefault();
      animationLoginForgotten('#container-forgotten, .js-title-forgotten', '#container-login, .js-title-login');
    });
  });
</script>
