{% extends get_master_template %}
{% load djf_survey_tags i18n static %}

{% block extra_css %}
    <link rel="stylesheet" href="{% static 'djf_surveys/te-starter/css/tw-elements.min.css' %}">
    <link rel="stylesheet" href="{% static 'djf_surveys/css/rating.css' %}"/>
{% endblock %}

{% block content %}
    <div class="max-w-screen-xl px-4 py-16 mx-auto sm:px-6 lg:px-8">
        <div class="max-w-lg mx-auto">
            <h1 class="text-2xl font-bold text-center text-blue-500 sm:text-3xl">{{ title_page }}</h1>

            <p class="max-w-md mx-auto mt-4 text-center text-gray-500">
                {{ sub_title_page }}
            </p>

            <form method="post">
                {% csrf_token %}
                {% for field in form %}
                    <div class="p-8 mt-6 mb-0 space-y-4 rounded-lg shadow-md border border-gray-200 bg-white">
                        <label for="email" class="text-base font-medium">{{ field.label }}</label>

                        <div class="mt-1">
                            {% if field.field.widget.input_type == 'radio' or field.field.widget.input_type == 'checkbox' %}
                                {{ field }}
                            {% else %}
                                {{ field|addclass:'w-full p-4 pr-12 text-sm border-gray-500 rounded-lg shadow-sm' }}
                            {% endif %}
                        </div>
                        <p class="text-xs text-gray-400">{{ field.help_text }}</p>
                        <span class="text-xs text-red-400">{{ field.errors }}</span>
                    </div>

                {% endfor %}

                <button type="submit" class="block w-full mt-5 px-5 py-3 text-sm font-medium text-white bg-blue-500 rounded-lg">
                    {% trans "Submit" %}
                </button>
            </form>
        </div>
    </div>

{% endblock %}

{% block extra_js %}
    <script src="{% static 'djf_surveys/te-starter/js/tw-elements.umd.min.js' %}"></script>
{% endblock %}