<!-- ================================================================= -->
            <!-- 6. LEAVE YOUR WISHES (Input Form Card)                            -->
            <!-- ================================================================= -->
            <?php if (isset($sectionMap['wishes'])): 
                $wishesConfig = $sectionMap['wishes'];
                $maxCharLimit = (int)($wishesConfig['max_char_limit'] ?? 1000);
            ?>
                <section class="py-16 md:py-20 lg:py-24 px-6 md:px-12 border-b <?= $style['borderColor'] ?>">
                    <?php
    $headerClass = 'text-center space-y-2 mb-8';
    $headerEmoji = '✍️';
    $headerTitle = 'Leave Your Wishes';
    require __DIR__ . '/../partials/section_header.php';
    unset($headerClass, $headerEmoji, $headerEmojiClass, $headerTitle);
?>

                    <div class="w-full max-w-xl mx-auto text-left">
                        <div class="<?= $style['cardBg'] ?> rounded-3xl border <?= $style['borderColor'] ?> shadow-sm p-6 space-y-4">
                            <div class="border-b <?= $style['borderColor'] ?> pb-3">
                                <h3 class="text-base font-bold <?= $style['textColor'] ?> <?= $style['fontSerif'] ?>">Send Congratulations</h3>
                                <p class="text-xs text-slate-400 mt-0.5">Express your warmest prayers and messages for the couple.</p>
                            </div>

                            <?php if ($wish !== null): ?>
                                <div id="wish-display-card" class="bg-amber-50/60 border border-amber-200/80 rounded-2xl p-4 space-y-3">
                                    <div class="flex items-center gap-2 text-xs font-semibold text-emerald-800">
                                        <span>✓</span> <span>Thank you for your wishes!</span>
                                    </div>
                                    <p class="text-xs italic text-slate-700 font-serif-fancy leading-relaxed">
                                        "<?= escape_html($wish['message']) ?>"
                                    </p>
                                    <button type="button" onclick="toggleWishEdit(true)" class="inline-flex items-center px-3 py-1.5 border border-slate-300 rounded-lg text-xs font-semibold text-slate-700 bg-white hover:bg-slate-50 transition shadow-sm">
                                        ✏️ Edit Wish
                                    </button>
                                </div>
                            <?php endif; ?>

                            <?php if (!$live_preview): ?>
                                <div id="wish-form-card" class="<?php if ($wish !== null): ?>hidden<?php endif; ?> space-y-4">
                                    <form action="<?= url('/' . escape_html($workspace['slug']) . '/i/' . escape_html($guestToken) . '/wish') ?>" method="POST" class="space-y-4">
                                        <?= csrf_field() ?>

                                        <div>
                                            <p class="text-xs <?= $style['subText'] ?> mb-2">Sending wish as: <strong class="<?= $style['textColor'] ?> font-bold"><?= escape_html($guestName) ?></strong></p>
                                            <label for="wish_message" class="block text-xxs uppercase tracking-wider text-slate-400 font-bold mb-1">Your Message</label>
                                            <textarea 
                                                id="wish_message" 
                                                name="message" 
                                                rows="3" 
                                                maxlength="<?= $maxCharLimit ?>" 
                                                placeholder="Write your congratulations and prayers here..." 
                                                class="w-full text-xs p-3 bg-slate-50 border <?= $style['borderColor'] ?> rounded-xl text-slate-700 focus:outline-none focus:border-amber-400" 
                                                required
                                            ><?= $wish ? escape_html($wish['message']) : '' ?></textarea>
                                            <span class="text-[10px] text-slate-400 block text-right mt-1">Max <?= $maxCharLimit ?> characters</span>
                                        </div>

                                        <div class="pt-1 flex gap-2">
                                            <button type="submit" class="flex-1 inline-flex justify-center items-center px-4 py-2.5 border border-transparent text-xs font-bold rounded-xl <?= $style['primaryBtn'] ?> transition shadow-sm">
                                                <i class="fa-solid fa-paper-plane mr-1.5 text-[10px]"></i> <?= $wish !== null ? 'Update Wish' : 'Send Wishes' ?>
                                            </button>
                                            <?php if ($wish !== null): ?>
                                                <button type="button" onclick="toggleWishEdit(false)" class="inline-flex items-center px-4 py-2 border border-slate-300 rounded-xl text-xs font-semibold text-slate-700 bg-white hover:bg-slate-50 transition shadow-sm">
                                                    Cancel
                                                </button>
                                            <?php endif; ?>
                                        </div>
                                    </form>
                                </div>
                            <?php else: ?>
                                <div class="bg-amber-50/60 border border-amber-200/80 text-amber-800 rounded-2xl p-4 text-xs font-semibold flex items-center gap-3">
                                    <span>🔒</span>
                                    <span>Wish submission is disabled in Live Preview.</span>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                </section>
            <?php endif; ?>
