{# File: plugins/auth/templates/auth/invite.html #}
{% extends 'core/base.html' %}
{% block title %}Send Invitation – Nature In Pots{% endblock %}

{% block content %}
<h1>Send Invitation</h1>

<p>You have <strong>{{ invites }}</strong> invites remaining.</p>

<form method="post" class="mb-4">
  {{ form.hidden_tag() }}

  <div class="mb-3">
    {{ form.email.label(class="form-label") }}
    {{ form.email(class="form-control", placeholder="Recipient email (optional)") }}
    <small class="form-text text-muted">
      Enter the recipient’s email if you want to include it in the invitation record.
    </small>
  </div>

  <button type="submit" class="btn btn-primary">Generate Invitation</button>
</form>

{% if inv_link %}
  <div class="card mb-4">
    <div class="card-header">
      Your Invitation Link
    </div>
    <div class="card-body">
      <input type="text"
             class="form-control mb-3"
             readonly
             value="{{ inv_link }}"
             onclick="this.select();">
      <label class="form-label">Suggested Message</label>
      <textarea class="form-control mb-3" rows="3" readonly
                onclick="this.select();">{{ inv_blurb }}</textarea>
      <label class="form-label">Email Template</label>
      <textarea class="form-control" rows="6" readonly
                onclick="this.select();">{{ email_preview }}</textarea>
    </div>
  </div>
{% endif %}
{% endblock %}
