<x-app-layout title="Security settings">
    <div class="mx-auto max-w-xl">
        <h1 class="text-xl font-semibold text-slate-900">Meeting security</h1>
        <p class="mt-1 text-sm text-slate-600">Organization-wide defaults for {{ $organization->name }}</p>

        <form method="POST" action="{{ route('meet.settings.security.update') }}" class="mt-6 space-y-4 rounded-2xl border border-slate-200 bg-white p-6">
            @csrf @method('PUT')
            <label class="flex items-center gap-2 text-sm"><input type="checkbox" name="org_only" value="1" @checked($policy['org_only'] ?? false) class="rounded border-slate-300"> Ladill accounts only</label>
            <label class="flex items-center gap-2 text-sm"><input type="checkbox" name="authenticated_only" value="1" @checked($policy['authenticated_only'] ?? false) class="rounded border-slate-300"> Authenticated users only</label>
            <label class="flex items-center gap-2 text-sm"><input type="checkbox" name="recording_host_only" value="1" @checked($policy['recording_host_only'] ?? true) class="rounded border-slate-300"> Host-only recording</label>
            <label class="flex items-center gap-2 text-sm"><input type="checkbox" name="watermark_enabled" value="1" @checked($policy['watermark_enabled'] ?? false) class="rounded border-slate-300"> Show watermark in meetings</label>
            <div>
                <label class="block text-sm font-medium text-slate-700">Allowed email domains (comma-separated)</label>
                <input type="text" name="allowed_domains" value="{{ implode(', ', $policy['allowed_domains'] ?? []) }}" class="mt-1 w-full rounded-lg border-slate-300 text-sm" placeholder="example.com, company.org">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Session idle timeout (minutes)</label>
                <input type="number" name="session_idle_minutes" value="{{ $policy['session_idle_minutes'] ?? 120 }}" min="15" max="480" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
            </div>
            <button type="submit" class="btn-primary w-full">Save policy</button>
        </form>
    </div>
</x-app-layout>
