@extends('layouts.base')

@section('content')
    @if (session('status'))
        <div class="fluid-container h-100">
            <div class="row no-margin" style="min-height: 100%; ">
                <div class="card no-margin" style="background-image: url({{asset('images/shipping_bg.jpeg')}}); background-position: center; background-size: cover;">
                    <div class="card-body row align-items-center justify-content-center">
                        <div class="col-5 padding-50 bg-white text-center">
                            <div class="password_panel">
                                <div class="password_desc">
                                    <i class="text-success fs-40 block"></i>
                                    <h5 class="font-heading bold">We just sent an email to reset your password</h5>
                                    <p class="text-muted no-margin p-b-20">Click on the link we've sent you to reset your password.
                                        if you have not received an email, Please check your spambox</p>
                                </div>
                                <div class="row">
                                    <div class="col no-padding text-center">
                                        <a href="{{ route('login') }}">
                                            <button class="btn btn-primary">Back to Login</button>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    @else
    <div class="fluid-container h-100">
        <div class="row no-margin" style=" min-height: 100%; ">
            <div class="col no-padding" style="background-image: url({{asset('images/shipping_bg.jpeg')}}); background-position: center; background-size: cover;">
                <div class="w-100 h-100 bg-primary" style="position: absolute; opacity: 0.1;"></div>
            </div>
            <div class="col-4 padding-50 bg-white">
                <div class="row m-t-50">
                    <div class="col m-t-50 p-l-0">
                        <img src="{{asset('images/logo.png')}}" alt="logo" height="35">
                    </div>
                </div>
                <div class="row m-t-50">
                    <div class="col">
                        <div class="inline v-align-middle">
                            <h4 class="font-heading no-margin lh-28">Forget Your Password</h4>
                            <p class="no-margin hint-text lh-18">Reset it using your credentials</p>
                        </div>
                    </div>
                </div>
                <div class="row m-t-10">
                    <div class="col">
                        <div class="row">
                            <div class="col">
                                @if($errors->any())
                                    @foreach ($errors->all() as $error)
                                        <div class="error">{{ $error }}</div>
                                    @endforeach
                                @endif
                            </div>
                        </div>
                        <form method="POST" action="{{ route('password.email') }}">
                            @csrf

                            <div class="form-group form-group-default">
                                <label>Username</label>
                                <div class="controls">
                                    <input name="email" placeholder="Email Address" id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" required>
                                </div>
                                <div class="col-md-6">

                                    @if ($errors->has('email'))
                                        <span class="invalid-feedback" role="alert">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                                    @endif
                                </div>
                            </div>

                            <div class="row justify-content-end align-items-end">
                                <div class="col-auto">
                                    {{ csrf_field() }}
                                    <button class="btn btn-primary btn-cons m-t-10 pull-right m-r-0">Reset</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    @endif
@endsection