/* BPAU CRM. The sign in page, the invitation page, and the two
   pages of a forgotten password.

   The pages somebody sees before they are signed in
   (server/templates/login.html, invite.html, forgot.html and reset.html, on
   _shell.html). They are built from the shared pieces in base.css: the
   field, the input, the button, the label with the red rule. This file is
   only what those pages need and nothing else does, in classes that start
   with "signin".

   Charcoal is for the rail and Home's band inside the app. Here it is the
   whole page, because this is the app's front door and the rail is what it
   opens onto: the logo stands on it as it does at the top left of the app,
   and the form is the one light thing on it. One red button.

   Their scripts (login.js, invite.js, forgot.js, reset.js) show a message
   by setting the class of #msg to "msg", "msg err" or "msg ok", so those
   three are styled here. */

.signin { background: var(--ink); }
.signin-page { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; min-height: 100vh; min-height: 100dvh; padding: calc(40px + var(--safe-t)) 16px calc(40px + var(--safe-b)); }

/* The logo, in the version drawn for charcoal, larger than in the app. Its
   files are 240 by 126 at 1x, 2x and 3x (tools/make_logo.py). */
.signin-brand { display: block; width: 240px; max-width: 70%; height: auto; }

.signin-card { width: 100%; max-width: 392px; padding: 28px 28px 28px; border-radius: var(--r); background: var(--page); color: var(--ink); }
.signin-card .title-lg { margin-top: 12px; }
.signin-sub { margin-top: 8px; color: var(--slate); }
.signin-card .field { margin-top: 16px; }
.signin-card .title-lg + .field, .signin-sub + .field { margin-top: 20px; }
/* Tall enough for a thumb, and 16 px so an iPhone does not zoom the page */
.signin-card .input { height: 44px; font-size: 16px; }
.signin-hint { display: block; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--grey); }
.signin-go { width: 100%; height: 44px; margin-top: 20px; font-size: 15px; }
a.signin-go { display: flex; align-items: center; justify-content: center; }
/* The quieter way on under the button: Forgot password?, Back to sign in */
.signin-alt { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; font-size: 13px; line-height: 20px; color: var(--slate); text-decoration: underline; text-underline-offset: 3px; }
.signin-alt:hover { color: var(--ink); }
.signin-alt[hidden] { display: none; }
.signin-card .msg + a.signin-go { margin-top: 16px; }

/* What the scripts say: nothing until there is something, then beside the
   fields it is about and above the button that would be pressed again */
.signin-card .msg { display: none; margin-top: 16px; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; line-height: 20px; }
.signin-card .msg.err { display: block; background: var(--red-tint); color: var(--red-ink); }
.signin-card .msg.ok { display: block; background: var(--wash); color: var(--ink); }
.signin-card .msg + .signin-go { margin-top: 16px; }
/* The server's words start with a small letter. A sentence does not. */
.signin-card .msg::first-letter { text-transform: uppercase; }

.signin-foot { display: flex; gap: 24px; font-size: 12px; line-height: 16px; color: var(--rail-text); }
.signin-foot a:hover { color: var(--page); }
.signin-foot a:focus-visible { outline-color: var(--page); }

@media (max-width: 820px) {
  .signin-page { justify-content: flex-start; gap: 28px; padding-top: 56px; }
  .signin-card { padding: 24px 20px; }
  .signin-foot { font-size: 13px; }
  .signin-foot a { display: inline-flex; align-items: center; min-height: 44px; }
}
