* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* html keeps the definite height so body's min-height: 100% below can resolve. */
html {
  height: 100%;
}

body {
  background: linear-gradient(90deg, #05226b 0%, #0834a3 50%, #05226b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  /* SCRUM-1850 (QA, Galaxy S 320x568 / landscape 568x320): a fixed-height body with
     overflow: hidden centred a card taller than the viewport and cropped it at BOTH ends,
     so the brand at the top and the Sign In button at the bottom were unreachable. Let the
     body grow with the card and scroll vertically; only sideways overflow stays hidden. */
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Background fingerprint artwork. Kept position: absolute on purpose (SCRUM-1850 review): the body
   now grows with the card, so inset: 0 already spans the whole document and the artwork simply
   scrolls with the page. A position: fixed layer here changes how the card's text is anti-aliased
   on desktop (subpixel becomes grayscale), so the card no longer renders identically to before. */
.bg-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-fingerprint {
  pointer-events: none;
  background-image: url(../images/fingerprint.png);
  background-repeat: no-repeat;
  background-size: contain;
  position: absolute;
}

.hero-fingerprint-left {
  opacity: 0.55;
  background-position: bottom;
  width: 550px;
  height: 650px;
  bottom: -160px;
  left: -120px;
}

.hero-fingerprint-right {
  opacity: 0.7;
  background-image: url(../images/fingerprint-right.png);
  background-position: top;
  width: 580px;
  top: 50px;
  bottom: 0;
  right: -80px;
}

.login-card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 20px;
  padding: 48px 44px 40px;
  width: 100%;
  max-width: 560px;
  /* SCRUM-1850: as a flex item the card's automatic minimum is its content width; never let
     a wide child (agency lockup) push the card itself past the viewport. */
  min-width: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* Brand logo */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

/* Heading */
.heading h1 {
  font-size: 28px;
  font-weight: 600;
  color: #1b2a4a;
  margin-bottom: 8px;
}

.subheading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #5a6b8c;
  font-size: 17px;
  margin-bottom: 36px;
}

.app-badge-logo {
  height: 28px;
  width: auto;
}

/* White-label: agency logo, powered by small Biometrics4ALL mark */
.agency-brand {
  display: inline-flex;
  align-items: center;
  /* SCRUM-1850 (QA, Galaxy S3 360x640 / iPhone SE 375x667, anything under 430 wide): this
     lockup did not wrap, so logo + "powered by" + mark (~377px) ran out of the card's right
     edge, the document became wider than the phone and mobile Chrome zoomed the whole page
     out ("squished"). Let it wrap onto a second row and never exceed the card's width. */
  flex-wrap: wrap;
  gap: 4px 8px;
  max-width: 100%;
}

.agency-logo {
  height: 45px;
  width: auto;
  /* SCRUM-1850: a logo wider than the card scales down inside its 45px row instead of
     forcing the lockup (and the page) wider than the phone. */
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

/* "powered by" + mark are one unit (the mark sits inside the span) so a wrap never strands
   the mark on its own row; the inner 8px gap matches the lockup's column gap. */
.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #6b7280;
  white-space: nowrap;
}

.powered-by-logo {
  width: 89px;
  height: 14px;
}

/* SCRUM-1850 (QA: "has context menu"): long-press / right-click on the brand marks opened the
   browser's image menu ("Save image", "Open image in new tab") while users pinched the
   squeezed page. None of them is a link, so take them out of hit-testing and turn off the
   touch callout and selection. */
.brand-logo,
.agency-logo,
.powered-by-logo,
.app-badge-logo {
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Error messages */
.login-error {
  background: #fdecea;
  border: 1px solid #f5c6c0;
  border-radius: 10px;
  color: #b3261e;
  font-size: 15px;
  padding: 12px 16px;
  margin-bottom: 22px;
}

/* Neutral info / confirmation messages (forgot-password confirmation, reset success) */
.login-info {
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  border-radius: 10px;
  color: #1b2a4a;
  font-size: 15px;
  line-height: 1.5;
  padding: 14px 16px;
  margin-bottom: 22px;
}

/* Form */
.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-size: 16px;
  color: #1b2a4a;
  margin-bottom: 10px;
}

.form-group input {
  width: 100%;
  padding: 15px 16px;
  font-size: 16px;
  color: #1b2a4a;
  border: 1px solid #d3d9e4;
  border-radius: 10px;
  outline: none;
  /* SCRUM-1850 (QA re-test 21 Sep, Galaxy S 320x568: "the email field is not displaying the
     whole email value"): the field has no length limit, so an address wider than its text area
     scrolled out of sight and a cut-off value looked complete. Browsers honour text-overflow on
     an input only while it is not focused, so a resting value that does not fit now ends in an
     ellipsis; on focus the field scrolls as it always did. A value that fits renders exactly
     as before at every width. */
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input::placeholder {
  color: #a5aec0;
}

/* SCRUM-1929: helper text under a field (the one-time reset code format). */
.field-hint {
  margin-top: 8px;
  font-size: 14px;
  color: #5b6b86;
}

/* SCRUM-1929: the reset code reads best monospaced and spaced out, like it appears in the email. */
.form-group input.code-input {
  font-family: Consolas, "Courier New", monospace;
  font-size: 20px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.form-group input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.forgot-link {
  display: inline-block;
  color: #1b2a4a;
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  margin-top: 4px;
}

.forgot-link:hover {
  color: #2563eb;
}

.btn-signin {
  display: block;
  width: 100%;
  margin-top: 32px;
  padding: 17px;
  background: #f68b1f;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-signin:hover {
  background: #e07c12;
}

.btn-signin:active {
  background: #cc6f0e;
}

/* An anchor styled as the primary button (reset success / invalid-link actions). */
.btn-signin-link {
  text-align: center;
  text-decoration: none;
  color: #ffffff;
}

.btn-signin-link:hover {
  color: #ffffff;
}

/* MFA: "remember this device" checkbox row */
.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #1b2a4a;
  cursor: pointer;
}

.remember-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

/* MFA: muted help text under the card actions */
.help-row {
  color: #5a6b8c;
  font-size: 14px;
}

.signup-row {
  text-align: center;
  margin-top: 26px;
  font-size: 15px;
  color: #1b2a4a;
}

.signup-row a {
  color: #1b2a4a;
  font-weight: 700;
  text-decoration: underline;
}

.signup-row a:hover {
  color: #2563eb;
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px 28px;
  }
}

/* SCRUM-1850 (QA re-test 21 Sep, Galaxy S 320x568): at 320 the email field's text area was only
   190px, about 27 characters of an address, because the card keeps 24px of side padding and each
   input 16px. On phones 360 wide and narrower give some of both back to the field (card 24 -> 20,
   input 16 -> 12: +16px of text, about two more characters). The 16px font stays as it is because
   anything smaller makes iPhone Safari zoom in when the field is focused. */
@media (max-width: 360px) {
  .login-card {
    padding-left: 20px;
    padding-right: 20px;
  }

  .form-group input {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* SCRUM-1933: check-email page — next steps, resend with cooldown, help. */
.help-list {
  margin: 0 0 18px 0;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.5;
  color: #1b2a4a;
}

.help-list li + li {
  margin-top: 4px;
}

.help-list strong {
  word-break: break-all;
}

.btn-secondary {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 15px;
  background: #ffffff;
  color: #1b2a4a;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid #d3d9e4;
  border-radius: 10px;
  cursor: pointer;
}

.btn-secondary:hover:not(:disabled) {
  border-color: #2563eb;
  color: #2563eb;
}

.btn-secondary:disabled {
  color: #7a869c;
  background: #f4f6fa;
  cursor: not-allowed;
}

.btn-secondary:focus-visible,
.login-info:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-divider {
  margin: 24px 0 0 0;
  border: 0;
  border-top: 1px solid #e4e7eb;
}
