{% extends "_types/root/index.html" %}
{% block content %}
    <div class="w-full max-w-md">
      <div class="bg-white/70 dark:bg-neutral-900/70 backdrop-blur rounded-2xl shadow p-6 sm:p-8 border border-neutral-200 dark:border-neutral-800">
        <h1 class="text-2xl font-semibold tracking-tight">Sign in</h1>
        <p class="mt-2 text-sm text-neutral-600 dark:text-neutral-400">
          Enter your email and we’ll email you a one-time sign-in link.
        </p>

        {% if error %}
          <div class="mt-4 rounded-lg border border-red-200 bg-red-50 text-red-800 dark:border-red-900/40 dark:bg-red-950/40 dark:text-red-200 px-4 py-3 text-sm">
            {{ error }}
          </div>
        {% endif %}

        <form
          method="post" action="{{ coop_url('/auth/start/') }}"
          class="mt-6 space-y-5"
        >
          <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
          <div>
            <label for="email" class="block text-sm font-medium text-neutral-700 dark:text-neutral-300">
              Email
            </label>
            <input
              type="email"
              id="email"
              name="email"
              value="{{ email or '' }}"
              required
              class="mt-2 block w-full rounded-lg border border-neutral-300 dark:border-neutral-700 bg-white dark:bg-neutral-900 px-3 py-2 text-neutral-900 dark:text-neutral-100 shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-neutral-900 dark:focus:ring-neutral-200"
              autocomplete="email"
              inputmode="email"
            >
          </div>

          <button
            type="submit"
            class="inline-flex w-full items-center justify-center rounded-lg bg-neutral-900 px-4 py-2.5 text-sm font-medium text-white hover:bg-neutral-800 focus:outline-none focus:ring-2 focus:ring-neutral-900 disabled:opacity-50 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-white"
          >
            Send link
          </button>
        </form>
      </div>
    </div>
{% endblock %}
