@extends('layouts.login')

@section('content')
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-12 col-md-6">
            <img src="{{ asset('img/logo.png') }}" alt="Unioil Logo" class="img-fluid d-block mx-auto" style="max-width: 150px;">

            <div class="mb-3 text-center">
                <h4 class="mb-1 fw-bold">Change Password</h4>
                <span style="font-size: 14px;" class="text-muted">Enter a new password to continue</span>
            </div>

            <!-- Error/Success Messages -->
            @if ($errors->any())
                <div class="alert alert-danger">
                    @foreach ($errors->all() as $error)
                        {{ $error }}<br>
                    @endforeach
                </div>
            @endif
            @if (session('success'))
                <div class="alert alert-success">
                    {{ session('success') }}
                </div>
            @endif
            @if (session('info'))
                <div class="alert alert-info">
                    {{ session('info') }}
                </div>
            @endif

            <form method="POST" action="{{ route('password.change') }}">
                @csrf
                <input type="hidden" name="admin_uuid" value="{{ session('user.admin_uuid') }}">

                <div class="mb-3">
                    <label for="password" class="form-label fw-semibold" style="font-size: 13px; color: #003366;">New Password</label>
                    <input type="password" class="form-control" id="password" name="password" placeholder="••••••••" required>
                </div>

                <div class="mb-3">
                    <label for="password_confirmation" class="form-label fw-semibold" style="font-size: 13px; color: #003366;">Confirm Password</label>
                    <input type="password" class="form-control" id="password_confirmation" name="password_confirmation" placeholder="••••••••" required>
                </div>

                <div class="row mt-4">
                    <div class="col-6">
                        <a href="{{ route('login') }}" class="text-decoration-none text-primary">Back to Login</a>
                    </div>
                    <div class="col-6 text-end">
                        <button type="submit" class="btn btn-primary w-100" style="background-color: #E74610; border-color: #E74610;">Update</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- Include Bootstrap 5 JS for modal functionality -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
@endsection