{% extends "themis/base.html" %}

{% block title %}Complete Sign Up — {{ themis_app_name }}{% endblock %}

{% block content %}
<div class="flex justify-center items-center min-h-[60vh]">
    <div class="card bg-base-200 shadow-xl w-full max-w-md">
        <div class="card-body">
            <h2 class="card-title text-2xl justify-center mb-2">Complete Sign Up</h2>
            <p class="text-center text-base-content/70 mb-4">
                Confirm your email address to finish signing in with SSO.
            </p>

            {% if form.errors %}
            <div class="alert alert-error mb-4">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none"
                     viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                          d="M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
                </svg>
                <span>Please correct the errors below.</span>
            </div>
            {% endif %}

            <form method="post" action="{{ action_url }}">
                {% csrf_token %}

                <div class="form-control mb-6">
                    <label class="label" for="id_email">
                        <span class="label-text">Email</span>
                    </label>
                    <input type="email" name="email" id="id_email"
                           class="input input-bordered w-full{% if form.email.errors %} input-error{% endif %}"
                           value="{{ form.email.value|default:'' }}"
                           autocomplete="email" required>
                    {% if form.email.errors %}
                    <label class="label">
                        <span class="label-text-alt text-error">{{ form.email.errors|join:", " }}</span>
                    </label>
                    {% endif %}
                </div>

                <div class="form-control mt-2">
                    <button type="submit" class="btn btn-primary w-full">Complete Sign Up</button>
                </div>
            </form>

        </div>
    </div>
</div>
{% endblock %}
