<!doctype html>
<html lang="{{ current_locale() }}" class="h-100">
    {% set current_theme = current_theme() %} {% from "macros/form_errors.j2" import render_field_errors, render_form_errors %}

    <head>
        <title>{{ _('Restablecer contraseña') }}</title>

        {{ current_theme.headertags() }} {{ current_theme.local_style() }}

        <title>{{ _('Restablecer contraseña') }}</title>

        <style>
            .bd-placeholder-img {
                font-size: 1.125rem;
                text-anchor: middle;
                -webkit-user-select: none;
                -moz-user-select: none;
                user-select: none;
            }

            @media (min-width: 768px) {
                .bd-placeholder-img-lg {
                    font-size: 3.5rem;
                }
            }
        </style>
        <!-- Custom styles for this template -->
        <link href="{{ url_for('static', filename='css/signin.css') }}" rel="stylesheet" />
    </head>

    <body class="text-center">
        <main class="form-signin">
            <form method="post">
                {{ form.csrf_token }} {{ render_form_errors(form) }}
                <a href="{{ url_for('home.pagina_de_inicio') }}">
                    <img
                        class="mb-4"
                        src="{{ url_for('static', filename='icons/logo/logo.svg') }}"
                        alt="NOW - LMS"
                        width="200"
                    />
                </a>
                <h1 class="h3 mb-3 fw-normal">{{ _('Restablecer Contraseña') }}</h1>
                <p class="text-muted mb-4">{{ _('Ingresa tu nueva contraseña.') }}</p>
                {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in
                messages %}
                <div
                    class="alert alert-{{ 'danger' if category == 'error' else ('warning' if category == 'warning' else 'success') }}"
                >
                    {{ message }}
                </div>
                {% endfor %} {% endif %} {% endwith %}
                <label for="new_password" class="visually-hidden">{{ _('Nueva Contraseña') }}</label>
                {{ form.new_password(class="form-control", id="new_password", placeholder=_("Nueva Contraseña")) }} {{
                render_field_errors(form.new_password) }}
                <label for="confirm_password" class="visually-hidden">{{ _('Confirmar Nueva Contraseña') }}</label>
                {{ form.confirm_password(class="form-control", id="confirm_password", placeholder=_("Confirmar Nueva
                Contraseña")) }} {{ render_field_errors(form.confirm_password) }}
                <button class="w-100 btn btn-lg btn-primary btn-block mt-3" type="submit">
                    <i class="bi bi-key" aria-hidden="true"></i> {{ _('Restablecer Contraseña') }}
                </button>
                <div class="mt-3">
                    <a href="{{ url_for('user.inicio_sesion') }}" class="text-decoration-none">
                        <i class="bi bi-arrow-left" aria-hidden="true"></i> {{ _('Volver al inicio de sesión') }}
                    </a>
                </div>
                <p class="mt-5 mb-3 text-muted text-center">BMO Soluciones &copy; 2025</p>
                <img src="{{ url_for('static', filename='/img/bmo-logo.png') }}" alt="BMO Soluciones" />
            </form>
        </main>
    </body>
</html>
