<%= form_for @conn, "/password/request-reset", [class: "max-w-md w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 py-6 mt-8"], fn f -> %>
  <h1 class="text-xl font-black dark:text-gray-100">Reset your password</h1>
  <div class="mt-4 dark:text-gray-100">Enter your email so we can send a password reset link</div>
  <div class="my-4 mt-8">
    <%= email_input f, :email, class: "transition bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500", placeholder: "user@example.com" %>
  </div>
  <%= if @conn.assigns[:error] do %>
    <div class="text-red-500 text-xs italic my-2"><%= @conn.assigns[:error] %></div>
  <% end %>

  <%= if PlausibleWeb.Captcha.enabled?() do %>
    <div class="mt-4">
      <div class="h-captcha" data-sitekey="<%= PlausibleWeb.Captcha.sitekey() %>"></div>
      <%= if assigns[:captcha_error] do %>
        <div class="text-red-500 text-xs italic mt-3"><%= @captcha_error %></div>
      <% end %>
      <script src="https://hcaptcha.com/1/api.js" async defer></script>
    </div>
  <% end %>

  <%= submit "Send reset link →", class: "button mt-4 w-full" %>
<% end %>
