{% if Redirect_Message %}
	<p class="extranet_redirect_message">{{Redirect_Message|e}}</p>
{% endif %}

<div class="extranet_wrap">
	<div class="extranet_outer_wrap">
		<div class="extranet_inner_wrap">
		
		{% if Message_Display %}
			<div class="extranet_message">{{Message}}</div>
		{% endif %}
		
		{% if Email_Verified %}
			<div class="extranet_message">{{"Your email address has been successfully verified."|trans}}</div>
		{% elseif Email_Verification_Link_Expired %}
			<div class="extranet_error">{{"Your email address verification link has expired."|trans}}</div>
		{% elseif Email_Could_Not_Be_Verified %}
			<div class="extranet_error">{{"The link provided is not valid or the email address has already been verified."|trans}}</div>
		{% endif %}
		
		{% if Login_Form %}
			<div>
				
				{{openForm}}
				
					{% if main_login_heading %}
						<{{main_login_heading_tags|e}}>{{main_login_heading|trans}}</{{main_login_heading_tags|e}}>
					{% endif %}
			
					{% for item in Error_Display %}
						<div class="extranet_error">{{item.Error}}</div>
					{% endfor %}
				
					{% if this.signInUsingEmailAddress() %}
						<div class="extranet_field">
							<div class="label"><label for="extranet_email">{{email_field_label}}</label></div>
							{{this.frameworkField({'type': "email", 'name': "extranet_email", 'id': "extranet_email", 'required': "true", 'pattern': "email", 'class': "extranet_text"})}}
						</div>
					{% else %}
						<div class="extranet_field">
							<div class="label"><label for="extranet_screen_name">{{screen_name_field_label}}</label></div>
							{{this.frameworkField({'type': "text", 'name': "extranet_screen_name", 'id': "extranet_screen_name", 'required': "true", 'class': "extranet_text"})}}
						</div>
					{% endif %}
					<div class="extranet_field">
						<div class="label"><label for="extranet_password">{{password_field_label}}</label></div>
						<div class="password_field_with_eye">
							{{this.frameworkField({'type': "password", 'name': "extranet_password", 'id': "extranet_password", 'required': "true", 'class': "extranet_password"})}}
							
							<i
								id="{{Container_Id}}-password-reveal-hide-icon"
								class="fas fa-eye-slash eye_icon"
								onclick="zOnLoad(function() {zenarioP.revealOrHidePasswordIconOnclick('{{Container_Id}}', 'password-reveal-hide-icon', 'extranet_password')})"
							></i>
						</div>
					</div>
					{% if Ts_And_Cs_Section %}
						<div class="extranet_terms_and_conditions">
							{{this.frameworkField({'type': "checkbox", 'name': "extranet_terms_and_conditions", 'id': "extranet_terms_and_conditions"})}}
							<label for="extranet_terms_and_conditions">{{Ts_And_Cs_Link}}</label>
						</div>
					{% endif %}
					
					{% if Remember_Me_Section %}
						<div class="extranet_remember_me">
							{{this.frameworkField({'type': "checkbox", 'name': "extranet_remember_me", 'id': "extranet_remember_me", 'checked': "checked"})}}
							<label for="extranet_remember_me">{{"Remember me"|trans}}</label>
						</div>
					{% endif %}

					{% if Log_Me_In_Section %}
						<div class="extranet_log_me_in">
							{{this.frameworkField({'type': "checkbox", 'name': "extranet_log_me_in", 'id': "extranet_log_me_in", 'checked': "checked"})}}
							<label for="extranet_log_me_in">{{"Store a cookie to keep me logged in at this computer"|trans}}</label>
						</div>
					{% endif %}

					{% if Captcha %}
						<div class="extranet_field">
							<div class="captcha">
								{{"Please help us combat form submissions by spam devices:"|trans}}
								{{Captcha}}
							</div>
						</div>
					{% endif %}
					
					<div class="extranet_btn">
						<input
							type="submit"
							name="extranet_login"
							class="login_entry_button"
							value="{{login_button_text}}"
						/>
					</div>
				
				{{this.closeForm()}}
				
			</div>
			<div class="extranet_links">
				{% if Reset_Password_Link_Section %}
					<div class="extranet_link_reset_password"><a {{Reset_Password_Link}}>{{"Forgotten password?"|trans}}</a></div>
				{% endif %}
				{% if Registration_Link_Section %}
					<div class="extranet_link_registration">{{"New user?"|trans}} <a {{Registration_Link}}>{{"Sign up"|trans}}</a></div>
				{% endif %}
			</div>
		{% endif %}
		
		{% if Logged_In %}
			{% if Welcome_Message_Section %}
				<div class="extranet_welcome_text">{{Welcome_Message}}</div>
			{% endif %}
			
			{% if Destination_url_section %} 
				<div class="extranet_requested_link">
					{{"Your requested page:"|trans}}
					<a href="{{destURL_Link}}">{{destURL_Title}}</a>
				</div>
			{% endif %}
			
			{% if After_login_url_section %} 
				<div class="extranet_requested_link">
					{{"After-login page:"|trans}}
					<a href="{{afterLoginURL_Link}}">{{afterLoginURL_Title}}</a>
				</div>
			{% endif %}
			<div class="extranet_links">
				{% if Profile_Link_Section %}
					<div>
						<a {{Profile_Link}}>{{"Your profile"|trans}}</a>
					</div>
				{% endif %}
				{% if Change_Password_Link_Section %}
					<div>
						<a {{Change_Password_Link}}>{{"Change your password"|trans}}</a>
					</div>
				{% endif %}
				{% if Logout_Link_Section %}
					<div>
						<a {{Logout_Link}}>{{"Logout"|trans}}</a>
					</div>
				{% endif %}
			</div>
		{% endif %}
		
		{% if Change_Password_Form %}
			<h1>{{"For security, please change your password"|trans}}</h1>
			
			{% for item in Password_Error_Display %}
				<div class="extranet_error">{{item.Error}}</div>
			{% endfor %}
			
			<div>
				<div class="extranet_field">
					<div class="label"><label for="extranet_new_password">{{"New password"|trans}}:</label></div>
					<div class="password_field_with_eye">
						{{this.frameworkField({
							'type': "password",
							'name': "extranet_new_password",
							'id': "extranet_new_password",
							'pattern': "new_password",
							'required': "true",
							'class': "extranet_password",
							'oninput': "zOnLoad(function() {zenarioP.updatePasswordNotifier('#extranet_new_password', " ~ json_encode(Password_Requirements_Settings) ~ ", '#password_message', false, false)})"
						})}}
						
						<i
							id="{{Container_Id}}-password-reveal-hide-icon"
							class="fas fa-eye-slash eye_icon"
							onclick="zOnLoad(function() {zenarioP.revealOrHidePasswordIconOnclick('{{Container_Id}}', 'password-reveal-hide-icon', 'extranet_new_password')})"
						></i>
					</div>
					
					<div>
						<span id="password_message" class="title_orange">{{'Please enter a password.'|trans}}</span>
					</div>
					
				</div>
				<div class="extranet_field">
					<div class="label"><label for="extranet_new_password_confirm">{{"Repeat password"|trans}}:</label></div>
					<div class="password_field_with_eye">
						{{this.frameworkField({'type': "password", 'name': "extranet_new_password_confirm", 'id': "extranet_new_password_confirm", 'required': "true", 'class': "extranet_password"})}}
						
						<i
							id="{{Container_Id}}-repeat-password-reveal-hide-icon"
							class="fas fa-eye-slash eye_icon"
							onclick="zOnLoad(function() {zenarioP.revealOrHidePasswordIconOnclick('{{Container_Id}}', 'repeat-password-reveal-hide-icon', 'extranet_new_password_confirm')})"
						></i>
					</div>
				</div>
				<div class="extranet_btn"><input type="submit" name="extranet_change_password" class="extranet_submit" value="{{'Change your password'|trans}}" /></div>
			</div>
		{% endif %}
		
		{% if Terms_And_Conditions_Form %}
			
			<div>
				<h2>{{Welcome_Message}}</h2>
				<div class="terms_not_accepted_message">
					{{"You are now logged in, but this site requires you to accept our terms and conditions before proceeding. Please check the statement below."|trans}}
				</div>
				
				{% if Is_Admin %}
					<div class="extranet_error">
						{{"You are an administrator impersonating a user; checkbox disabled as you may not accept T&Cs on their behalf."|trans}}
					</div>
				{% endif %}
				
				{% for item in Error_Display %}
					<div class="extranet_error">{{item.Error}}</div>
				{% endfor %}
				
				<div class="extranet_terms_and_conditions">
					{% if Is_Admin %}
						<input id="extranet_terms_and_conditions" type="checkbox" disabled>
					{% else %}
						{{this.frameworkField({'type': "checkbox", 'name': "extranet_terms_and_conditions", 'id': "extranet_terms_and_conditions"})}}
					{% endif %}
					<label for="extranet_terms_and_conditions">{{Ts_And_Cs_Link}}</label>
				</div>
				
				{% if not Is_Admin %}
					<div class="extranet_btn"><input type="submit" name="extranet_login" class="login_entry_button" value="{{login_button_text}}" /></div>
				{% endif %}
				
				{% if Logout_Link_Section_If_User_Doesnt_Accept_Terms %}
					<div>
						<a {{Logout_Link_If_User_Doesnt_Accept_Terms}}>{{"Logout"|trans}}</a>
					</div>
				{% endif %}
			</div>
		{% endif %}
		
		</div>
	</div>
</div>
