{% sw_extends '@Storefront/storefront/base.html.twig' %}

{% block base_content %}
    {% block page_account_profile_reset_password %}
        <div class="account-reset-password row justify-content-md-center">

            {% block page_account_profile_reset_password_inner %}
                <div class="col-md-8 col-lg-6">

                    {% block page_account_profile_reset_password_form %}
                        <form method="post"
                              class="account-reset-password-form card"
                              action="{{ path('frontend.account.recover.password.reset') }}"
                              data-form-validation="true">

                            {% block page_account_profile_reset_password_title %}
                                <h1 class="card-title">
                                    {{ 'account.profileRecoverPasswordTitle'|trans }}
                                </h1>
                            {% endblock %}

                            {% block page_account_profile_reset_password_container %}
                                <div class="card-body">

                                    {% block page_account_profile_reset_password_new %}
                                        <div class="form-group">

                                            {% block page_account_profile_reset_password_new_label %}
                                                <label class="form-label" for="newPassword">
                                                    {{ "account.profilePasswordCreateNew"|trans }} {{ "general.required"|trans }}
                                                </label>
                                            {% endblock %}

                                            {% block page_account_profile_reset_password_new_input %}
                                                <input type="password"
                                                       class="form-control{% if formViolations.getViolations('/newPassword') is not empty %} is-invalid{% endif %}"
                                                       autocomplete="new-password"
                                                       id="newPassword"
                                                       name="password[newPassword]"
                                                       data-form-validation-equal="newPassword"
                                                       data-form-validation-length="{{ config('core.loginRegistration.passwordMinLength') }}"
                                                       data-form-validation-length-message=" {{ "account.personalPasswordDescription"|trans({
                                                           '%minLength%': config('core.loginRegistration.passwordMinLength')
                                                       }) }}"
                                                       required="required">
                                            {% endblock %}

                                            {% block page_account_profile_reset_password_new_violations %}
                                                {% if formViolations.getViolations("/newPassword") is not empty %}
                                                    {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' with {
                                                        violationPath: '/newPassword'
                                                    } %}
                                                {% endif %}
                                            {% endblock %}
                                        </div>
                                    {% endblock %}

                                    {% block page_account_profile_reset_password_confirm %}
                                        <div class="form-group">

                                            {% block page_account_profile_reset_password_confirm_label %}
                                                <label class="form-label" for="passwordConfirmation">
                                                    {{ "account.personalPasswordConfirmationLabel"|trans }} {{ "general.required"|trans }}
                                                </label>
                                            {% endblock %}

                                            {% block page_account_profile_reset_password_confirm_input %}
                                                <input type="password"
                                                       class="form-control{% if formViolations.getViolations('/newPassword') is not empty %} is-invalid{% endif %}"
                                                       autocomplete="new-password"
                                                       id="passwordConfirmation"
                                                       name="password[newPasswordConfirm]"
                                                       required="required"
                                                       data-form-validation-equal="newPassword"
                                                       data-form-validation-equal-message="{{ "account.personalPasswordConfirmationInvalidMessage"|trans }}">
                                            {% endblock %}

                                            {% block page_account_profile_reset_password_confirm_violations %}
                                                {% if formViolations.getViolations("/newPasswordConfirm") is not empty %}
                                                    {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' with {
                                                        violationPath: '/newPasswordConfirm'
                                                    } %}
                                                {% endif %}
                                            {% endblock %}
                                        </div>
                                    {% endblock %}

                                    {% block page_account_profile_reset_password_hash_input %}
                                        <input type="hidden"
                                               id="passwordHash"
                                               value="{{ page.getHash }}"
                                               name="password[hash]"
                                               required="required">
                                    {% endblock %}

                                    {% block page_account_profile_reset_password_action_buttons %}
                                        <div class="account-reset-password-form-actions">
                                            {% block page_account_profile_reset_password_action_button_send %}
                                                <button type="submit"
                                                        class="account-reset-password-submit btn btn-primary"
                                                        title="{{ "account.profileChangePassword"|trans }}">
                                                    {{ "account.profileChangePassword"|trans }}
                                                </button>
                                            {% endblock %}
                                        </div>
                                    {% endblock %}
                                </div>
                            {% endblock %}
                        </form>
                    {% endblock %}
                </div>
            {% endblock %}
        </div>
    {% endblock %}
{% endblock %}
