@extends('layouts.landing', ['title' => 'Account - Sign Up'])

@section('content')
    <main class="content-wrapper w-100 px-3 ps-lg-5 pe-lg-4 mx-auto" style="max-width: 1920px">
        <div class="d-lg-flex">
            <!-- Login form + Footer -->
            <div class="d-flex flex-column min-vh-100 w-100 py-4 mx-auto me-lg-5" style="max-width: 416px">
                <!-- Logo -->
                <header class="navbar px-0 pb-4 mt-n2 mt-sm-0 mb-2 mb-md-3 mb-lg-4">
                    <a class="navbar-brand pt-0" href="/">
                        <img src="{{ asset('logo/logo-colored.png') }}" alt="Logo" style="height:40px;" />
                    </a>
                </header>
                <h1 class="h2 mt-auto">{{ __('signup.title') }}</h1>
                <div class="nav fs-sm mb-3 mb-lg-4">
                    {{ __('signup.already_have_account') }}
                    <a class="nav-link text-decoration-underline p-0 ms-2"
                        href="{{ route('login') }}">{{ __('signup.sign_in') }}</a>
                </div>
                {{-- <div class="nav fs-sm mb-4 d-lg-none">
                    <span class="me-2">{{ __('signup.uncertain_about_account') }}</span>
                    <a aria-controls="benefits" class="nav-link text-decoration-underline p-0" data-bs-toggle="offcanvas"
                        href="#benefits">{{ __('signup.explore_benefits') }}</a>
                </div> --}}
                <!-- Form -->
                <form class="needs-validation" novalidate="" method="POST" action="{{ route('register') }}">
                    @csrf
                    
                    <!-- Error Messages -->
                    @if ($errors->any())
                        <div class="alert alert-danger mb-4">
                            <ul class="mb-0">
                                @foreach ($errors->all() as $error)
                                    <li>{{ $error }}</li>
                                @endforeach
                            </ul>
                        </div>
                    @endif
                    
                    @if(session('error'))
                        <div class="alert alert-danger mb-4">
                            {{ session('error') }}
                        </div>
                    @endif
                    
                    @if(session('success'))
                        <div class="alert alert-success mb-4">
                            {{ session('success') }}
                        </div>
                    @endif
                    <div class="position-relative mb-4">
                        <label class="form-label" for="register-name">{{ __('signup.name_label') }}</label>
                        <input class="form-control form-control-lg" id="register-name" name="name" 
                            placeholder="{{ __('signup.name_placeholder') }}" required="" type="text" value="{{ old('name') }}" />
                        <div class="invalid-tooltip bg-transparent py-0">{{ __('signup.name_invalid') }}</div>
                    </div>
                    <div class="position-relative mb-4">
                        <label class="form-label" for="register-email">{{ __('signup.email_label') }}</label>
                        <input class="form-control form-control-lg" id="register-email" name="email" 
                            placeholder="{{ __('signup.email_placeholder') }}" type="email" value="{{ old('email') }}" />
                        <div class="invalid-tooltip bg-transparent py-0">{{ __('signup.email_invalid') }}</div>
                    </div>
                    <div class="position-relative mb-4">
                        <label class="form-label" for="register-phone">{{ __('signup.phone_label') }}</label>
                        <input class="form-control form-control-lg" id="register-phone" name="phone" 
                            placeholder="{{ __('signup.phone_placeholder') }}" type="tel" value="{{ old('phone') }}" />
                    </div>
                    <div class="position-relative mb-4">
                        <label class="form-label" for="register-referral">{{ __('signup.referral_label') }}</label>
                        <input class="form-control form-control-lg" id="register-referral" name="referral" 
                            placeholder="{{ __('signup.referral_placeholder') }}" type="text" value="{{ old('referral') }}" />
                    </div>
                    <div class="row mb-4">
                        <div class="col-md">
                            <label class="form-label" for="register-gender">{{ __('signup.gender_label') }}</label>
                            <select class="form-select form-select-lg" style="margin-bottom:16px;" id="register-gender" name="gender">
                                <option value="" {{ old('gender') == '' ? 'selected' : '' }}>{{ __('signup.select_gender') }}</option>
                                <option value="LAKI-LAKI" {{ old('gender') == 'LAKI-LAKI' ? 'selected' : '' }}>{{ __('signup.gender_male') }}</option>
                                <option value="PEREMPUAN" {{ old('gender') == 'PEREMPUAN' ? 'selected' : '' }}>{{ __('signup.gender_female') }}</option>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label" for="register-date-of-birth">{{ __('signup.date_of_birth_label') }}</label>
                            <input class="form-control form-control-lg" id="register-date-of-birth" name="date_of_birth" 
                                placeholder="{{ __('signup.date_of_birth_placeholder') }}" type="date" value="{{ old('date_of_birth') }}" />
                        </div>
                    </div>
    
                    <div class="d-flex flex-column gap-2 mb-4">
                        
                        <div class="form-check">
                            <input class="form-check-input" id="privacy" required="" type="checkbox" />
                            <label class="form-check-label" for="privacy">{!! __('signup.privacy_policy', ['privacy_policy' => '<a class="text-dark-emphasis" href="#!">' . __('signup.privacy_policy_link') . '</a>']) !!}</label>
                        </div>
                    </div>
                    <button class="btn btn-lg btn-primary w-100" type="submit">
                        {{ __('signup.create_account') }}
                        <i class="ci-chevron-right fs-lg ms-1 me-n1"></i>
                    </button>
                </form>
                <!-- Divider -->
                <div class="d-flex align-items-center my-4">
                    <hr class="w-100 m-0" />
                    <span class="text-body-emphasis fw-medium text-nowrap mx-4">{{ __('signup.or_continue_with') }}</span>
                    <hr class="w-100 m-0" />
                </div>
                <!-- Social login -->
                <div class="d-flex flex-column flex-sm-row gap-3 pb-4 mb-3 mb-lg-4">
                    <button class="btn btn-lg btn-outline-secondary w-100 px-2" type="button">
                        <i class="ci-google ms-1 me-1"></i>
                        {{ __('signup.google') }}
                    </button>
                    <button class="btn btn-lg btn-outline-secondary w-100 px-2" type="button">
                        <i class="ci-facebook ms-1 me-1"></i>
                        {{ __('signup.facebook') }}
                    </button>
                    <button class="btn btn-lg btn-outline-secondary w-100 px-2" type="button">
                        <i class="ci-apple ms-1 me-1"></i>
                        {{ __('signup.apple') }}
                    </button>
                </div>
                <!-- Footer -->
                  <footer class="mt-auto">
                    {{-- <div class="nav mb-4">
                        <a class="nav-link text-decoration-underline p-0"
                            href="{{ route('second', ['help', 'topics-v1']) }}">Need help?</a>
                    </div>
                    <p class="fs-xs mb-0">
                        © All rights reserved. Made by <span class="animate-underline"><a
                                class="animate-target text-dark-emphasis text-decoration-none"
                                href="https://coderthemes.com/" rel="noreferrer" target="_blank">Coderthemes</a></span>
                    </p> --}}
                </footer>
            </div>
            <!-- Benefits section that turns into offcanvas on screens < 992px wide (lg breakpoint) -->
            <div class="offcanvas-lg offcanvas-end w-100 py-lg-4 ms-auto" id="benefits" style="max-width: 1034px">
                <div class="offcanvas-header justify-content-end position-relative z-2 p-3">
                    <button aria-label="Close"
                        class="btn btn-icon btn-outline-dark text-dark border-dark bg-transparent rounded-circle d-none-dark"
                        data-bs-dismiss="offcanvas" data-bs-target="#benefits" type="button">
                        <i class="ci-close fs-lg"></i>
                    </button>
                    <button aria-label="Close"
                        class="btn btn-icon btn-outline-dark text-light border-light bg-transparent rounded-circle d-none d-inline-flex-dark"
                        data-bs-dismiss="offcanvas" data-bs-target="#benefits" type="button">
                        <i class="ci-close fs-lg"></i>
                    </button>
                </div>
                <div class="position-absolute top-0 start-0 w-100 h-100 d-lg-none">
                    <span class="position-absolute top-0 start-0 w-100 h-100 d-none-dark"
                        style="background: linear-gradient(-90deg, #accbee 0%, #e7f0fd 100%)"></span>
                    <span class="position-absolute top-0 start-0 w-100 h-100 d-none d-block-dark"
                        style="background: linear-gradient(-90deg, #1b273a 0%, #1f2632 100%)"></span>
                </div>
                <div
                    class="offcanvas-body position-relative z-2 d-lg-flex flex-column align-items-center justify-content-center h-100 pt-2 px-3 p-lg-0">
                    <div class="position-absolute top-0 start-0 w-100 h-100 d-none d-lg-block">
                        <span class="position-absolute top-0 start-0 w-100 h-100 rounded-5 d-none-dark"
                            style="background: linear-gradient(-90deg, #accbee 0%, #e7f0fd 100%)"></span>
                        <span class="position-absolute top-0 start-0 w-100 h-100 rounded-5 d-none d-block-dark"
                            style="background: linear-gradient(-90deg, #1b273a 0%, #1f2632 100%)"></span>
                    </div>
                    <div class="position-relative z-2 w-100 text-center px-md-2 p-lg-5">
                        <h2 class="h4 pb-3">{{ __('signup.benefits_title') }}</h2>
                        <div class="mx-auto" style="max-width: 790px">
                            <div class="row row-cols-1 row-cols-sm-2 g-3 g-md-4 g-lg-3 g-xl-4">
                                <div class="col">
                                    <div class="card h-100 bg-transparent border-0">
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white bg-opacity-25 border border-white border-opacity-50 rounded-4 d-none-dark"></span>
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white border rounded-4 d-none d-block-dark"
                                            style="--cz-bg-opacity: .05"></span>
                                        <div class="card-body position-relative z-2">
                                            <div class="d-inline-flex position-relative text-info p-3">
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-white rounded-pill d-none-dark"></span>
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-body-secondary rounded-pill d-none d-block-dark"></span>
                                                <i class="ci-mail position-relative z-2 fs-4 m-1"></i>
                                            </div>
                                            <h3 class="h6 pt-2 my-2">{{ __('signup.benefit_1_title') }}</h3>
                                        </div>
                                    </div>
                                </div>
                                <div class="col">
                                    <div class="card h-100 bg-transparent border-0">
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white bg-opacity-25 border border-white border-opacity-50 rounded-4 d-none-dark"></span>
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white border rounded-4 d-none d-block-dark"
                                            style="--cz-bg-opacity: .05"></span>
                                        <div class="card-body position-relative z-2">
                                            <div class="d-inline-flex position-relative text-info p-3">
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-white rounded-pill d-none-dark"></span>
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-body-secondary rounded-pill d-none d-block-dark"></span>
                                                <i class="ci-settings position-relative z-2 fs-4 m-1"></i>
                                            </div>
                                            <h3 class="h6 pt-2 my-2">{{ __('signup.benefit_2_title') }}</h3>
                                        </div>
                                    </div>
                                </div>
                                <div class="col">
                                    <div class="card h-100 bg-transparent border-0">
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white bg-opacity-25 border border-white border-opacity-50 rounded-4 d-none-dark"></span>
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white border rounded-4 d-none d-block-dark"
                                            style="--cz-bg-opacity: .05"></span>
                                        <div class="card-body position-relative z-2">
                                            <div class="d-inline-flex position-relative text-info p-3">
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-white rounded-pill d-none-dark"></span>
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-body-secondary rounded-pill d-none d-block-dark"></span>
                                                <i class="ci-gift position-relative z-2 fs-4 m-1"></i>
                                            </div>
                                            <h3 class="h6 pt-2 my-2">{{ __('signup.benefit_3_title') }}</h3>
                                        </div>
                                    </div>
                                </div>
                                <div class="col">
                                    <div class="card h-100 bg-transparent border-0">
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white bg-opacity-25 border border-white border-opacity-50 rounded-4 d-none-dark"></span>
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white border rounded-4 d-none d-block-dark"
                                            style="--cz-bg-opacity: .05"></span>
                                        <div class="card-body position-relative z-2">
                                            <div class="d-inline-flex position-relative text-info p-3">
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-white rounded-pill d-none-dark"></span>
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-body-secondary rounded-pill d-none d-block-dark"></span>
                                                <i class="ci-percent position-relative z-2 fs-4 m-1"></i>
                                            </div>
                                            <h3 class="h6 pt-2 my-2">{{ __('signup.benefit_4_title') }}</h3>
                                        </div>
                                    </div>
                                </div>
                                <div class="col">
                                    <div class="card h-100 bg-transparent border-0">
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white bg-opacity-25 border border-white border-opacity-50 rounded-4 d-none-dark"></span>
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white border rounded-4 d-none d-block-dark"
                                            style="--cz-bg-opacity: .05"></span>
                                        <div class="card-body position-relative z-2">
                                            <div class="d-inline-flex position-relative text-info p-3">
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-white rounded-pill d-none-dark"></span>
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-body-secondary rounded-pill d-none d-block-dark"></span>
                                                <i class="ci-heart position-relative z-2 fs-4 m-1"></i>
                                            </div>
                                            <h3 class="h6 pt-2 my-2">{{ __('signup.benefit_5_title') }}</h3>
                                        </div>
                                    </div>
                                </div>
                                <div class="col">
                                    <div class="card h-100 bg-transparent border-0">
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white bg-opacity-25 border border-white border-opacity-50 rounded-4 d-none-dark"></span>
                                        <span
                                            class="position-absolute top-0 start-0 w-100 h-100 bg-white border rounded-4 d-none d-block-dark"
                                            style="--cz-bg-opacity: .05"></span>
                                        <div class="card-body position-relative z-2">
                                            <div class="d-inline-flex position-relative text-info p-3">
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-white rounded-pill d-none-dark"></span>
                                                <span
                                                    class="position-absolute top-0 start-0 w-100 h-100 bg-body-secondary rounded-pill d-none d-block-dark"></span>
                                                <i class="ci-pie-chart position-relative z-2 fs-4 m-1"></i>
                                            </div>
                                            <h3 class="h6 pt-2 my-2">{{ __('signup.benefit_6_title') }}</h3>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
@endsection

@section('scripts')
@endsection
