{% extends "layout_public.html.twig" %}

{% block meta_title %}{{ 'Reset password'|trans }}{% endblock %}
{% set company = guest.system_company %}

{% if settings.theme == 'dark' %}
    {% set logo_url =  company.logo_url_dark %}
{% else %}
    {% set logo_url =  company.logo_url %}
{% endif %}

{% block body_class %}page-password-reset{% endblock %}
{% block body %}
<div class="container h-100">
    <div class="row h-75 justify-content-center align-items-center">
        <div class="col-md-6 col-lg-4">
            {% if settings.login_page_show_logo %}
                <div class="d-flex justify-content-center">
                    <a href="{{ settings.login_page_logo_url|default('/') }}" target="_blank">
                        <img class="my-4" height="50px" src="{{ logo_url }}" alt="{{ company.name }}"/>
                    </a>
                </div>
            {% endif %}
            <div class="card">
                <div class="card-body">
                    <h5 class="text-center m-4">{{ 'Reset your password'|trans }}</h5>
                    <form class="api-form auth" action="{{ 'api/guest/client/reset_password'|link }}" method="post" data-api-msg="{{ 'A password reset confirmation email will be sent to you if we found an account with that email address.'|trans }}">
                        <input type="hidden" name="CSRFToken" value="{{ CSRFToken }}"/>
                        <div class="mb-3">
                            <label class="form-label" for="email">{{ 'Email'|trans }}</label>
                            <input class="form-control" id="email" type="text" placeholder="{{ 'Enter your email address'|trans }}" name="email" value="{{ request.email }}" required="required" autofocus>
                            <div class="form-text">{{ 'Enter your email to reset password. You will receive new password after reset link is confirmed.'|trans }}</div>
                        </div>
                        <button type="submit" class="btn btn-primary w-100 mb-3">{{ 'Reset password'|trans }}</button>
                    </form>
                    <a class="btn btn-outline-primary w-100" href="{{ 'login'|link }}">{{ 'Back to login'|trans }}</a>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
