/* ==========================================================================
   E-Report - login page layout
   --------------------------------------------------------------------------
   Loaded only by login.xhtml (after ereport.css). The design tokens - colour,
   spacing, radius, elevation, type stack - all come from the .er block in
   ereport.css, so this page cannot drift from the rest of the application.

   Everything here is scoped under .er-login, and the only global rules are the
   ones a full-page centred layout genuinely needs: no default body margin, and
   a full-height document. There is no application navigation to style: login
   runs before a session exists.
   ========================================================================== */

html,
body { height: 100%; }

body { margin: 0; }

/* --------------------------------------------------------------------------
   Page shell. A calm, low-contrast tint of the brand rather than the legacy
   green consumer gradient - this is an internal hospital application.
   -------------------------------------------------------------------------- */
.er.er-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 100vh;
  padding: var(--er-s5) var(--er-s4);
  background:
    radial-gradient(1100px 520px at 50% -12%, #e4edf7 0%, rgba(228, 237, 247, 0) 72%),
    var(--er-surface);
}

/* The JSF <form> is the flex item of .er-login, not .er-login__main, so it has
   to be the element that fills the page width. Without this the form
   shrink-wraps to its content (276px on a 390px screen) and the card comes out
   far narrower than the space available. */
.er-login form { width: 100%; }

.er-login__main {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.er-login__card {
  background: var(--er-surface-raised);
  border: 1px solid var(--er-border);
  border-radius: var(--er-r-md);
  box-shadow: var(--er-e2);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Brand block: logo, product name, hospital name, one line of context.
   -------------------------------------------------------------------------- */
.er-login__brand {
  padding: var(--er-s6) var(--er-s5) var(--er-s5);
  text-align: center;
  background: var(--er-surface-alt);
  border-bottom: 1px solid var(--er-border);
}

.er-login__logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--er-s3);
}

.er-login__app {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--er-primary);
}

.er-login__title {
  margin: var(--er-s1) 0 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--er-text-primary);
}

.er-login__lede {
  margin: var(--er-s2) auto 0;
  max-width: 32ch;
  font-size: 14px;
  line-height: 1.5;
  color: var(--er-text-secondary);
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.er-login__body { padding: var(--er-s5); }

.er-login__field { margin-bottom: var(--er-s4); }

.er-login__foot {
  padding: var(--er-s3) var(--er-s5) var(--er-s4);
  border-top: 1px solid var(--er-border);
  text-align: center;
}

.er-login__tagline {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  color: var(--er-text-secondary);
}

/* The primary action. p:commandButton carries its own .ui-button skin and the
   PrimeFaces theme sheet is injected after this one, so the variant has to be
   restated with enough specificity to win. Scoped to .er-login on purpose. */
.er-login .er-btn.ui-button {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--er-s4);
  border-radius: var(--er-r-sm);
  background-image: none;
  box-shadow: none;
  text-shadow: none;
  font-family: var(--er-font);
  font-size: 15px;
  font-weight: 600;
}

.er-login .er-btn--primary.ui-button {
  background: var(--er-primary);
  border: 1px solid var(--er-primary);
  color: #ffffff;
}

.er-login .er-btn--primary.ui-button:hover {
  background: var(--er-primary-hover);
  border-color: var(--er-primary-hover);
}

.er-login .er-btn.ui-button .ui-icon,
.er-login .er-btn.ui-button .ui-button-icon-left {
  color: inherit;
}

/* --------------------------------------------------------------------------
   Feedback. The growl is this page's only error channel (Login.login() adds a
   global FacesMessage), so it is pinned to the top of the viewport, centred,
   and never wider than the card - visible at every width instead of tucked
   into a corner.
   -------------------------------------------------------------------------- */
.er-login .ui-growl {
  position: fixed;
  top: var(--er-s4);
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  margin: 0;
  z-index: 9999;
}

.er-login .ui-growl-item-container {
  box-shadow: var(--er-e3);
}

/* --------------------------------------------------------------------------
   Small phones: drop the page padding so the card uses the full width, and
   give the brand block a little less vertical room.
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
  .er.er-login { padding: var(--er-s4) var(--er-s3); }
  .er-login__brand { padding: var(--er-s5) var(--er-s4) var(--er-s4); }
  .er-login__body { padding: var(--er-s4); }
  .er-login__logo { width: 60px; height: 60px; }
  .er-login__title { font-size: 18px; }
}
