{# styles/infozone/template/login_body.html #}

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

			{# Left panel: registration / info #}
			<div class="iz-auth__panel iz-auth__panel--info">
				{% if S_REGISTER_ENABLED %}
					<h2 class="iz-auth__title">{{ L_CREATE_ACCOUNT }}</h2>

					<p class="iz-auth__text">
						{{ L_LOGIN_INFO|default('Create an account to participate in discussions and access all forum features.') }}
					</p>

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

					<p class="iz-auth__actions">
						{% if U_REGISTER %}
							<a class="iz-btn iz-btn--secondary" href="{{ U_REGISTER }}">{{ L_REGISTER }}</a>
						{% endif %}
					</p>
				{% else %}
					<h2 class="iz-auth__title">{{ L_CREATE_ACCOUNT_DISABLED }}</h2>

					<p class="iz-auth__text">
						{{ L_REGISTRATION_DISABLED|default('User registration is currently disabled.') }}
					</p>

					<p class="iz-auth__links">
						{% if U_TERMS_USE %}
							<a class="iz-link" href="{{ U_TERMS_USE }}">{{ L_TERMS_USE }}</a>
						{% endif %}
						<span class="iz-sep" aria-hidden="true">|</span>
						{% if U_PRIVACY %}
							<a class="iz-link" href="{{ U_PRIVACY }}">{{ L_PRIVACY }}</a>
						{% endif %}
					</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 panel: login form #}
			<div class="iz-auth__panel iz-auth__panel--form">
				<h2 class="iz-auth__title">{{ L_SIGN_IN_ACCOUNT }}</h2>

				{% EVENT login_body_before %}

				<form class="iz-form" method="post" action="{{ S_LOGIN_ACTION }}">
					<fieldset class="iz-form__fieldset">

						<div class="iz-field">
							<label class="iz-label" for="username">{{ L_USERNAME }}{{ L_COLON }}</label>
							<input class="iz-input"
								   type="text"
								   name="username"
								   id="username"
								   inputmode="text"
								   autocomplete="username"
								   placeholder="{{ L_USERNAME }}"
								   required>
						</div>

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

						{% if S_AUTOLOGIN_ENABLED %}
							<div class="iz-field iz-field--inline">
								<input class="iz-checkbox" type="checkbox" name="autologin" id="autologin">
								<label class="iz-checkbox__label" for="autologin">{{ L_LOGIN_REMEMBER }}</label>
							</div>
						{% endif %}

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

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

				{% EVENT login_body_form_after %}
				{% EVENT login_body_after %}
			</div>

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