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

{% 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: 'Update Your Password'|trans
} %}
    {% block auth_form %}
                <form method="post" action="{{ 'staff/update_password'|api_url(role: 'guest') }}" {{ fb_api_form({ 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="{{ data.email }}"
                               readonly>
                    </div>
                    <div class="mb-3">
                        <label class="form-label" for="inputCode">{{ 'Code'|trans }}</label>
                        <input class="form-control"
                               id="inputCode"
                               type="text"
                               name="code"
                               value="{{ data.hash }}"
                               placeholder="{{ 'Enter your secret code'|trans }}"
                               required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label" for="inputPassword">{{ 'Password'|trans }}</label>
                        <input class="form-control"
                               id="inputPassword"
                               type="password"
                               name="password"
                               placeholder="{{ 'Enter your password'|trans }}"
                               required
                               autofocus>
                    </div>
                    <div class="mb-3">
                        <label class="form-label" for="inputPassword2">{{ 'Repeat Password'|trans }}</label>
                        <input class="form-control"
                               id="inputPassword2"
                               type="password"
                               name="password_confirm"
                               placeholder="{{ 'Enter your password'|trans }}"
                               required>
                    </div>
                    <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>
                            {{ 'Update password'|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 %}
