@extends('layout')

@section('title', __('store.auth_forgot_password_title'))

@section('content')
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-6 col-lg-5">
            <div class="card shadow">
                <div class="card-body p-4">
                    <h2 class="text-center mb-4">{{ __('store.auth_forgot_password_title') }}</h2>

                    <p class="text-muted text-center mb-4">
                        {{ __('store.auth_forgot_password_description') }}
                    </p>

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

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

                    @if($errors->any())
                        <div class="alert alert-danger">
                            <ul class="mb-0">
                                @foreach($errors->all() as $error)
                                    <li>{{ $error }}</li>
                                @endforeach
                            </ul>
                        </div>
                    @endif

                    <form method="POST" action="{{ route('store.auth.forgot-password.send') }}">
                        @csrf

                        <div class="mb-3">
                            <label for="email" class="form-label">{{ __('store.auth_email') }}</label>
                            <input type="email" class="form-control @error('email') is-invalid @enderror"
                                   id="email" name="email" value="{{ old('email') }}" required autofocus>
                            @error('email')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                        </div>

                        <div class="d-grid mb-3">
                            <button type="submit" class="btn btn-primary btn-lg">
                                <i class="fas fa-envelope me-2"></i>
                                {{ __('store.auth_forgot_password_send') }}
                            </button>
                        </div>

                        <div class="text-center">
                            <p class="mb-0">
                                <a href="{{ route('store.auth.login') }}" class="text-decoration-none">
                                    <i class="fas fa-arrow-left me-1"></i>
                                    {{ __('store.auth_forgot_password_back_to_login') }}
                                </a>
                            </p>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
