{% extends 'layout_login.html.twig' %}

{% import 'macro_functions.html.twig' as mf %}

{% block meta_title %}{{ 'Reset your password'|trans }}{% endblock %}

{% set company = guest.system_company %}

{% block content %}
{% embed 'partial_admin_auth_card.html.twig' with {
    title: 'Reset Your Password'|trans,
    subtitle: 'Enter your email address. You will receive a confirmation link if your account exists.'|trans
} %}
    {% block auth_form %}
                <form method="post" action="{{ 'staff/passwordreset'|api_url(role: 'guest') }}"
                    {{ fb_api_form({message: 'A password reset confirmation email will be sent to you if we found an account with that email address.'|trans, redirect: 'index'|url}) }}>
                    <div class="mb-3">
                        <label class="form-label" for="inputEmail">{{ 'Email address'|trans }}</label>
                        <input class="form-control"
                               id="inputEmail"
                               type="email"
                               name="email"
                               value="{{ request.email }}"
                               placeholder="{{ 'Enter your email address'|trans }}"
                               required
                               autofocus>
                    </div>
                    {{ mf.recaptcha }}
                    <div class="form-footer d-flex justify-content-center">
                        <button class="btn btn-primary px-5" type="submit">
                            <svg class="icon">
                                <use xlink:href="#mail" />
                            </svg>
                            {{ 'Send me the link'|trans }}
                        </button>
                    </div>
                </form>
    {% endblock %}
    {% block auth_footer_note %}
        <a href="{{ 'staff/login'|url }}">{{ 'Take me back to the login screen.'|trans }}</a>
    {% endblock %}
{% endembed %}
{% endblock %}
