{% extends "ui/templates/base/layout.html" %}
{% block content %}
  <h1 class="text-2xl font-semibold">Create Audit Firm</h1>

  <form class="mt-4 rounded-2xl bg-white border p-5 max-w-3xl" method="post">
    <input type="hidden" name="csrf_token" value="{{ csrf_token }}" />

    <div class="grid gap-5">
      <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
        <label class="grid gap-1">
          <span class="text-sm text-slate-600">Audit Firm Code</span>
          <input class="border rounded-xl px-3 py-2" name="code" required />
        </label>

        <label class="grid gap-1">
          <span class="text-sm text-slate-600">Audit Firm Name</span>
          <input class="border rounded-xl px-3 py-2" name="name" required />
        </label>

        <label class="grid gap-1 md:col-span-2">
          <span class="text-sm text-slate-600">Audit Firm Type</span>
          <select class="border rounded-xl px-3 py-2" name="firm_type" required>
            <option value="partnership" selected>Partnership Firm</option>
            <option value="proprietorship">Proprietorship Firm</option>
            <option value="individual">Individual Audit Practice</option>
          </select>
          <span class="text-xs text-slate-500">Review partner is applicable only for partnership firms and assurance engagements.</span>
        </label>
      </div>

      <div class="border-t pt-4">
        <div class="font-semibold">Audit Firm Default Policies</div>
        <div class="grid grid-cols-1 md:grid-cols-2 gap-3 mt-3">
          <label class="grid gap-1">
            <span class="text-sm text-slate-600">Default Timezone</span>
            <input class="border rounded-xl px-3 py-2" name="default_timezone" value="Asia/Kolkata" />
          </label>

          <label class="grid gap-1">
            <span class="text-sm text-slate-600">Default Session Duration (minutes)</span>
            <input class="border rounded-xl px-3 py-2" name="default_session_duration_minutes" value="480" />
          </label>

          <label class="grid gap-1 md:col-span-2">
            <span class="text-sm text-slate-600">Default OTP Required Roles (CSV)</span>
            <input class="border rounded-xl px-3 py-2" name="default_otp_required_roles_csv" value="System Admin" />
          </label>

          <label class="grid gap-1">
            <span class="text-sm text-slate-600">Default Storage Mode</span>
            <select class="border rounded-xl px-3 py-2" name="default_storage_mode">
              <option value="local_only" selected>local_only</option>
              <option value="cloud_only">cloud_only</option>
              <option value="hybrid">hybrid</option>
            </select>
          </label>
        </div>
      </div>

      <div class="flex gap-3">
        <button class="rounded-xl bg-slate-900 text-white px-4 py-2 text-sm" type="submit">Save</button>
        <a class="rounded-xl border px-4 py-2 text-sm" href="/system-settings/tenants">Cancel</a>
      </div>
    </div>
  </form>
{% endblock %}

