{% extends "./layout/v3/session" %}
{% block content %}
    <div class="login-box">
        <div class="login-logo">
            <img src="v3-local/logo/logo-session.png" width="68" height="100" alt="Firefly III Logo" title="Firefly III" />
        </div>

        {% if session_has('error') %}
            <div class="alert alert-danger alert-dismissible" role="alert">
                <button type="button" class="close" data-dismiss="alert">
                    <span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
                </button>
                <strong>{{ 'flash_error'|_ }}</strong> {{ session('error') }}
            </div>
        {% endif %}


        <!-- /.login-logo -->
        <div class="card">
            <div class="card-body login-card-body">
                <p class="login-box-msg">{{ trans('firefly.two_factor_welcome', {user: user.email}) }}</p>
                <p class="login-box-msg">{{ 'two_factor_enter_code'|_ }}</p>

                <form action="{{ route('two-factor.submit') }}" method="post">
                    <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
                    <div class="input-group mb-3">
                        <input type="text" name="one_time_password" inputmode="numeric" autocomplete="one-time-code" class="form-control" placeholder="{{ 'two_factor_code_here'|_ }}" autofocus />
                        <div class="input-group-append">
                            <div class="input-group-text">
                                <span class="fas fa-calculator"></span>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <!-- /.col -->
                        <div class="col-6 offset-6">
                            <button type="submit" class="btn btn-primary btn-block">{{ 'authenticate'|_ }}</button>
                        </div>
                        <!-- /.col -->
                    </div>
                </form>
                <p class="mb-1">
                    <a href="{{ route('two-factor.lost') }}">{{ 'two_factor_forgot'|_ }}</a>
                </p>
            </div>
            <!-- /.login-card-body -->
        </div>
    </div>
{% endblock %}
