<!--
  templateType: membership_login_page
  isAvailableForNewContent: true
  label: Member Login
  screenshotPath: ../../images/template-previews/membership-login.png
-->
{% extends "../layouts/base-system.html" %}

{% block title %}Sign In{% endblock %}
{% block description %}Sign in to access your account{% endblock %}

{% block page_class %}page-auth{% endblock %}

{% block icon %}
  <div class="system-icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
      <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
      <circle cx="12" cy="7" r="4"/>
    </svg>
  </div>
{% endblock %}

{% block page_title %}Sign In to Your Account{% endblock %}

{% block page_message %}
  {% if request.query_dict.registered == "true" %}
    <div class="system-status success">
      ✓ Registration successful! Please sign in with your credentials.
    </div>
  {% elif request.query_dict.reset == "true" %}
    <div class="system-status success">
      ✓ Password reset successful! Please sign in with your new password.
    </div>
  {% elif request.query_dict.expired == "true" %}
    <div class="system-status warning">
      ⚠ Your session has expired. Please sign in again.
    </div>
  {% elif request.query_dict.required == "true" %}
    <div class="system-status info">
      ℹ Please sign in to access this page.
    </div>
  {% else %}
    Welcome back! Please enter your credentials to continue.
  {% endif %}
{% endblock %}

{% block main_content %}
  <div class="system-form">
    {% member_login "membership_login"
      email_label="Email Address",
      password_label="Password",
      remember_me_label="Remember me for 30 days",
      reset_password_text="Forgot password?",
      submit_button_text="Sign In"
    %}
    
    <div class="form-footer">
      Don't have an account? 
      <a href="/membership/register">Sign up for free</a>
    </div>
  </div>
{% endblock %}

{% block actions %}{% endblock %}

{% block footer_info %}
  {% if site_settings.membershipWebsiteAdmin %}
    <div class="system-contact">
      <p>Having trouble signing in?</p>
      <p><a href="mailto:{{ site_settings.membershipWebsiteAdmin }}">Contact the administrator</a></p>
    </div>
  {% endif %}
{% endblock %}