<!-- resources/views/auth/password-reset-form.blade.php -->
<!DOCTYPE html>
<html lang="it">

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Nuova Password</title>
        <link rel="stylesheet" href="https://use.typekit.net/dit2bgs.css">
        <link rel="stylesheet" href="/css/style.css">
        <link rel="stylesheet" href="/css/new_style.css">
    </head>

    <body>
        <div class="login--box d-flex flex-column min-vh-100 justify-content-center align-items-center">
            <div class="card--ui mt-5" style="width: 400px;">
                <img src="{{ env('LOGO', '') }}" alt="" class="img-fluid" id="login--logo" style="max-width:400px;width: 100%;margin-bottom: 30px;">

                <h4 class="form--title text-center mb-3">Imposta nuova password</h4>

                @if(session('success'))
                <div class="alert alert-success mb-3">{{ session('success') }}</div>
                @endif

                @if(session('error'))
                <div class="alert alert-danger mb-3">{{ session('error') }}</div>
                @endif

                <form action="/password-reset" method="POST">
                    @csrf
                    <input type="hidden" name="token" value="{{ $token }}">

                    <div class="form--item input-group mb-3">
                        <label for="email">Email</label>
                        <input type="email" class="form-control @error('email') is-invalid @enderror" placeholder="Email" id="email" name="email" value="{{ request('email') }}" required>
                        <span class="input-group-text" id="basic-addon2"><i class="ico--ui mail"></i></span>
                        @error('email')
                        <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="form--item input-group mb-3">
                        <label for="password">Password</label>
                        <input type="password" class="form-control @error('password') is-invalid @enderror" placeholder="Nuova password" id="password" name="password">
                        <span class="input-group-text" id="basic-addon2"><i class="ico--ui lock"></i></span>
                        @error('password')
                        <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="form--item input-group mb-3">
                        <label for="password_confirmation">Password</label>
                        <input type="password" class="form-control @error('password_confirmation') is-invalid @enderror" placeholder="Conferma password" id="password_confirmation" name="password_confirmation">
                        <span class="input-group-text" id="basic-addon2"><i class="ico--ui lock"></i></span>
                        @error('password_confirmation')
                        <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="form--item input-group d-flex align-items-center justify-content-center">
                        <button type="submit" class="btn--ui">Aggiorna password</button>
                    </div>
                </form>

                <div class="credential--recovery d-flex flex-column mt-4">
                    <a href="/">Torna al Login</a>
                </div>
            </div>
        </div>

        <script src="/assets/js/bootstrap.bundle.js"></script>
        <script src="/assets/js/app.js"></script>
    </body>

</html>