{% include 'overall_header.html' %}

<section class="iz-auth" aria-label="{{ L_LOGIN }}">
	<div class="iz-auth__inner">

		{% if LOGIN_EXPLAIN %}
			<div class="iz-alert iz-alert--info" role="status">
				<strong class="iz-alert__title">{{ LOGIN_EXPLAIN }}</strong>
			</div>
		{% endif %}

		{% if LOGIN_ERROR %}
			<div class="iz-alert iz-alert--danger" role="alert">
				<strong class="iz-alert__title">{{ LOGIN_ERROR }}</strong>
			</div>
		{% endif %}

		<div class="iz-auth__grid">
			<!-- Left: registration / admin tips / disabled -->
			<div class="iz-auth__panel iz-auth__panel--info">
				{% if S_REGISTER_ENABLED and not S_ADMIN_AUTH %}
					<h2 class="iz-auth__title">{{ L_CREATE_ACCOUNT }}</h2>
					<p class="iz-auth__text">{{ L_LOGIN_INFO }}</p>

					<p class="iz-auth__links">
						<a class="iz-link" href="{{ U_TERMS_USE }}">{{ L_TERMS_USE }}</a>
						<span class="iz-sep" aria-hidden="true">|</span>
						<a class="iz-link" href="{{ U_PRIVACY }}">{{ L_PRIVACY }}</a>
					</p>

					p class="iz-auth__actions">
						<a class="iz-btn iz-btn--secondary" href="{{ U_REGISTER }}">{{ L_REGISTER }}</a>
					</p>

				{% elseif S_ADMIN_AUTH %}
					<h2 class="iz-auth__title">{{ L_ADMIN_TIPS }}</h2>
					<p class="iz-auth__text">{{ L_ADMIN_TIP_INTRO }}</p>
					<ul class="iz-list iz-list--bullets">
						<li class="iz-list__item">{{ L_ADMIN_TIP_ONE }}</li>
						<li class="iz-list__item">{{ L_ADMIN_TIP_TWO }}</li>
						<li class="iz-list__item">{{ L_ADMIN_TIP_THREE }}</li>
					</ul>

				{% else %}
					<h2 class="iz-auth__title">{{ L_CREATE_ACCOUNT_DISABLED }}</h2>
					<p class="iz-auth__text">{{ L_REGISTRATION_DISABLED }}</p>

					<p class="iz-auth__links">
						<a class="iz-link" href="{{ U_TERMS_USE }}">{{ L_TERMS_USE }}</a>
						<span class="iz-sep" aria-hidden="true">|</span>
						<a class="iz-link" href="{{ U_PRIVACY }}">{{ L_PRIVACY }}</a>
					</p>

					<p class="iz-auth__actions">
						<a class="iz-btn iz-btn--secondary"
						   href="mailto:{{ BOARD_EMAIL }}?subject=Registrations%20Closed&amp;body=Dear%20Admin,%0A%0AI%20wanted%20to%20ask%20about%20registration%20availability%20for%20InfoZone%20Forum.%0A%0AThank%20you.">
							{{ L_CONTACT_WEBMASTER }}
						</a>
					</p>
				{% endif %}
			</div>

			<!-- Right: login form -->
			<div class="iz-auth__panel iz-auth__panel--form">
				<h2 class="iz-auth__title">{{ L_SIGN_IN_ACCOUNT }}</h2>

				<form class="iz-form" action="{{ S_LOGIN_ACTION }}" method="post" id="login">
					<fieldset class="iz-form__fieldset">
						<div class="iz-field">
							<label class="iz-label" for="{{ USERNAME_CREDENTIAL }}">{{ L_USERNAME }}{{ L_COLON }}</label>
							<input class="iz-input"
								   type="text"
								   tabindex="1"
								   name="{{ USERNAME_CREDENTIAL }}"
								   id="{{ USERNAME_CREDENTIAL }}"
								   value="{{ USERNAME }}"
								   placeholder="{{ L_USERNAME }}"
								   autocomplete="username"
								   required>
						</div>

						<div class="iz-field">
							<label class="iz-label" for="{{ PASSWORD_CREDENTIAL }}">{{ L_PASSWORD }}{{ L_COLON }}</label>
							<input class="iz-input"
								   type="password"
								   tabindex="2"
								   id="{{ PASSWORD_CREDENTIAL }}"
								   name="{{ PASSWORD_CREDENTIAL }}"
								   placeholder="{{ L_PASSWORD }}"
								   autocomplete="current-password"
								   required>
						</div>

						{% if S_DISPLAY_FULL_LOGIN %}
							<div class="iz-field iz-field--choices">
								{% if S_AUTOLOGIN_ENABLED %}
									<label class="iz-choice" for="autologin">
										<input class="iz-choice__input" type="checkbox" name="autologin" id="autologin" tabindex="4">
										<span class="iz-choice__label">{{ L_LOGIN_REMEMBER }}</span>
									</label>

									<label class="iz-choice" for="viewonline">
										<input class="iz-choice__input" type="checkbox" name="viewonline" id="viewonline" tabindex="5">
										<span class="iz-choice__label">{{ L_LOGIN_HIDE_ME }}</span>
									</label>
								{% endif %}
							</div>
						{% endif %}

						{% if CAPTCHA_TEMPLATE and S_CONFIRM_CODE %}
							{% set CAPTCHA_TAB_INDEX = 3 %}
							<div class="iz-field iz-field--captcha">
								{% include '{{ CAPTCHA_TEMPLATE }}' %}
							</div>
						{% endif %}

						<div class="iz-auth__actions">
							<button class="iz-btn iz-btn--primary" type="submit" tabindex="6" name="login" value="{{ L_LOGIN }}">
								{{ L_LOGIN_ME_IN }}
							</button>
						</div>

						{% if S_DISPLAY_FULL_LOGIN and (U_SEND_PASSWORD or U_RESEND_ACTIVATION) %}
							<p class="iz-auth__help">
								{% if U_SEND_PASSWORD %}<a class="iz-link" href="{{ U_SEND_PASSWORD }}">{{ L_FORGOT_PASS }}</a>{% endif %}
								{% if U_RESEND_ACTIVATION %}<span class="iz-sep" aria-hidden="true">|</span><a class="iz-link" href="{{ U_RESEND_ACTIVATION }}">{{ L_RESEND_ACTIVATION }}</a>{% endif %}
							</p>
						{% endif %}

						{{ S_LOGIN_REDIRECT }}
						{{ S_FORM_TOKEN_LOGIN }}
						{{ S_HIDDEN_FIELDS }}
					</fieldset>
				</form>

				{% EVENT login_body_form_after %}

				{% if not S_ADMIN_AUTH and PROVIDER_TEMPLATE_FILE %}
					{% include '{{ PROVIDER_TEMPLATE_FILE }}' %}
				{% endif %}
			</div>
		</div>

	</div>
</section>

{% include 'overall_footer.html' %}
