{% extends "ecp_auth/base.html" %}
{% load static %}

{% block title %}Link ECP Certificate{% endblock %}
{% block header_title %}Link Certificate{% endblock %}
{% block header_subtitle %}Attach a digital certificate to your account{% endblock %}

{% block content %}
<form method="post" class="ecp-form" id="ecp-link-form">
    {% csrf_token %}

    <div class="ecp-form-group">
        <label for="id_ecp_password" class="ecp-label">
            🔑 Пароль для нового ключа
        </label>
        {{ form.ecp_password }}
        {% if form.ecp_password.errors %}
        <div class="ecp-field-error">{{ form.ecp_password.errors.0 }}</div>
        {% endif %}
        <p class="ecp-help-text">{{ form.ecp_password.help_text }}</p>
    </div>
    {% if form.non_field_errors %}
    <div class="ecp-alert ecp-alert-error">
        {% for error in form.non_field_errors %}
        <p>{{ error }}</p>
        {% endfor %}
    </div>
    {% endif %}

    <button type="submit" class="ecp-btn ecp-btn-primary" id="btn-link-submit">
        ✨ Згенерувати ключ
    </button>
</form>
{% endblock %}

{% block footer %}
<p class="ecp-footer-text">
    <a href="{% url 'ecp_auth:login' %}" class="ecp-link">Back to Sign In</a>
</p>
{% endblock %}

{% block extra_scripts %}
<script src="{% static 'ecp_auth/js/ecp.js' %}"></script>
{% endblock %}
