<?php
    $churchName = $profile?->church_name ?? 'Anglican Church St Peter and Paul';
    $churchLocation = $profile?->location ?? 'Mwenge Kijitonyama';
?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <title>Create Account · <?php echo e($churchName); ?></title>
    <?php echo app('Illuminate\Foundation\Vite')(['resources/css/app.css', 'resources/js/app.js']); ?>
</head>
<body class="auth-body auth-body-refined" data-success-message="<?php echo e(session('success')); ?>" data-error-message="<?php echo e(session('error')); ?>">
    <main class="auth-shell auth-shell-refined">
        <section class="auth-visual auth-visual-refined">
            <div class="auth-topline">
                <i data-lucide="cross"></i>
                <span>Serve Faithfully,<br>Manage Effectively.</span>
            </div>
            <div class="auth-visual-copy">
                <h1>Join the<br>Church Family.</h1>
                <div class="auth-gold-rule"></div>
                <p>Jaza taarifa zako kwa usahihi. Ofisi ya kanisa itaendelea na uhakiki wa registration yako.</p>
            </div>
        </section>

        <section class="auth-panel auth-panel-refined">
            <div class="auth-card auth-card-refined auth-register-card">
                <div class="auth-card-brand">
                    <div class="auth-church-icon">
                        <i data-lucide="user-plus"></i>
                    </div>
                    <h2>Create Account</h2>
                    <strong><?php echo e($churchName); ?></strong>
                    <span><?php echo e($churchLocation); ?></span>
                </div>

                <?php if($errors->any()): ?>
                    <div class="alert alert-danger">
                        <strong>Angalia taarifa hizi:</strong>
                        <ul class="mb-0 mt-2">
                            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li><?php echo e($error); ?></li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                    </div>
                <?php endif; ?>

                <form method="POST" action="<?php echo e(route('register.store')); ?>" class="auth-form">
                    <?php echo csrf_field(); ?>
                    <div class="row g-3">
                        <div class="col-md-4">
                            <label class="form-label">First Name</label>
                            <input type="text" name="first_name" value="<?php echo e(old('first_name')); ?>" class="form-control" required>
                        </div>
                        <div class="col-md-4">
                            <label class="form-label">Middle Name</label>
                            <input type="text" name="middle_name" value="<?php echo e(old('middle_name')); ?>" class="form-control">
                        </div>
                        <div class="col-md-4">
                            <label class="form-label">Last Name</label>
                            <input type="text" name="last_name" value="<?php echo e(old('last_name')); ?>" class="form-control" required>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label">Phone Number</label>
                            <div class="input-icon">
                                <i data-lucide="phone"></i>
                                <input type="text" name="phone" value="<?php echo e(old('phone')); ?>" class="form-control" data-phone-input placeholder="+255 700 000 000" required>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label">Email</label>
                            <input type="email" name="email" value="<?php echo e(old('email')); ?>" class="form-control">
                        </div>
                        <div class="col-md-4">
                            <label class="form-label">Gender</label>
                            <select name="gender" class="form-select">
                                <option value="">Select gender</option>
                                <option value="Male" <?php if(old('gender') === 'Male'): echo 'selected'; endif; ?>>Male</option>
                                <option value="Female" <?php if(old('gender') === 'Female'): echo 'selected'; endif; ?>>Female</option>
                            </select>
                        </div>
                        <div class="col-md-4">
                            <label class="form-label">Date of Birth</label>
                            <input type="date" name="date_of_birth" value="<?php echo e(old('date_of_birth')); ?>" class="form-control">
                        </div>
                        <div class="col-md-4">
                            <label class="form-label">Jumuiya / Cell</label>
                            <select name="jumuiya_id" class="form-select">
                                <option value="">Select Jumuiya</option>
                                <?php $__currentLoopData = $jumuiyas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $jumuiya): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($jumuiya->id); ?>" <?php if((string) old('jumuiya_id') === (string) $jumuiya->id): echo 'selected'; endif; ?>><?php echo e($jumuiya->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label">Member Position</label>
                            <select name="member_position_id" class="form-select">
                                <option value="">Select position</option>
                                <?php $__currentLoopData = $positions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $position): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($position->id); ?>" <?php if((string) old('member_position_id') === (string) $position->id): echo 'selected'; endif; ?>><?php echo e($position->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label">Address</label>
                            <input type="text" name="address" value="<?php echo e(old('address')); ?>" class="form-control">
                        </div>
                    </div>
                    <button class="btn btn-primary w-100 auth-submit mt-2" type="submit">
                        <span>Submit Registration</span>
                        <i data-lucide="arrow-right"></i>
                    </button>
                    <a href="<?php echo e(route('login')); ?>" class="btn btn-outline-primary w-100">
                        <i data-lucide="arrow-left"></i>
                        <span>Back to Sign In</span>
                    </a>
                </form>
            </div>
        </section>
    </main>
</body>
</html>
<?php /**PATH /var/www/html/anglican/resources/views/auth/register.blade.php ENDPATH**/ ?>