@php
$configData = Helper::applClasses();
@endphp
@extends('layouts/fullLayoutMaster')

@section('title', 'Reset Password')

@section('page-style')
  {{-- Page Css files --}}
  <link rel="stylesheet" href="{{ asset(mix('css/base/plugins/forms/form-validation.css')) }}">
  <link rel="stylesheet" href="{{ asset(mix('css/base/pages/authentication.css')) }}">
@endsection

@section('content')
<div class="auth-wrapper auth-cover">
  <div class="auth-inner row m-0">
    <!-- Brand logo-->
    <div class="brand-logo">
      <img style="width: 220px;height: 38px" src="{{ asset("upload/icon_ews.png") }}" alt="">
    </div>
    <!-- /Brand logo-->

    <!-- Left Text-->
    <div class="d-none d-lg-flex col-lg-8 align-items-center p-5">
      <div class="w-100 d-lg-flex align-items-center justify-content-center px-5">
        @if($configData['theme'] === 'dark')
         <img src="{{asset('images/pages/reset-password-v2-dark.svg')}}" class="img-fluid" alt="Register V2" />
        @else
         <img src="{{asset('images/pages/reset-password-v2.svg')}}" class="img-fluid" alt="Register V2" />
        @endif
      </div>
    </div>
    <!-- /Left Text-->

    <!-- Reset password-->
    <div class="d-flex col-lg-4 align-items-center auth-bg px-2 p-lg-5">
      <div class="col-12 col-sm-8 col-md-6 col-lg-12 px-xl-2 mx-auto">
        <h2 class="card-title fw-bold mb-1">Reset Password 🔒</h2>
        <p class="card-text mb-2">Kata sandi baru Anda harus berbeda dari kata sandi yang digunakan sebelumnya</p>
        @if (session('error'))
        <div class="alert alert-danger p-1">
            {{ session("error") }}
        </div>
    @endif
    @if (session('success'))
        <div class="alert alert-success p-1">
            {{ session("success") }}
        </div>
    @endif
        <form class="auth-reset-password-form mt-2" action="{{ url('simpan_reset_password') }}" method="POST" enctype="multipart/form-data">
          @csrf
          @method("PUT")
          <input type="hidden" name="token" value="{{ $token }}" required>
          <input type="hidden" name="email" value="{{ $result->email }}" required>
          <div class="mb-1">
            <div class="d-flex justify-content-between">
              <label class="form-label" for="reset-password-new">New Password</label>
            </div>
            <div class="input-group input-group-merge form-password-toggle">
              <input class="form-control form-control-merge @error('password_new')
              is-invalid
            @enderror" id="reset-password-new" type="password" name="password_new" placeholder="············" aria-describedby="reset-password-new" autofocus="" tabindex="1" required>
              <span class="input-group-text cursor-pointer"><i data-feather="eye"></i></span>
            </div>
            @error('password_new')
              <small class="text-danger">{{ $message }}</small>
            @enderror
          </div>
          <div class="mb-1">
            <div class="d-flex justify-content-between">
              <label class="form-label" for="reset-password-confirm">Confirm Password</label>
            </div>
            <div class="input-group input-group-merge form-password-toggle">
              <input class="form-control form-control-merge @error('password_dua')
                is-invalid
              @enderror" id="reset-password-confirm" type="password" name="password_dua" placeholder="············" aria-describedby="reset-password-confirm" tabindex="2" required>
              <span class="input-group-text cursor-pointer"><i data-feather="eye"></i></span>
            </div>
            @error('password_dua')
              <small class="text-danger">{{ $message }}</small>
            @enderror
          </div>
          <button class="btn btn-primary w-100" tabindex="3">Simpan Password</button>
        </form>
        <p class="text-center mt-2">
          <a href="{{url('login')}}">
            <i data-feather="chevron-left"></i> Kembali login
          </a>
        </p>
      </div>
    </div>
    <!-- /Reset password-->
  </div>
</div>
@endsection

@section('vendor-script')
<script src="{{asset(mix('vendors/js/forms/validation/jquery.validate.min.js'))}}"></script>
@endsection

@section('page-script')
<script src="{{asset(mix('js/scripts/pages/auth-reset-password.js'))}}"></script>
@endsection
