<h1>Sign up</h1>
<%= form_with(url: sign_up_path) do |form| %>
  <% if @user.errors.any? %>
    <div style="color: red">
      <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
      <ul>
        <% @user.errors.each do |error| %>
          <li><%= error.full_message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
  <div>
    <%= form.label :firstname, style: "display: block" %>
    <%= form.text_field :firstname, value: @user.firstname, required: true, autofocus: true %>
  </div>
  <div>
    <%= form.label :lastname, style: "display: block" %>
    <%= form.text_field :lastname, value: @user.lastname, required: true %>
  </div>
  <div>
    <%= form.label :email, style: "display: block" %>
    <%= form.email_field :email, value: @user.email, required: true, autocomplete: "email" %>
  </div>
  <div>
    <%= form.label :password, style: "display: block" %>
    <%= form.password_field :password, required: true, autocomplete: "new-password" %>
    <div>12 characters minimum.</div>
  </div>
  <div>
    <%= form.label :password_confirmation, style: "display: block" %>
    <%= form.password_field :password_confirmation, required: true, autocomplete: "new-password" %>
  </div>
  <div>
    <%= form.submit "Sign up" %>
  </div>
<% end %>
