@extends('layouts.guest')

@section('css')
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
<style>
 body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(to right, #0b80c8, #1cc88a);
}

#content-wrapper,
    #content,
    .container-fluid {
        background:linear-gradient(to right, #0b80c8, #9ed7fa);
    }

    .card {
        border-radius: 15px;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    }

    .card-header {
        background-color: #0b80c8;
        color: white;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
        padding: 10px 15px;
        display: flex;
        align-items: center;
    }

    .card-header img {
        width: 50px;
        height: 50px;
        object-fit: contain;
        margin-right: 15px;
    }
	.card-header span {
    	font-size: 1.5rem;
    	font-weight: 500;
	}


    .btn-primary {
        background-color: #0b80c8;
        border-color: #0b80c8;
        border-radius: 8px;
    }

    .btn-primary:hover {
        background-color: #06629b;
        border-color: #06629b;
    }

    .form-control:focus {
        border-color: #0b80c8;
        box-shadow: 0 0 0 0.2rem rgba(11, 128, 200, 0.25);
    }

    .form-label {
        font-weight: 500;
    }
</style>
@endsection

@section('content')
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-8 col-lg-7">
            <div class="card">
                <div class="card-header">
                    <img src="{{ asset('assets/images/logo.png') }}" alt="Logo">
                    <span class="fw-bold fs-4">Daftar Akun</span>
                </div>
                <div class="card-body">
                    <form action="{{ route('register.user.submit') }}" method="POST">
                        @csrf

                        {{-- Name --}}
                        <div class="mb-3">
                            <label for="name" class="form-label">Nama Lengkap</label>
                            <input id="name" type="text" class="form-control @error('name') is-invalid @enderror"
                                name="name" value="{{ old('name') }}" required>
                            @error('name')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                        </div>

                        {{-- Email --}}
                        <div class="mb-3">
                            <label for="email" class="form-label">Email</label>
                            <input id="email" type="email" class="form-control @error('email') is-invalid @enderror"
                                name="email" value="{{ old('email') }}" required>
                            @error('email')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                        </div>

                        {{-- Password --}}
                        <div class="mb-3">
                            <label for="password" class="form-label">Kata Sandi</label>
                            <input id="password" type="password"
                                class="form-control @error('password') is-invalid @enderror" name="password"
                                placeholder="Minimal 8 karakter" required>
                            @error('password')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                        </div>

                        {{-- Confirm Password --}}
                        <div class="mb-3">
                            <label for="password-confirm" class="form-label">Konfirmasi Kata Sandi</label>
                            <input id="password-confirm" type="password" class="form-control"
                                name="password_confirmation" placeholder="Ulangi kata sandi" required>
                        </div>

                        {{-- Alamat --}}
                        <div class="mb-3">
                            <label for="alamat" class="form-label">Alamat</label>
                            <input id="alamat" type="text"
                                class="form-control @error('alamat') is-invalid @enderror" name="alamat"
                                value="{{ old('alamat') }}" placeholder="Alamat lengkap">
                            @error('alamat')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                        </div>

                        {{-- Telepon --}}
                        <div class="mb-3">
                            <label for="telepon" class="form-label">Telepon</label>
                            <input id="telepon" type="text"
                                class="form-control @error('telepon') is-invalid @enderror" name="telepon"
                                value="{{ old('telepon') }}" >
                            @error('telepon')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                        </div>

                        {{-- Keterangan --}}
                        <div class="mb-4">
                            <label for="keterangan" class="form-label">Keterangan</label>
                            <input id="keterangan" type="text"
                                class="form-control @error('keterangan') is-invalid @enderror" name="keterangan"
                                value="{{ old('keterangan') }}" placeholder="Isi dengan 'pelamar'">
                            @error('keterangan')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                        </div>


                        <div class="mb-3">
   			 {!! NoCaptcha::display() !!}
  			  @error('g-recaptcha-response')
       			 <div class="text-danger">{{ $message }}</div>
   			 @enderror
			</div>


                        {{-- Submit --}}
                        <div class="text-end">
                            <button type="submit" class="btn btn-primary">
                                <i class="fas fa-user-plus me-1"></i> Daftar
                            </button>
                        </div>

                        </form>
                        <script src="https://www.google.com/recaptcha/api.js" async defer></script>
                       
                    </div>
                </div>
            </div>
        </div>
    </div>
    {!! NoCaptcha::renderJs() !!}
    @endsection
