{% extends 'base.html' %}
{% load widget_tweaks %}
{% block content %}
<div class="container mt-5 mb-5">
  <div class="row justify-content-center">
    <div class="col-md-8">
      <div class="card shadow-lg border-0">
        <div class="card-header bg-gradient bg-danger text-white">
          <h4 class="mb-0">
            <i class="fas fa-redo-alt me-2"></i> Resubmit Club Registration
          </h4>
        </div>
        
        <div class="card-body">
          {% if club.status == "Rejected" and club.rejection_message %}
            <div class="alert alert-warning d-flex align-items-center">
              <i class="fas fa-exclamation-triangle me-2"></i>
              <div>
                <strong>Reason for rejection:</strong> {{ club.rejection_message }}
              </div>
            </div>
          {% endif %}

          <form method="POST" enctype="multipart/form-data" class="needs-validation" novalidate>
            {% csrf_token %}
            {% for field in form %}
              <div class="mb-3">
                <label class="form-label fw-bold">{{ field.label }}</label>
                {% render_field field class="form-control" %}
                {% if field.help_text %}
                  <small class="form-text text-muted">{{ field.help_text }}</small>
                {% endif %}
                {% for error in field.errors %}
                  <div class="text-danger small">{{ error }}</div>
                {% endfor %}
              </div>
            {% endfor %}
            <div class="d-grid">
              <button type="submit" class="btn btn-success btn-lg">
                <i class="fas fa-paper-plane me-1"></i> Resubmit Registration
              </button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}
