<!DOCTYPE html>
<html>

<head>
	
	<!--
	---- Basic
	--->

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">	

	<?php echo view('view_topo_seo'); ?>
	<?php echo view('view_topo_assets'); ?>
</head>

<body class="gray-bg md-skin">
	<?php if(isset($MyAncora['icon_login']->cor) AND !empty($MyAncora['icon_login']->cor)) { ?>
		<style>
			.overlay-login {
				background: <?php echo $MyAncora['icon_login']->cor; ?> !important;
				position: absolute;
				width: 100%;
				height: 100%;
			}
		</style>

		<div class="overlay-login"></div>
	<?php } else { ?> 
		<style>
			body {
				background-image: url(<?php echo PUBLICURL . 'uploads/upload_cad_ancora/item_' . $MyAncora['background_login']->id . '/' . $MyAncora['background_login']->imagem; ?>) !important;
				background-repeat: no-repeat !important;
				background-position: 50% 50% !important;
				background-size: cover !important;
			}
		</style>
	<?php } ?>
	
	<?php $environment = getenv('CI_ENVIRONMENT'); ?>

	<div class="container w-100 h-100 d-flex justify-content-center align-items-center flex-column animation-login cont-form-login">
		<?php if ($environment === 'development') {	?>
			<div class="row justify-content-center align-items-center mb-4">
				<div class="col">
					<div class="card card-login p-4 border-radius-8 shadow border-danger bg-danger d-flex justify-content-center align-items-center flex-column">
						Seu projeto está sendo executado em modo de <b>DESENVOLVIMENTO</b>
					</div>
				</div>
			</div>
		<?php } ?>


		<div class="row justify-content-center align-items-center mb-4">
			<div class="col">
				<div class="card card-login p-4 border-radius-8 shadow">
					<img class="img-fluid card-img-top p-4 border-radius-8 border" src="<?php echo PUBLICURL . 'uploads/upload_cad_ancora/item_' . $MyAncora['icon_login']->id . '/' . $MyAncora['icon_login']->imagem; ?>">
				</div>
			</div>
		</div>

		<div class="row justify-content-center align-items-center">
			<div class="col">
				<div class="card card-login p-2 border-radius-8 shadow">
					<div class="card-body border-radius-8 text-center">
						<?php echo form_open(BASECMSURL . "login/autenticar", array ('name' => 'formLogin', 'class' => '', 'id' => 'formLogin')); ?>

						<input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>" />
						
						<div class="input-group mb-3">
							<span class="input-group-text">
								<i class="fal fa-user"></i>
							</span>

							<input id="email" name="email" type="email" class="form-control" placeholder="E-mail" data-rule-required="true" data-msg-required="Campo obrigatório." data-rule-email="true" data-msg-email="Formato de e-mail inválido.">
						</div>

						<div class="input-group mb-3">
							<span class="input-group-text">
								<i class="fal fa-key"></i>
							</span>

							<input id="senha" name="senha" type="password" autocomplete="on" class="form-control" placeholder="Senha" data-rule-required="true" data-msg-required="Campo obrigatório.">
						</div>

						<button type="<?php if($MyConfig->form_login == 0) { echo 'button'; } else { echo 'submit'; } ?>" class="btn btn-custom-color-primary btn-submit-login w-100">
							<i class="fa-light fa-arrow-right-to-arc"></i> 
							Acessar
						</button>
						<?php echo form_close(); ?>
					</div>
				</div>
			</div>
		</div>

		<div class="mt-4">
			<center>
				<a href="<?php echo $MyPlataforma->link; ?>">
					<img style="max-width: 100px;" src="<?php echo PUBLICURL . 'uploads/upload_cms_plataformas/item_' . $MyPlataforma->id . '/' . $MyPlataforma->imagem; ?>">
				</a>
			</center>
		</div>
	</div>

	<div class="container w-100 h-100 d-flex justify-content-center align-items-center flex-column animation-login cont-form-login-2fa">
		<div class="row justify-content-center align-items-center mb-4">
			<div class="col">
				<div class="card card-login p-4 border-radius-8 shadow">
					<div class="border text-center p-4">
						<i class="fa-light fa-shield fa-6x mb-3 text-color-black text-center"></i>

						<h3 class="text-center text-color-black font-weight-bold mb-0">
							AUTENTICAÇÃO EM
							<br>
							DOIS FATORES
						</h3>

						<p class="text-center mt-3 mb-0 text-color-black">
							Informe o codigo de 6 digitos
							<br/>
							que foi enviado em seu e-mail
						</p>
					</div>
				</div>
			</div>
		</div>

		<div class="loginColumns animated fadeInDown border-radius-8">

			<div class="row justify-content-center border-radius-8">
				<div class="col-12 border-radius-8">
					<div class="ibox border-radius-8">
						<div class="ibox-content border-radius-8 p-3 d-flex justify-content-center align-items-center flex-column">
							<?php echo form_open(site_url("login/autenticar"), array ('name' => 'formLogin', 'class' => 'border p-3', 'id' => 'formLoginOtwfa')); ?>
							<input type="hidden" name="data_twofa" id="data_twofa">

							<h5 class="card-title mb-3 text-uppercase text-center">
								Código
							</h5>

							<input type="text" maxlength="1" class="input-2fa input-2fa-1" data-key="1">
							<input type="text" maxlength="1" class="input-2fa input-2fa-2" data-key="2">
							<input type="text" maxlength="1" class="input-2fa input-2fa-3" data-key="3">
							<input type="text" maxlength="1" class="input-2fa input-2fa-4" data-key="4">
							<input type="text" maxlength="1" class="input-2fa input-2fa-5" data-key="5">
							<input type="text" maxlength="1" class="input-2fa input-2fa-6" data-key="6">

							<div class="col-sm-12 d-flex justify-content-center mt-3 p-0">
								<button type="button" disabled class="btn-2fa w-100">
									<i class="fa-light fa-arrow-right-to-arc"></i> 
									Validar 
								</button>
							</div>

							<?php echo form_close(); ?>
						</div>
					</div>

					<button type="button" class="text-center bg-transparent border-0 text-dark col-12 btn-2fa-back">
						voltar
					</button>
				</div>
			</div>
		</div>
	</div>

	<?php echo view('view_rodape_assets'); ?>
</body>
</html>