<?php if(auth()->guard('admin')->user()->role->name == 'agent') { $layout = 'layouts.agent_layout'; } else { $layout = 'layouts.admin_layout'; } ?>

@extends($layout)

@section('content')
<main class="h-screen overflow-y-auto">
    <div class="container grid px-6 mx-auto">
        <h2
        class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200"
        >
        Change Password
        </h2>
<!-- CTA -->
       
            <x-alert/>
            
        <div class="flex items-center justify-center p-6 sm:p-12 md:w-full">
            <div class="w-1/2">
              <!-- Form Section -->
              <form  method="post" action="{{ route('admin.password.update') }}">
                @csrf

              <label class="block text-sm">
                <span class="text-gray-700 dark:text-gray-400">Current Password</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                  placeholder="Enter Current Password"
                  type="password"
                  name="current_password"
                  required
                />
                @error('current_password')
                <span class="text-xs text-red-600 dark:text-red-400" role="alert">
                    <strong>{{ $message }}</strong>
                </span>
                @enderror
              </label>

              <label class="block mt-4 text-sm">
                <span class="text-gray-700 dark:text-gray-400">New Password</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                  Placeholder="Enter New Password"
                  type="password"
                  name="new_password"
                  required
                />
                @error('new_password')
                <span class="text-xs text-red-600 dark:text-red-400" role="alert">
                    <strong>{{ $message }}</strong>
                </span>
                @enderror
              </label>

              <label class="block mt-4 text-sm">
                <span class="text-gray-700 dark:text-gray-400">Confirm Password</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                  name="new_password_confirmation"
                  type="password"
                  placeholder="Confirm New Password"
                  required
                />
              </label>
            
              <input
                class="block w-full px-4 py-2 mt-4 text-sm font-medium leading-5 text-center text-white transition-colors duration-150 bg-blue-600 border border-transparent rounded-lg bg-grass hover:bg-green-800 focus:outline-none"
                value="Change Password" type="submit"
              >
              </form>
              <!-- End Form Section -->  
            </div>

          </div>

    </div>
</main>
@endsection
