<x-guest-layout>
    <a href="{{ route('google.redirect') }}" class="mb-5 flex w-full items-center justify-center gap-3 rounded-lg border border-blue-100 bg-white px-4 py-3 text-sm font-bold text-slate-700 shadow-sm transition hover:bg-blue-50 dark:border-blue-900 dark:bg-slate-950 dark:text-slate-100 dark:hover:bg-blue-950/60">
        <span class="flex h-6 w-6 items-center justify-center rounded-full bg-white text-base font-black text-blue-600">G</span>
        Sign up with Google
    </a>

    <div class="mb-5 flex items-center gap-3">
        <div class="h-px flex-1 bg-blue-100 dark:bg-blue-900/50"></div>
        <span class="text-xs font-bold uppercase tracking-wide text-slate-400 dark:text-slate-500">or email</span>
        <div class="h-px flex-1 bg-blue-100 dark:bg-blue-900/50"></div>
    </div>

    <form method="POST" action="{{ route('register') }}">
        @csrf

        <!-- Name -->
        <div>
            <x-input-label for="name" :value="__('Name')" />
            <x-text-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus autocomplete="name" />
            <x-input-error :messages="$errors->get('name')" class="mt-2" />
        </div>

        <!-- Email Address -->
        <div class="mt-4">
            <x-input-label for="email" :value="__('Email')" />
            <x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autocomplete="username" />
            <x-input-error :messages="$errors->get('email')" class="mt-2" />
        </div>

        <!-- Referral Code -->
        <div class="mt-4">
            <x-input-label for="referral_code" :value="__('Referral Code Optional')" />
            <x-text-input id="referral_code" class="block mt-1 w-full uppercase" type="text" name="referral_code" :value="old('referral_code', $referralCode ?? '')" autocomplete="off" />
            <x-input-error :messages="$errors->get('referral_code')" class="mt-2" />
        </div>

        <!-- Password -->
        <div class="mt-4">
            <x-input-label for="password" :value="__('Password')" />

            <x-text-input id="password" class="block mt-1 w-full"
                            type="password"
                            name="password"
                            required autocomplete="new-password" />

            <x-input-error :messages="$errors->get('password')" class="mt-2" />
        </div>

        <!-- Confirm Password -->
        <div class="mt-4">
            <x-input-label for="password_confirmation" :value="__('Confirm Password')" />

            <x-text-input id="password_confirmation" class="block mt-1 w-full"
                            type="password"
                            name="password_confirmation" required autocomplete="new-password" />

            <x-input-error :messages="$errors->get('password_confirmation')" class="mt-2" />
        </div>

        <div class="flex items-center justify-end mt-4">
            <a class="rounded-md text-sm text-slate-600 underline transition hover:text-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:text-slate-300 dark:hover:text-blue-200 dark:focus:ring-offset-slate-950" href="{{ route('login') }}">
                {{ __('Already registered?') }}
            </a>

            <x-primary-button class="ms-4">
                {{ __('Register') }}
            </x-primary-button>
        </div>
    </form>
</x-guest-layout>
