<%= render HeaderCompactComponent.new(title: "Log in") %>

<%= render MainCompactComponent.new do %>
  <h2>Forgot your password?</h2>

  <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
    <%= render "devise/shared/error_messages", resource: resource %>
    <div class="mb-6">
      <%= f.label :cn, 'User', class: 'block mb-2 font-bold' %>
      <p class="flex gap-2 items-center">
        <%= f.text_field :cn, autofocus: true, autocomplete: "username",
                              required: true, class: "relative grow"%>
        <span class="relative shrink-0 text-gray-500">@ <%= Setting.primary_domain %></span>
      </p>
    </div>
    <p>
      <%= f.label :email, 'Email address', class: 'block mb-2 font-bold' %>
      <%= f.email_field :email, autocomplete: "email", required: true,
                                class: "w-full"%>
    </p>
    <p class="mt-8">
      <%= f.submit "Send me a reset link", class: 'btn-md btn-blue w-full' %>
    </p>
  <% end %>

  <%= render "devise/shared/links" %>
<% end %>
