{{-- One-click payment: amount prefilled, 4 method buttons, single tap.
     $invoice required; $installment optional; $methods required. --}}
@php($prefill = isset($installment) ? $installment->remaining() : $invoice->remaining())
<form method="POST" action="{{ route('tenant.invoices.payments.store', $invoice) }}" class="quickpay">
    @csrf
    @isset($installment)
        <input type="hidden" name="installment_id" value="{{ $installment->id }}">
    @endisset
    <div class="d-flex gap-2 flex-wrap align-items-center">
        <div class="input-group input-group-sm" style="max-width:11rem">
            <input type="number" name="amount" value="{{ $prefill }}" min="250" max="{{ $invoice->remaining() }}"
                   step="250" class="form-control" dir="ltr" required>
            <span class="input-group-text">IQD</span>
        </div>
        @foreach($methods as $m)
            <button class="btn btn-sm mb-btn-ghost qp-method" name="method" value="{{ $m->value }}"
                    title="{{ $m->label() }}">{{ $m->icon() }} {{ $m->label() }}</button>
        @endforeach
    </div>
    <input name="reference" class="form-control form-control-sm mt-2 d-none qp-ref" style="max-width:24rem"
           placeholder="{{ __('Reference number (Zain Cash / transfer)') }}">
</form>
