<?php $__env->startSection('page_title', __('Registro de organizador')); ?>

<?php $__env->startSection('auth_nav'); ?>
    <a href="<?php echo e(route('organizador')); ?>" class="btn btn-sm btn-outline-light px-3"><?php echo e(__('Volver')); ?></a>
    <a href="<?php echo e(route('login')); ?>" class="btn btn-sm rt-btn-cherry px-3"><?php echo e(__('Ya tengo cuenta')); ?></a>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="rt-auth-card rt-auth-card--focus">
        <h1 class="rt-auth-card-title"><?php echo e(__('Solicitud de organizador')); ?></h1>
        <p class="rt-auth-card-lead mb-0"><?php echo e(__('Completa el formulario. Revisaremos tu solicitud y te notificaremos por correo.')); ?></p>

        <div class="rt-auth-divider"></div>

        <form method="POST" action="<?php echo e(route('register.organizer.store')); ?>" class="rt-auth-form">
            <?php echo csrf_field(); ?>

            <div class="mb-3">
                <label for="name" class="rt-auth-label"><?php echo e(__('Nombre completo')); ?></label>
                <input id="name" type="text" class="form-control <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="name" value="<?php echo e(old('name')); ?>" required autocomplete="name" autofocus>

                <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="mb-3">
                <label for="email" class="rt-auth-label"><?php echo e(__('Correo electrónico')); ?></label>
                <input id="email" type="email" class="form-control <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="email" value="<?php echo e(old('email')); ?>" required autocomplete="email">

                <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <?php echo $__env->make('partials.rt-password-field', [
                'name' => 'password',
                'id' => 'password',
                'label' => __('Contraseña'),
                'autocomplete' => 'new-password',
                'placeholder' => __('Mínimo 8 caracteres'),
                'showMeter' => true,
                'minlength' => 8,
            ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <?php echo $__env->make('partials.rt-password-field', [
                'name' => 'password_confirmation',
                'id' => 'password-confirm',
                'label' => __('Confirmar contraseña'),
                'autocomplete' => 'new-password',
                'placeholder' => __('Repite la contraseña'),
                'showMeter' => false,
                'errorKey' => 'password',
                'silentError' => true,
                'wrapperClass' => 'mb-3',
                'minlength' => 8,
            ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <div class="mb-3">
                <label for="organization_name" class="rt-auth-label"><?php echo e(__('Nombre de la organización')); ?></label>
                <input id="organization_name" type="text" class="form-control <?php $__errorArgs = ['organization_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="organization_name" value="<?php echo e(old('organization_name')); ?>" required maxlength="255">

                <?php $__errorArgs = ['organization_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="mb-3">
                <label for="phone" class="rt-auth-label"><?php echo e(__('Teléfono')); ?></label>
                <input id="phone" type="text" class="form-control <?php $__errorArgs = ['phone'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="phone" value="<?php echo e(old('phone')); ?>" required maxlength="32">

                <?php $__errorArgs = ['phone'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="mb-4">
                <label for="primary_event_type" class="rt-auth-label"><?php echo e(__('Tipo de eventos que organizas')); ?></label>
                <select id="primary_event_type" name="primary_event_type" class="form-select <?php $__errorArgs = ['primary_event_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                    <option value="" disabled <?php echo e(old('primary_event_type') ? '' : 'selected'); ?>><?php echo e(__('Selecciona…')); ?></option>
                    <?php $__currentLoopData = \App\Enums\OrganizerPrimaryEventType::cases(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($type->value); ?>" <?php if(old('primary_event_type') === $type->value): echo 'selected'; endif; ?>><?php echo e($type->label()); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['primary_event_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <button type="submit" class="btn btn-sm rt-btn-cherry w-100 mb-3"><?php echo e(__('Enviar solicitud')); ?></button>

            <p class="text-center small text-secondary mb-0">
                <?php echo e(__('¿Solo quieres comprar entradas?')); ?>

                <a class="rt-auth-link" href="<?php echo e(route('register')); ?>"><?php echo e(__('Registro de cliente')); ?></a>
            </p>
        </form>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
    <?php if($errors->any()): ?>
        <script>
            document.addEventListener('DOMContentLoaded', function () {
                const errorMessages = <?php echo json_encode($errors->all()); ?>;
                Swal.fire({
                    icon: 'error',
                    title: <?php echo json_encode(__('¡Atención!'), 15, 512) ?>,
                    html: '<div class="text-start small mt-2">' + 
                          '<ul class="mb-0">' + 
                          errorMessages.map(msg => '<li>' + msg + '</li>').join('') + 
                          '</ul>' + 
                          '</div>',
                    confirmButtonColor: '#b91830',
                    confirmButtonText: <?php echo json_encode(__('Entendido'), 15, 512) ?>,
                });
            });
        </script>
    <?php endif; ?>
<?php $__env->stopPush(); ?>

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