<!--
  templateType: page
  isAvailableForNewContent: true
  label: Membership - Access Denied
  screenshotPath: ../../images/template-previews/membership-access-denied.png
-->
{% extends "../layouts/base-system.html" %}

{% block title %}Access Denied{% endblock %}
{% block description %}You don't have permission to access this content.{% endblock %}

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

{% block icon %}
  <div class="system-icon icon-warning">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
      <rect x="3" y="11" width="18" height="10" rx="2" ry="2"/>
      <path d="M7 11V7a5 5 0 0110 0v4"/>
    </svg>
  </div>
{% endblock %}

{% block page_title %}Access Restricted{% endblock %}

{% block page_message %}
  {% if request.contact %}
    Sorry, your account doesn't have permission to access this content. This content is restricted to specific member lists.
  {% else %}
    This content requires membership access. Please sign in or register to view this content.
  {% endif %}
{% endblock %}

{% block main_content %}
  <div class="system-section">
    {% if request.contact %}
      <p>If you believe you should have access to this content, please contact your administrator or check if you're a member of the required list.</p>
      
      <div class="system-actions">
        <a href="/dashboard" class="btn btn-primary">Go to Dashboard</a>
        <a href="/" class="btn btn-secondary">Go to Homepage</a>
      </div>
    {% else %}
      <p>To access this exclusive content, you need to be a registered member and signed in.</p>
      
      <div class="system-actions">
        {% set login_url = request.login_url or "/_hcms/mem/login" %}
        <a href="{{ login_url }}" class="btn btn-primary">Sign In</a>
        <a href="/_hcms/mem/register" class="btn btn-secondary">Register</a>
      </div>
      
      <div class="form-footer" style="margin-top: 2rem; text-align: center;">
        Don't have an account? <a href="/_hcms/mem/register">Sign up for free</a>
      </div>
    {% endif %}
  </div>
{% endblock %}

{% block actions %}{% endblock %}

{% block footer_info %}
  {% if site_settings.membershipWebsiteAdmin %}
    <div class="system-contact">
      <p>Need help accessing this content?</p>
      <p><a href="mailto:{{ site_settings.membershipWebsiteAdmin }}">Contact the administrator</a></p>
    </div>
  {% endif %}
{% endblock %}