@php
    $captchaForm = $form ?? '';
    $captchaId = $id ?? null;
    $manualRender = (bool) ($manual ?? false);
    $captchaEnabled = !empty($captcha['enabled']) && !empty($captcha['forms'][$captchaForm]);
@endphp

@if($captchaEnabled)
    <div class="{{ $wrapperClass ?? 'mt-4' }}">
        <div
            @if($captchaId) id="{{ $captchaId }}" @endif
            class="gps-captcha-widget"
            data-captcha-form="{{ $captchaForm }}"
            data-captcha-render="{{ $manualRender ? 'manual' : 'auto' }}"
        ></div>
        @error('captcha')
            <p class="mt-2 text-xs text-red-600">{{ $message }}</p>
        @enderror
    </div>
@endif
