<% provide(:title, "Log in") %>

<div class ="container mx-auto px-4">
  <h1 class="text-3xl font-bold text-center my-8">Log in</h1>

  <div class="max-w-md mx-auto">
    <%= form_with(url: login_path, scope: :session, local: true, class: "space-y-4") do |f| %>
      <div class="form-control">
        <%= f.label :email, class: "label" do %>
          <span class="label-text">Email</span>
        <% end %>
        <%= f.email_field :email, class: "input input-bordered w-full" %>
      </div>

      <div class="form-control">
        <div class="flex justify-between items-center">
          <%= f.label :password, class: "label" do %>
            <span class="label-text">Password</span>
          <% end %>
          <%= link_to "(forgot password)", new_password_reset_path,
                      class: "text-sm text-primary hover:text-primary-focus" %>
        </div>
        <%= f.password_field :password, class: "input input-bordered w-full" %>
      </div>

      <div class="form-control">
        <label class="label cursor-pointer">
          <%= f.check_box :remember_me, class: "checkbox checkbox-primary" %>
          <span class="label-text ml-2">Remember me on this computer</span>
        </label>
      </div>

      <div class="form-control mt-6">
        <%= f.submit "Log in", class: "btn btn-primary w-full" %>
      </div>
    <% end %>

    <div class="text-center mt-6">
      <p>New user?
        <%= link_to "Sign up now!", signup_path,
                    class: "text-primary hover:text-primary-focus" %>
      </p>
    </div>
  </div>
</div>
