@extends('layouts.auth')

@section('title', 'Choose a new password')

@section('content')

    <h1 class="font-display text-3xl tracking-tight text-slate-900">Choose a new password</h1>
    <p class="mt-2 text-sm text-slate-600">Pick something you have not used before.</p>

    @if ($errors->any())
        <x-alert type="danger" class="mt-6">
            <ul class="list-disc space-y-0.5 pl-4">
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </x-alert>
    @endif

    <form method="POST" action="{{ route('password.update') }}" class="mt-8 space-y-5">
        @csrf
        <input type="hidden" name="token" value="{{ $token }}">

        <x-input name="email" type="email" label="Email address" required
                 :value="old('email', $email)" autocomplete="email" />

        <x-input name="password" type="password" label="New password" required
                 autocomplete="new-password" autofocus
                 hint="At least 8 characters, including a letter and a number." />

        <x-input name="password_confirmation" type="password" label="Confirm new password" required
                 autocomplete="new-password" />

        <x-button type="submit" size="lg" class="w-full">Reset password</x-button>
    </form>

@endsection
