   LoginFormRenderer
   (render-login-form [_ request {:keys [requested-uri action login-status fields]}]
     (html
-     [:body
-      [:form {:method "POST" :style "border: 1px dotted #555"
+     [:div
+      [:form {:method "POST"
+              :style "border: 1px dotted #555; padding: 10pt"
               :action action}
+
+       [:h2 "Please sign in"]
+
+       (when login-status
+         [:div
+          [:p
+           (case login-status
+             :failed [:span [:strong "Failed: "] "Please check login credentials and try again or " [:a.alert-link {:href "#"} "reset your password"] "."])]])
+
+       (for [{:keys [id label name type value placeholder required autofocus]} fields]
+         [:div
+          [:label {:for id} label]
+          [:input (merge
+                   {:name name :type type :value value}
+                   (when placeholder {:placeholder placeholder})
+                   (when required {:required required})
+                   (when autofocus {:autofocus autofocus}))]])
+
        (when (not-empty requested-uri)
          [:input {:type "hidden" :name :requested-uri :value requested-uri}])
 
-       (for [{:keys [id label name type]} fields]
-         [:div
-          [:label {:for id} label]
-          [:input {:id id :name name :type type}]])
+       [:input {:type "submit" :value "Sign in"}]
 
-       [:input {:type "submit" :value "Login"}]
+       [:p
+        [:a {:href "#"} "Reset password"]]
        ]])))
 
 (defn new-plain-login-form-renderer []

  (fn [{:keys [cookies]}]
    (end-session!
     session-store
     (:value (get cookies "session")))
    {:status 302 :headers {"Location" "/"}}))

(defrecord LoginForm [uri-context renderer middleware fields uid]
  WebService
  (ring-handler-map [this]
    {:login
     (let [f (fn [{{{requested-uri :value} "requested-uri"
                    {login-status :value} "login-status"

         wrap-cookies)})

  (routes [this]
    ["" {"/login" {:get :login, :post :process-login}
         "/logout" {:get :logout}}])

  (uri-context [this] uri-context))
