{% extends 'base.html' %}

{% block page_title %}Register New Farm{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-8">
        <div class="card border-0 shadow-sm rounded-4">
            <div class="card-body p-4">
                <form method="post">
                    {% csrf_token %}
                    
                    <div class="mb-3">
                        <label class="form-label fw-bold">Farm Name</label>
                        {{ form.name }}
                    </div>

                    <div class="row mb-3">
                        <div class="col-md-6">
                            <label class="form-label fw-bold">Owner Name</label>
                            {{ form.owner_name }}
                        </div>
                        <div class="col-md-6">
                            <label class="form-label fw-bold">Size (Hectares)</label>
                            {{ form.size_hectares }}
                        </div>
                    </div>

                    <div class="mb-3">
                        <label class="form-label fw-bold">Location / Address</label>
                        {{ form.location }}
                    </div>

                    <div class="mb-4">
                        <label class="form-label fw-bold">Initial Status</label>
                        {{ form.status }}
                        <div class="form-text">Newly registered farms are usually set to 'Pending Inspection'.</div>
                    </div>

                    <div class="d-flex gap-2 justify-content-end">
                        <a href="{% url 'dashboard' %}" class="btn btn-light">Cancel</a>
                        <button type="submit" class="btn btn-primary px-4">Register Farm</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
