<div class="tab-pane fade" id="security" role="tabpanel">
    <div class="card">
        <div class="card-body">
            {{-- Verification toggles moved to Verification tab --}}
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="captcha_form_protection" class="form-label">{{ __('admin/settings.fields_captcha_form_protection') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <select class="form-select w-50 d-inline-block" id="captcha_form_protection" name="captcha_form_protection">
                            <option value="always_on" {{ ($settings['captcha_form_protection'] ?? '') == 'always_on' ? 'selected' : '' }}>{{ __('admin/settings.options_always_on') }}</option>
                            <option value="off_when_logged_in" {{ ($settings['captcha_form_protection'] ?? '') == 'off_when_logged_in' ? 'selected' : '' }}>{{ __('admin/settings.options_off_when_logged_in') }}</option>
                            <option value="always_off" {{ ($settings['captcha_form_protection'] ?? '') == 'always_off' ? 'selected' : '' }}>{{ __('admin/settings.options_always_off') }}</option>
                        </select>
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_captcha_form_protection_description") }}'></i>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="captcha_type" class="form-label">{{ __('admin/settings.fields_captcha_type') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <select class="form-select w-50 d-inline-block" id="captcha_type" name="captcha_type">
                            <option value="recaptcha_v2" {{ ($settings['captcha_type'] ?? '') == 'recaptcha_v2' ? 'selected' : '' }}>{{ __('admin/settings.options_recaptcha_v2') }}</option>
                            <option value="invisible_recaptcha" {{ ($settings['captcha_type'] ?? '') == 'invisible_recaptcha' ? 'selected' : '' }}>{{ __('admin/settings.options_invisible_recaptcha') }}</option>
                            <option value="recaptcha_v3" {{ ($settings['captcha_type'] ?? '') == 'recaptcha_v3' ? 'selected' : '' }}>{{ __('admin/settings.options_recaptcha_v3') }}</option>
                            <option value="cloudflare_turnstile" {{ ($settings['captcha_type'] ?? '') == 'cloudflare_turnstile' ? 'selected' : '' }}>{{ __('admin/settings.options_cloudflare_turnstile') }}</option>
                            <option value="hcaptcha" {{ ($settings['captcha_type'] ?? '') == 'hcaptcha' ? 'selected' : '' }}>{{ __('admin/settings.options_hcaptcha') }}</option>
                        </select>
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_captcha_type_description") }}'></i>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="captcha_for_select_forms" class="form-label">{{ __('admin/settings.fields_captcha_for_select_forms') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="captcha_shopping_cart" name="captcha_for_select_forms[]" value="shopping_cart_checkout" {{ in_array('shopping_cart_checkout', $settings['captcha_for_select_forms'] ?? []) ? 'checked' : '' }}>
                                    <label class="form-check-label" for="captcha_shopping_cart">{{ __('admin/settings.options_shopping_cart_checkout') }}</label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="captcha_domain_checker" name="captcha_for_select_forms[]" value="domain_checker" {{ in_array('domain_checker', $settings['captcha_for_select_forms'] ?? []) ? 'checked' : '' }}>
                                    <label class="form-check-label" for="captcha_domain_checker">{{ __('admin/settings.options_domain_checker') }}</label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="captcha_client_registration" name="captcha_for_select_forms[]" value="client_registration" {{ in_array('client_registration', $settings['captcha_for_select_forms'] ?? []) ? 'checked' : '' }}>
                                    <label class="form-check-label" for="captcha_client_registration">{{ __('admin/settings.options_client_registration') }}</label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="captcha_contact_form" name="captcha_for_select_forms[]" value="contact_form" {{ in_array('contact_form', $settings['captcha_for_select_forms'] ?? []) ? 'checked' : '' }}>
                                    <label class="form-check-label" for="captcha_contact_form">{{ __('admin/settings.options_contact_form') }}</label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="captcha_ticket_submission" name="captcha_for_select_forms[]" value="ticket_submission" {{ in_array('ticket_submission', $settings['captcha_for_select_forms'] ?? []) ? 'checked' : '' }}>
                                    <label class="form-check-label" for="captcha_ticket_submission">{{ __('admin/settings.options_ticket_submission') }}</label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="captcha_login_forms" name="captcha_for_select_forms[]" value="login_forms" {{ in_array('login_forms', $settings['captcha_for_select_forms'] ?? []) ? 'checked' : '' }}>
                                    <label class="form-check-label" for="captcha_login_forms">{{ __('admin/settings.options_login_forms') }}</label>
                                </div>
                                {{-- PRC-755 — admin login captcha'sı client'tan bağımsız --}}
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="captcha_admin_login" name="captcha_for_select_forms[]" value="admin_login" {{ in_array('admin_login', $settings['captcha_for_select_forms'] ?? []) ? 'checked' : '' }}>
                                    <label class="form-check-label" for="captcha_admin_login">{{ __('admin/settings.options_admin_login') }}</label>
                                </div>
                            </div>
                        </div>
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_captcha_for_select_forms_description") }}'></i>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="captcha_site_key" class="form-label">{{ __('admin/settings.fields_captcha_site_key') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <input type="text" class="form-control w-50 d-inline-block" id="captcha_site_key" name="captcha_site_key" value="{{ old('captcha_site_key', $settings['captcha_site_key'] ?? '') }}">
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_captcha_site_key_description") }}'></i>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="captcha_secret_key" class="form-label">{{ __('admin/settings.fields_captcha_secret_key') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <input type="text" class="form-control w-50 d-inline-block" id="captcha_secret_key" name="captcha_secret_key" value="{{ old('captcha_secret_key', $settings['captcha_secret_key'] ?? '') }}">
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_captcha_secret_key_description") }}'></i>
                    </div>
                </div>
            </div>
            <div class="row mb-2" id="recaptcha_v3_threshold_row" style="{{ ($settings['captcha_type'] ?? '') == 'recaptcha_v3' ? '' : 'display:none;' }}">
                <div class="col-sm-4 text-end">
                    <label for="recaptcha_v3_threshold" class="form-label">{{ __('admin/settings.fields_recaptcha_v3_threshold') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <input type="number" class="form-control w-25 d-inline-block" id="recaptcha_v3_threshold" name="recaptcha_v3_threshold" min="0" max="1" step="0.1" value="{{ old('recaptcha_v3_threshold', $settings['recaptcha_v3_threshold'] ?? '0.5') }}">
                        <small class="form-text text-muted">{{ __('admin/settings.fields_recaptcha_v3_threshold_description') }}</small>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="auto_generated_password_format" class="form-label">{{ __('admin/settings.fields_auto_generated_password_format') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <select class="form-select w-50 d-inline-block" id="auto_generated_password_format" name="auto_generated_password_format">
                            <option value="default" {{ ($settings['auto_generated_password_format'] ?? '') == 'default' ? 'selected' : '' }}>{{ __('admin/settings.options_password_format_default') }}</option>
                            <option value="letters_numbers_only" {{ ($settings['auto_generated_password_format'] ?? '') == 'letters_numbers_only' ? 'selected' : '' }}>{{ __('admin/settings.options_password_format_letters_numbers_only') }}</option>
                        </select>
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_auto_generated_password_format_description") }}'></i>
                    </div>
                </div>
            </div>

            {{-- PRC-135: Password history + rotation --}}
            <hr class="my-3">
            <h6 class="fw-bold text-muted mb-3"><i class="fas fa-key me-1"></i> {{ __('admin/settings.security_section_password_policy') }}</h6>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="password_history_depth" class="form-label">{{ __('admin/settings.fields_password_history_depth') }}</label>
                </div>
                <div class="col-sm-8">
                    <input type="number" min="0" max="50" class="form-control w-25 d-inline-block" id="password_history_depth" name="password_history_depth" value="{{ old('password_history_depth', $settings['password_history_depth'] ?? 5) }}">
                    <div class="form-text small">{{ __('admin/settings.fields_password_history_depth_description') }}</div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="password_rotation_days" class="form-label">{{ __('admin/settings.fields_password_rotation_days') }}</label>
                </div>
                <div class="col-sm-8">
                    <input type="number" min="0" max="3650" class="form-control w-25 d-inline-block" id="password_rotation_days" name="password_rotation_days" value="{{ old('password_rotation_days', $settings['password_rotation_days'] ?? 0) }}">
                    <div class="form-text small">{{ __('admin/settings.fields_password_rotation_days_description') }}</div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="password_history_apply_to" class="form-label">{{ __('admin/settings.fields_password_history_apply_to') }}</label>
                </div>
                <div class="col-sm-8">
                    <select class="form-select w-50 d-inline-block" id="password_history_apply_to" name="password_history_apply_to">
                        @foreach(['both','admins_only','clients_only'] as $opt)
                            <option value="{{ $opt }}" {{ old('password_history_apply_to', $settings['password_history_apply_to'] ?? 'both') === $opt ? 'selected' : '' }}>
                                {{ __('admin/settings.options_password_apply_'.$opt) }}
                            </option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="minimum_user_password_strength" class="form-label">{{ __('admin/settings.fields_minimum_user_password_strength') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <input type="number" class="form-control w-50 d-inline-block" id="minimum_user_password_strength" name="minimum_user_password_strength" min="0" max="100" value="{{ old('minimum_user_password_strength', $settings['minimum_user_password_strength'] ?? 0) }}">
                        <small class="form-text text-muted">{{ __('admin/settings.fields_minimum_user_password_strength_description') }}</small>
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_minimum_user_password_strength_tooltip") }}'></i>
                    </div>
                </div>
            </div>

            {{-- PRC-513 — Password char rules + length --}}
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="password_min_length" class="form-label">{{ __('admin/settings.fields_password_min_length') }}</label>
                </div>
                <div class="col-sm-8">
                    <input type="number" min="5" max="128" class="form-control w-25 d-inline-block" id="password_min_length" name="password_min_length" value="{{ old('password_min_length', $settings['password_min_length'] ?? 8) }}">
                    <div class="form-text small">{{ __('admin/settings.fields_password_min_length_description') }}</div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="password_require_mixedcase" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_password_require_mixedcase') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="password_require_mixedcase" name="password_require_mixedcase" value="1" {{ old('password_require_mixedcase', $settings['password_require_mixedcase'] ?? true) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_password_require_mixedcase_description') }}</span>
                    </div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="password_require_numbers" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_password_require_numbers') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="password_require_numbers" name="password_require_numbers" value="1" {{ old('password_require_numbers', $settings['password_require_numbers'] ?? true) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_password_require_numbers_description') }}</span>
                    </div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="password_require_symbols" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_password_require_symbols') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="password_require_symbols" name="password_require_symbols" value="1" {{ old('password_require_symbols', $settings['password_require_symbols'] ?? false) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_password_require_symbols_description') }}</span>
                    </div>
                </div>
            </div>

            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="failed_admin_login_ban_time" class="form-label">{{ __('admin/settings.fields_failed_admin_login_ban_time') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <input type="number" class="form-control w-50 d-inline-block" id="failed_admin_login_ban_time" name="failed_admin_login_ban_time" min="0" value="{{ old('failed_admin_login_ban_time', $settings['failed_admin_login_ban_time'] ?? 0) }}">
                        <small class="form-text text-muted">{{ __('admin/settings.fields_failed_admin_login_ban_time_description') }}</small>
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_failed_admin_login_ban_time_tooltip") }}'></i>
                    </div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="whitelisted_ip_login_failure_notices" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_whitelisted_ip_login_failure_notices') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="whitelisted_ip_login_failure_notices" name="whitelisted_ip_login_failure_notices" value="1" {{ old('whitelisted_ip_login_failure_notices', $settings['whitelisted_ip_login_failure_notices'] ?? false) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_whitelisted_ip_login_failure_notices_description') }}</span>
                    </div>
                </div>
            </div>
            {{-- PRC-771 — yeni konumdan giriş güvenlik bildirimi master anahtarı --}}
            <div class="row mb-2 align-items-center">
                <label for="login_new_location_notification_enabled" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_login_new_location_notification_enabled') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="login_new_location_notification_enabled" name="login_new_location_notification_enabled" value="1" {{ old('login_new_location_notification_enabled', $settings['login_new_location_notification_enabled'] ?? true) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_login_new_location_notification_enabled_description') }}</span>
                    </div>
                </div>
            </div>
            {{-- PRC-770 — çok-kanallı 2FA: hangi teslim kanalları etkin --}}
            <h6 class="fw-bold text-muted mb-3 mt-4"><i class="fas fa-shield-halved me-1"></i> {{ __('admin/settings.security_section_two_factor') }}</h6>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label class="form-label">{{ __('admin/settings.fields_two_factor_client_allowed_channels') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        @foreach(['totp', 'email', 'sms'] as $tfChannel)
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="checkbox" id="two_factor_client_{{ $tfChannel }}" name="two_factor_client_allowed_channels[]" value="{{ $tfChannel }}" {{ in_array($tfChannel, $settings['two_factor_client_allowed_channels'] ?? ['totp', 'email', 'sms']) ? 'checked' : '' }}>
                                <label class="form-check-label" for="two_factor_client_{{ $tfChannel }}">{{ __('admin/settings.options_two_factor_channel_' . $tfChannel) }}</label>
                            </div>
                        @endforeach
                        <div class="form-text mb-0">{{ __('admin/settings.fields_two_factor_client_allowed_channels_description') }}</div>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label class="form-label">{{ __('admin/settings.fields_two_factor_admin_allowed_channels') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        @foreach(['totp', 'email', 'sms'] as $tfChannel)
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="checkbox" id="two_factor_admin_{{ $tfChannel }}" name="two_factor_admin_allowed_channels[]" value="{{ $tfChannel }}" {{ in_array($tfChannel, $settings['two_factor_admin_allowed_channels'] ?? ['totp', 'email', 'sms']) ? 'checked' : '' }}>
                                <label class="form-check-label" for="two_factor_admin_{{ $tfChannel }}">{{ __('admin/settings.options_two_factor_channel_' . $tfChannel) }}</label>
                            </div>
                        @endforeach
                        <div class="form-text mb-0">{{ __('admin/settings.fields_two_factor_admin_allowed_channels_description') }}</div>
                    </div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="delete_encrypted_credit_card_data" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_delete_encrypted_credit_card_data') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="delete_encrypted_credit_card_data" name="delete_encrypted_credit_card_data" value="1" {{ old('delete_encrypted_credit_card_data', $settings['delete_encrypted_credit_card_data'] ?? false) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_delete_encrypted_credit_card_data_description') }}</span>
                    </div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="delete_encrypted_bank_account_data" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_delete_encrypted_bank_account_data') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="delete_encrypted_bank_account_data" name="delete_encrypted_bank_account_data" value="1" {{ old('delete_encrypted_bank_account_data', $settings['delete_encrypted_bank_account_data'] ?? false) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_delete_encrypted_bank_account_data_description') }}</span>
                    </div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="allow_client_pay_method_removal" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_allow_client_pay_method_removal') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="allow_client_pay_method_removal" name="allow_client_pay_method_removal" value="1" {{ old('allow_client_pay_method_removal', $settings['allow_client_pay_method_removal'] ?? false) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_allow_client_pay_method_removal_description') }}</span>
                    </div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="disable_session_ip_check" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_disable_session_ip_check') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="disable_session_ip_check" name="disable_session_ip_check" value="1" {{ old('disable_session_ip_check', $settings['disable_session_ip_check'] ?? false) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_disable_session_ip_check_description') }}</span>
                    </div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="allow_smarty_php_tags" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_allow_smarty_php_tags') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="allow_smarty_php_tags" name="allow_smarty_php_tags" value="1" {{ old('allow_smarty_php_tags', $settings['allow_smarty_php_tags'] ?? false) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_allow_smarty_php_tags_description') }}</span>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="proxy_ip_header" class="form-label">{{ __('admin/settings.fields_proxy_ip_header') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        {{-- PRC-193 — restricted to known provider headers. --}}
                        <select class="form-select w-50 d-inline-block" id="proxy_ip_header" name="proxy_ip_header">
                            @php $current = old('proxy_ip_header', $settings['proxy_ip_header'] ?? ''); @endphp
                            <option value="" @selected($current === '')>{{ __('admin/settings.proxy_ip_header_none') }}</option>
                            <option value="cf-connecting-ip" @selected($current === 'cf-connecting-ip')>CF-Connecting-IP (Cloudflare)</option>
                            <option value="true-client-ip" @selected($current === 'true-client-ip')>True-Client-IP (Akamai / CF Enterprise)</option>
                            <option value="x-real-ip" @selected($current === 'x-real-ip')>X-Real-IP (nginx)</option>
                            <option value="x-forwarded-for" @selected($current === 'x-forwarded-for')>X-Forwarded-For</option>
                            <option value="forwarded" @selected($current === 'forwarded')>Forwarded (RFC 7239)</option>
                        </select>
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.proxy_ip_header_tip") }}'></i>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="trusted_proxies" class="form-label">{{ __('admin/settings.fields_trusted_proxies') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <input type="text" class="form-control w-50 d-inline-block" id="trusted_proxies" name="trusted_proxies" value="{{ old('trusted_proxies', $settings['trusted_proxies'] ?? '') }}" placeholder="10.0.0.0/8, 172.16.0.0/12">
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.trusted_proxies_tip") }}'></i>
                        {{-- PRC-189 — explicit warning: '*' no longer accepted. --}}
                        <div class="form-text small text-warning">{{ __('admin/settings.trusted_proxies_warning') }}</div>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="api_ip_access_restriction" class="form-label">{{ __('admin/settings.fields_api_ip_access_restriction') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <input type="text" class="form-control w-50 d-inline-block" id="api_ip_access_restriction" name="api_ip_access_restriction" value="{{ old('api_ip_access_restriction', $settings['api_ip_access_restriction'] ?? '') }}">
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_field_description") }}'></i>
                    </div>
                </div>
            </div>
            <div class="row mb-2 align-items-center">
                <label for="log_api_authentication" class="col-sm-4 text-end col-form-label">{{ __('admin/settings.fields_log_api_authentication') }}</label>
                <div class="col-sm-8">
                    <div class="form-check form-switch d-flex align-items-center gap-2">
                        <input class="form-check-input" type="checkbox" id="log_api_authentication" name="log_api_authentication" value="1" {{ old('log_api_authentication', $settings['log_api_authentication'] ?? false) ? 'checked' : '' }}>
                        <span class="form-text mb-0">{{ __('admin/settings.fields_log_api_authentication_description') }}</span>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="whitelisted_ips" class="form-label">{{ __('admin/settings.fields_whitelisted_ips') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <textarea class="form-control w-75" id="whitelisted_ips" name="whitelisted_ips" rows="4" placeholder="{{ __('admin/settings.fields_whitelisted_ips_placeholder') }}">{{ old('whitelisted_ips', $settings['whitelisted_ips'] ?? '') }}</textarea>
                        <small class="form-text text-muted">{{ __('admin/settings.fields_whitelisted_ips_description') }}</small>
                        <i class='fa fa-info-circle ms-2' data-bs-toggle='tooltip' title='{{ __("admin/settings.fields_whitelisted_ips_tooltip") }}'></i>
                    </div>
                </div>
            </div>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="admin_ip_whitelist" class="form-label">{{ __('admin/settings.fields_admin_ip_whitelist') }}</label>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <textarea class="form-control w-75" id="admin_ip_whitelist" name="admin_ip_whitelist" rows="4" placeholder="{{ __('admin/settings.fields_admin_ip_whitelist_placeholder') }}">{{ old('admin_ip_whitelist', $settings['admin_ip_whitelist'] ?? '') }}</textarea>
                        <small class="form-text text-muted">{{ __('admin/settings.fields_admin_ip_whitelist_description') }}</small>
                    </div>
                </div>
            </div>

            {{-- PRC-805 — müşteri etkinlik günlüğü saklama politikası (LGPD/KVKK) --}}
            <hr class="my-3">
            <h6 class="fw-bold text-muted mb-3"><i class="fas fa-user-clock me-1"></i> {{ __('admin/settings.security_section_client_activity_log') }}</h6>
            <div class="row mb-2">
                <div class="col-sm-4 text-end">
                    <label for="client_activity_log_retention_days" class="form-label">{{ __('admin/settings.fields_client_activity_log_retention_days') }}</label>
                </div>
                <div class="col-sm-8">
                    <input type="number" min="0" max="3650" class="form-control w-25 d-inline-block" id="client_activity_log_retention_days" name="client_activity_log_retention_days" value="{{ old('client_activity_log_retention_days', $settings['client_activity_log_retention_days'] ?? 0) }}">
                    <div class="form-text small">{{ __('admin/settings.fields_client_activity_log_retention_days_description') }}</div>
                </div>
            </div>
        </div>
    </div>
</div>
