<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>تسجيل حالة طلاق — <?= e($member['full_name_ar']) ?><?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<form method="POST" action="/divorce/store/<?= (int) $member['id'] ?>">
    <?= csrf_field() ?>
    <div class="card" style="padding:20px;margin-bottom:20px;">
        <div style="display:grid;grid-template-columns:1fr 1fr;gap:15px;">
            <div class="form-group">
                <label class="form-label">الزوج/الزوجة <span style="color:#DC2626;">*</span></label>
                <select name="spouse_id" class="form-select" required>
                    <option value="">-- اختر --</option>
                    <?php foreach ($spouses as $s): ?><option value="<?= (int) $s['id'] ?>"><?= e($s['full_name_ar']) ?></option><?php endforeach; ?>
                </select>
            </div>
            <div class="form-group">
                <label class="form-label">تاريخ الطلاق <span style="color:#DC2626;">*</span></label>
                <input type="date" name="divorce_date" class="form-input" required max="<?= e(date('Y-m-d')) ?>">
            </div>
            <div class="form-group" style="grid-column:1/-1;">
                <label class="form-label">ملاحظات</label>
                <textarea name="notes" class="form-textarea" rows="3"></textarea>
            </div>
        </div>
    </div>
    <button type="submit" class="btn btn-primary">تسجيل حالة الطلاق</button>
    <a href="/members/<?= (int) $member['id'] ?>" class="btn btn-outline">إلغاء</a>
</form>
<?php $__template->endSection(); ?>