<div class="flex items-center space-x-2">
    <div class="flex">
        <div x-data="{showModal:false}">
            <button @click="showModal = true" class="btn bg-slate-150 font-medium text-slate-800 hover:bg-slate-200 focus:bg-slate-200 active:bg-slate-200/80 dark:bg-navy-500 dark:text-navy-50 dark:hover:bg-navy-450 dark:focus:bg-navy-450 dark:active:bg-navy-450/90">
                <span class="text pr-1"> Transfer Pin </span>
                <i class="fa fa-lock "></i>
            </button>
            <template x-teleport="#x-teleport-target">
                <div class="fixed inset-0 z-[100] flex flex-col items-center justify-center overflow-hidden px-4 py-6 sm:px-5" x-show="showModal" role="dialog" @keydown.window.escape="showModal = false">
                    <div class="absolute inset-0 bg-slate-900/60 transition-opacity duration-300" @click="showModal = false" x-show="showModal" x-transition:enter="ease-out" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="ease-in" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0"></div>
                    <div class="relative w-full max-w-lg origin-top rounded-lg bg-white transition-all duration-300 dark:bg-navy-700" x-show="showModal" x-transition:enter="easy-out" x-transition:enter-start="opacity-0 scale-95" x-transition:enter-end="opacity-100 scale-100" x-transition:leave="easy-in" x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-95">
                        <div class="flex justify-between rounded-t-lg bg-slate-200 px-4 py-3 dark:bg-navy-800 sm:px-5">
                            <h3 class="text-base font-medium text-slate-700 dark:text-navy-100">
                                Update 4-Digit Transfer Pin
                            </h3>
                            <button @click="showModal = !showModal" class="btn -mr-1.5 h-7 w-7 rounded-full p-0 hover:bg-slate-300/20 focus:bg-slate-300/20 active:bg-slate-300/25 dark:hover:bg-navy-300/20 dark:focus:bg-navy-300/20 dark:active:bg-navy-300/25">
                                <svg xmlns="http://www.w3.org/2000/svg" class="h-4.5 w-4.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                                    <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path>
                                </svg>
                            </button>
                        </div>
                        <div class="px-4 py-4 sm:px-5">
                            <p>
                                Do not share your account information with any third party;
                                Keep your account secured.
                            </p>
                            <form autocomplete="off" action="../../bank-manager.php?action=change-pin" method="post">
                                <div class="mt-4 space-y-4">
                                    <label class="block">
                                        <span>Username:</span>
                                        <input class="form-input mt-1.5 w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent" readonly type="text" name="username" value="<?php echo $username ?>" />
                                    </label>
                                    <label class="mt-4 block">
                                        <span>Current 4-Digit Pin:</span>
                                        <span class="relative mt-1.5 flex">
                                            <input required class="form-input mt-1.5 w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 pl-9 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent" placeholder="Input Current Pin" type="password" pattern="[0-9]{4}" inputmode="numeric" maxlength="4" name="current_pin" />
                                            <span class="pointer-events-none absolute flex h-full w-10 items-center justify-center text-slate-400 peer-focus:text-primary dark:text-navy-300 dark:peer-focus:text-accent">
                                                <i class="fa-solid fa-lock"></i>
                                            </span>
                                        </span>
                                    </label>
                                    <input type="hidden" name="current_pin2" value="<?php echo $pin ?>">
                                    <input type="hidden" name="email" value="<?php echo $email ?>">
                                    <label class="mt-4 block">
                                        <span>New Pin:</span>
                                        <span class="relative mt-1.5 flex">
                                            <input required class="form-input mt-1.5 w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 pl-9 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent" placeholder="Input New Pin" type="password" pattern="[0-9]{4}" inputmode="numeric" maxlength="4" name="pin_new" />
                                            <span class="pointer-events-none absolute flex h-full w-10 items-center justify-center text-slate-400 peer-focus:text-primary dark:text-navy-300 dark:peer-focus:text-accent">
                                                <i class="fa-solid fa-lock"></i>
                                            </span>
                                        </span>
                                    </label>
                                    <label class="mt-4 block">
                                        <span>Retype New Pin:</span>
                                        <span class="relative mt-1.5 flex">
                                            <input required class="form-input mt-1.5 w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 pl-9 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent" placeholder="Retype New Pin" type="password" pattern="[0-9]{4}" inputmode="numeric" maxlength="4" name="pin_newx" />
                                            <span class="pointer-events-none absolute flex h-full w-10 items-center justify-center text-slate-400 peer-focus:text-primary dark:text-navy-300 dark:peer-focus:text-accent">
                                                <i class="fa-solid fa-lock"></i>
                                            </span>
                                        </span>
                                    </label>

                                    <input type="hidden" name="email" value="<?php echo $email ?>">
                                    <input type="hidden" name="mypin" value="<?php echo $pin ?>">
                                    <div class="space-x-2">
                                        <button type="submit" class="btn min-w-[7rem] rounded-full bg-primary font-medium text-white hover:bg-primary-focus focus:bg-primary-focus active:bg-primary-focus/90 dark:bg-accent dark:hover:bg-accent-focus dark:focus:bg-accent-focus dark:active:bg-accent/90">
                                            Update Transfer Pin
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </template>
        </div>
    </div>
</div>