@extends('layouts.app')

@section('title', 'Recuperar contraseña - OnAPB')

@section('content')
<div class="container mt-5 mb-5">
    <div class="kinetic-card p-5 mx-auto" style="max-width:500px;">
        <h3 class="mb-4 text-center fw-bold" style="color: var(--primary);">RECUPERAR CONTRASEÑA</h3>
        <p class="text-center text-muted mb-4 small">Ingresá tu DNI y tu correo electrónico. Te enviaremos un enlace para restablecerla de forma segura.</p>

        @if(session('mensaje'))
            <div class="alert border-0 mb-4 p-3 d-flex align-items-center" style="background: rgba(13, 202, 240, 0.1); border-radius: var(--radius-sm);">
                <i class="bi bi-info-circle-fill text-info fs-3 me-3"></i>
                <div>
                   <span class="text-muted small">{!! session('mensaje') !!}</span>
                </div>
            </div>
        @endif

        @if($errors->any())
            <div class="alert alert-danger border-0 mb-4 p-3 d-flex align-items-center" style="background: rgba(220, 53, 69, 0.1); border-radius: var(--radius-sm);">
                <i class="bi bi-exclamation-triangle-fill text-danger fs-3 me-3"></i>
                <div>
                    @foreach($errors->all() as $error)
                        <span class="text-muted small d-block">{{ $error }}</span>
                    @endforeach
                </div>
            </div>
        @endif

        <form method="POST" action="{{ route('recuperar') }}">
            @csrf

            <div class="form-floating mb-3">
                <input type="text" name="dni" class="form-control" id="dniRecInput" value="{{ old('dni') }}" placeholder="DNI sin puntos" required>
                <label for="dniRecInput">DNI *</label>
            </div>

            <div class="form-floating mb-4">
                <input type="email" name="email" class="form-control" id="emailRecInput" value="{{ old('email') }}" placeholder="ejemplo@correo.com" required>
                <label for="emailRecInput">Correo Electrónico *</label>
            </div>

            <div class="mb-3">
                <div class="cf-turnstile" data-sitekey="{{ config('services.turnstile.site_key') }}"></div>
            </div>

            <button type="submit" class="btn btn-primary btn-lg w-100">Enviar enlace de recuperación</button>

            <div class="text-center mt-4 pt-3 border-top border-light">
                <a href="{{ route('home') }}" class="text-decoration-none text-muted small fw-bold">
                    <i class="bi bi-arrow-left me-1"></i> Volver al inicio
                </a>
            </div>
        </form>
    </div>
</div>
@endsection
