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

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

{% block meta_title %}{{ 'Reset Password'|trans }}{% endblock %}
{% block meta_description %}{{ 'Request a password reset link to regain access to your client account securely.'|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 method="post" action="{{ 'client/reset_password'|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}) }}>
                        <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 receive a password reset link and choose a new password.'|trans }}</div>
                        </div>
                        {{ mf.recaptcha }}
                        <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'|url }}">{{ 'Back to Login'|trans }}</a>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
