<?php $__env->startSection('title', 'Cadastro — ImóvelZapAi'); ?>

<?php $__env->startSection('content'); ?>
    <div class="flex flex-1 items-center justify-center px-4 py-12">
        <div class="w-full max-w-lg">
            <div class="mb-8 text-center">
                <h1 class="text-2xl font-semibold text-white">ImóvelZapAi</h1>
                <p class="mt-2 text-sm text-slate-400">Crie sua conta e comece a atender pelo WhatsApp</p>
            </div>

            <div class="rounded-2xl border border-slate-800 bg-slate-900 p-8 shadow-xl" x-data="{ accountType: '<?php echo e(old('account_type', 'corretor')); ?>' }">
                <h2 class="mb-6 text-lg font-medium text-white">Cadastro</h2>

                <?php if($errors->any()): ?>
                    <div class="mb-4 rounded-lg border border-red-800 bg-red-950/50 px-4 py-3 text-sm text-red-300">
                        <?php echo e($errors->first()); ?>

                    </div>
                <?php endif; ?>

                <form method="POST" action="<?php echo e(route('register.store')); ?>" class="space-y-5">
                    <?php echo csrf_field(); ?>

                    <fieldset>
                        <legend class="mb-2 text-sm font-medium text-slate-300">Tipo de conta</legend>
                        <div class="grid gap-3 sm:grid-cols-2">
                            <label
                                class="<?php echo \Illuminate\Support\Arr::toCssClasses([
                                    'cursor-pointer rounded-xl border p-4 transition',
                                ]); ?>"
                                :class="accountType === 'corretor' ? 'border-emerald-500 bg-emerald-950/40' : 'border-slate-700 bg-slate-950 hover:border-slate-500'"
                            >
                                <input type="radio" name="account_type" value="corretor" class="sr-only" x-model="accountType" <?php if(old('account_type', 'corretor') === 'corretor'): echo 'checked'; endif; ?>>
                                <span class="block text-sm font-semibold text-white">Corretor</span>
                                <span class="mt-1 block text-xs text-slate-400">Conta individual — 1 usuário</span>
                            </label>
                            <label
                                :class="accountType === 'imobiliaria' ? 'border-emerald-500 bg-emerald-950/40' : 'border-slate-700 bg-slate-950 hover:border-slate-500'"
                                class="cursor-pointer rounded-xl border p-4 transition"
                            >
                                <input type="radio" name="account_type" value="imobiliaria" class="sr-only" x-model="accountType" <?php if(old('account_type') === 'imobiliaria'): echo 'checked'; endif; ?>>
                                <span class="block text-sm font-semibold text-white">Imobiliária</span>
                                <span class="mt-1 block text-xs text-slate-400">Equipe — vários corretores</span>
                            </label>
                        </div>
                    </fieldset>

                    <div>
                        <label for="name" class="mb-1.5 block text-sm font-medium text-slate-300">Seu nome</label>
                        <input id="name" name="name" type="text" required value="<?php echo e(old('name')); ?>"
                               class="w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-white placeholder-slate-500 focus:border-emerald-500 focus:outline-none focus:ring-1 focus:ring-emerald-500"
                               placeholder="Maria Silva">
                    </div>

                    <div x-show="accountType === 'imobiliaria'" x-cloak>
                        <label for="organization_name" class="mb-1.5 block text-sm font-medium text-slate-300">Nome da imobiliária</label>
                        <input id="organization_name" name="organization_name" type="text" value="<?php echo e(old('organization_name')); ?>"
                               class="w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-white placeholder-slate-500 focus:border-emerald-500 focus:outline-none focus:ring-1 focus:ring-emerald-500"
                               placeholder="Imobiliária Exemplo">
                    </div>

                    <div>
                        <label for="email" class="mb-1.5 block text-sm font-medium text-slate-300">E-mail</label>
                        <input id="email" name="email" type="email" required value="<?php echo e(old('email')); ?>" autocomplete="email"
                               class="w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-white placeholder-slate-500 focus:border-emerald-500 focus:outline-none focus:ring-1 focus:ring-emerald-500"
                               placeholder="voce@email.com">
                    </div>

                    <div class="grid gap-4 sm:grid-cols-2">
                        <div>
                            <label for="password" class="mb-1.5 block text-sm font-medium text-slate-300">Senha</label>
                            <input id="password" name="password" type="password" required autocomplete="new-password"
                                   class="w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-white focus:border-emerald-500 focus:outline-none focus:ring-1 focus:ring-emerald-500">
                        </div>
                        <div>
                            <label for="password_confirmation" class="mb-1.5 block text-sm font-medium text-slate-300">Confirmar senha</label>
                            <input id="password_confirmation" name="password_confirmation" type="password" required autocomplete="new-password"
                                   class="w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-white focus:border-emerald-500 focus:outline-none focus:ring-1 focus:ring-emerald-500">
                        </div>
                    </div>

                    <button
                        type="submit"
                        class="w-full rounded-lg bg-emerald-600 px-4 py-2.5 text-sm font-semibold text-white transition hover:bg-emerald-500 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 focus:ring-offset-slate-900"
                    >
                        Criar conta
                    </button>
                </form>

                <p class="mt-6 text-center text-sm text-slate-400">
                    Já tem conta?
                    <a href="<?php echo e(route('login')); ?>" class="font-medium text-emerald-400 hover:text-emerald-300">Entrar</a>
                </p>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.guest', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/backend/resources/views/auth/register.blade.php ENDPATH**/ ?>