<!DOCTYPE html>
<html class="js">
	<head>

		<title>Авторизация</title>
		<meta charset="utf-8">
		<base href="{$config->root_url}/admin/"/>
	    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

		{* Favicon *}
	    <link rel="shortcut icon" href="/admin/design/images/favicon.png">

		{* Stylesheet *}
		<link href="/admin/design/css/bundle.css" rel="stylesheet">
	    <link href="/admin/design/css/color.css" rel="stylesheet">
		<link href="/admin/design/css/tabler.css" rel="stylesheet">
	    <link href="/admin/design/css/system.css" rel="stylesheet">
	</head>
	<body class="nk-body npc-default pg-auth">

		{* Preloader *}
	    <div class="preloader position-absolute">
		    <div class="d-flex justify-content-center position-fixed preloader-block">
		    	<div class="spinner-border text-primary" role="status">
		    		<span class="sr-only">Загрузка...</span>
		    	</div>
		    </div>
	    </div>

	    {* App *}
		<div class="nk-app-root">
	        <div class="nk-main ">
	            <div class="nk-wrap nk-wrap-nosidebar">

	            	{* Content *}
	            	<div class="nk-content ">
	                    <div class="nk-block nk-block-middle nk-auth-body wide-xs">

	                        {* Logo *}
	                        <div class="brand-logo pb-2 center">
	                            <div class="nk-header-app-name align-self-stretch">
	                                <div class="nk-header-app-logo">
	                                    <em class="icon bg-purple-dim">
	                                    	{literal}
											<svg xmlns="http://www.w3.org/2000/svg" id="logo" width="19" viewBox="0 0 30 30">
												<path xmlns="http://www.w3.org/2000/svg" class="st1" d="M19.78,0H11.33V6.56h0v9h0c0,.06,0,.13,0,.19a3.84,3.84,0,1,0,1.51-3V6.05a10,10,0,1,1-7.65,9.71c0-.17,0-.33,0-.49h0V0H1.49A1.49,1.49,0,0,0,0,1.49V20.22A10.34,10.34,0,0,0,9.72,30H19.78A10.25,10.25,0,0,0,30,19.78V10.22A10.25,10.25,0,0,0,19.78,0Z"/>
	                                    	</svg>
	                                    	{/literal}
	                                    </em>
	                                </div>
	                                <div class="nk-header-app-info">
	                                    <span class="lead-text">
	                                    	Buyers CMS
	                                    </span>
	                                </div>
	                            </div>
	                        </div>


	                        <div class="card card-bordered">
	                            <div class="card-inner card-inner-lg">
	                                <div class="nk-block-head">
	                                    <div class="nk-block-head-content">
	                                        <h4 class="nk-block-title js-title">Авторизация</h4>
	                                        <div class="nk-block-des">
	                                            <p class="js-subtitle">Войдите в систему используя свой email и пароль.</p>
	                                        </div>
	                                    </div>
	                                </div>

                                    {if $error == 'mailsent_error'}
                                    <div class="alert alert-fill alert-danger alert-icon">
                                        <em class="icon ti ti-circle-x"></em>
                                        Ошибка при отправке почты
                                    </div>
                                    {elseif $error == 'invalid_login'}
                                    <div class="alert alert-fill alert-danger alert-icon">
                                        <em class="icon ti ti-circle-x"></em>
                                        Неверный логин или пароль
                                    </div>
                                    {/if}

                                    {if !empty($success)}
                                    <div class="alert alert-fill alert-success alert-icon">
                                        <em class="icon ti ti-circle-check"></em>
                                        Письмо отправлено
                                    </div>
                                    {/if}

	                                <form method="post" action="/admin/">
	                                    <div class="form-group">
	                                        <div class="form-label-group">
	                                            <label class="form-label" for="email">Email</label>
	                                        </div>
	                                        <input type="email" value="{$smarty.post.email}" name="email" id="email" class="form-control form-control-lg" required>
	                                    </div>
	                                    <div class="form-group js-password">
	                                        <div class="form-label-group">
	                                            <label class="form-label" for="password">Пароль</label>
	                                        </div>
	                                        <div class="form-control-wrap">
	                                            <a href="#" class="form-icon form-icon-right passcode-switch" data-target="password">
	                                                <em class="passcode-icon icon-show icon ti ti-eye"></em>
	                                                <em class="passcode-icon icon-hide icon ti ti-eye-off"></em>
	                                            </a>
	                                            <input type="password" value="{$smarty.post.password}" name="password" id="password" class="form-control form-control-lg">
	                                        </div>
	                                    </div>
	                                    <div class="form-group d-flex flex-nowrap justify-between mb-2">
	                                        <div class="custom-control custom-control-sm custom-checkbox">
	                                            <input type="checkbox" name="reset_password" value="Y" {if !empty($smarty.post.reset_password)}checked{/if} class="custom-control-input" id="reset_password">
	                                            <label class="custom-control-label" for="reset_password">Восстановить пароль</label>
	                                        </div>
	                                    </div>
	                                    <div class="error text-danger"></div>
	                                    <div class="form-group">
	                                        <button type="submit" class="btn btn-lg btn-primary btn-block js-submit">Авторизоваться</button>
	                                    </div>
	                                    <input type="hidden" name="auth" value="login">
	                                </form>
	                            </div>

	                        </div>
	                    </div>
	                </div>

	            </div>
	        </div>
	    </div>

	    {* JavaScript *}
	    <script src="/admin/design/js/bundle.js"></script>
	    <script src="/admin/design/js/scripts.js"></script>
	    <script src="/admin/design/js/login.js"></script>
	</body>
</html>
