{% extends "base.html" %}

{% block content %}
<main class="page-shell">
  <div class="container narrow-container">
    <div class="form-card">
      <p class="eyebrow">Create from photo</p>
      <h1>Upload a property photo</h1>
      <p class="text-muted">The MVP stores only a resized JPEG under 256KB, checks EXIF GPS, and attempts local OCR if a system OCR binary is installed.</p>
      <form method="post" enctype="multipart/form-data" novalidate>
        {% csrf_token %}
        {% if form.non_field_errors %}<div class="alert alert-danger">{{ form.non_field_errors }}</div>{% endif %}
        {% for field in form.visible_fields %}
        <div class="mb-3">
          <label class="form-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
          {{ field }}
          {% if field.name == 'photo' %}<div class="form-text">Originals are discarded after compression; max upload 12MB.</div>{% endif %}
          {% for error in field.errors %}<div class="invalid-copy">{{ error }}</div>{% endfor %}
        </div>
        {% endfor %}
        <div class="d-grid gap-2 d-sm-flex">
          <button class="btn btn-nest btn-lg" type="submit">Analyze & publish</button>
          <a class="btn btn-outline-dark btn-lg rounded-pill" href="{% url 'property_list' %}">Cancel</a>
        </div>
      </form>
    </div>
  </div>
</main>
{% endblock %}
