{% extends "base.html" %}

{% block title %}Invite Link Issue{% endblock %}

{% block content %}
<div class="min-h-screen bg-gray-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
  <div class="max-w-md w-full space-y-8">
    <div class="bg-white shadow rounded-lg overflow-hidden">
      <div class="px-6 py-5 border-b border-gray-100 bg-gray-50">
        <h2 class="text-xl font-semibold text-gray-900">We couldn’t process this link</h2>
      </div>
      <div class="px-6 py-6 space-y-4">
        {% if issue == 'invalid' %}
          <p class="text-gray-700">This link is invalid or no longer exists.</p>
        {% elif issue == 'expired' %}
          <p class="text-gray-700">This invite has expired or is no longer available.</p>
        {% elif issue == 'wrong_account' %}
          <p class="text-gray-700">The invite is not associated with your account.</p>
          {% if invited_email %}
            <p class="text-gray-600 text-sm">This invite was sent to <strong>{{ invited_email }}</strong>.</p>
          {% endif %}
        {% endif %}

        <div class="pt-2 space-y-2">
          <a href="{% url 'account_login' %}" class="inline-flex items-center px-4 py-2 rounded-md bg-blue-600 text-white hover:bg-blue-700">Sign in</a>
          {% if context_type == 'organization_invite' %}
            <p class="text-gray-600 text-sm">Ask the inviter to send a new invite{% if invited_by %} ({{ invited_by.email }}){% endif %}.</p>
          {% elif context_type == 'agent_allowlist' and issue != 'wrong_account' %}
            <p class="text-gray-600 text-sm">Ask the agent owner to send a new invite.</p>
          {% endif %}
        </div>
      </div>
    </div>

    <div class="text-center">
      <a href="https://gobii.ai" class="text-sm text-gray-500 hover:text-gray-700">Powered by Gobii</a>
    </div>
  </div>
  
</div>
{% endblock %}

