/*
 * Sign-in page polish (Automate-7zkz).
 *
 * Centered card layout, refined width and rhythm. Targets the auth pages
 * served from public/api/index.html — sign-in, MFA, phone/TOTP enroll,
 * verification code, etc. — all of which use #*-flex-container .container
 * as their root.
 */

/* The page-container fills the viewport. On desktop the marketing panel
   sits on the left and the form column on the right; on mobile they
   stack with the marketing panel above. */
body {
  background: var(--cm-bg-body);
  margin: 0;
}

.page-container.login-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: stretch;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  gap: 0;
}

/* No catch-all .page-container override here — only the login page
   loads this stylesheet and the only .page-container element on it
   is .login-shell (handled above). A bare `.page-container { ... }`
   rule here was leaking into the cascade and overriding
   stylesheetv3.css's `align-items: safe center` on every page that
   happened to share a Chrome render context with the login page. */

/* ===== Marketing / brand panel (left column on desktop) ================== */
.login-marketing {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--cm-space-10) var(--cm-space-8);
  /* Brand gradient — interactive teal up top fading into navy at bottom.
     Matches the rest of the app's accent palette but at a saturation
     that holds white text comfortably. */
  background:
    radial-gradient(ellipse at top left, rgba(45, 212, 191, 0.18), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(20, 184, 166, 0.12), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f2a2d 100%);
  color: var(--cm-text-on-dark);
  position: relative;
  overflow: hidden;
}

/* Subtle decorative grid texture so the gradient doesn't read as flat. */
.login-marketing::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
  pointer-events: none;
}

.login-marketing-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  /* More breathing room between brand mark, pitch, and trust band so the
     header doesn't read as cramped. */
  gap: var(--cm-space-10);
}

.login-brand {
  display: inline-block;
  text-decoration: none;
}

.login-brand-logo {
  display: block;
  max-width: 200px;
  height: auto;
  /* Slight glow under the wordmark on the gradient. */
  filter: drop-shadow(0 0 24px rgba(45, 212, 191, 0.18));
}

.login-headline {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: var(--cm-fw-bold);
  /* Looser line-height so two-line headlines breathe; the previous
     1.05 made "Release of Information, with patients first." read
     as a stacked block instead of a paced phrase. */
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 var(--cm-space-5);
}

.login-subhead {
  font-size: var(--cm-text-base);
  line-height: var(--cm-lh-normal);
  /* Pure white at slightly reduced weight rather than translucent
     white — translucency against the gradient was washing out to
     the same hue as the background. */
  color: #ffffff;
  font-weight: var(--cm-fw-regular);
  margin: 0 0 var(--cm-space-6);
  max-width: 460px;
}

.login-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--cm-space-4);
}

.login-features li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--cm-space-3);
  /* Center the icon with its text block — feels balanced for short
     bullets and stays visually aligned even if a bullet wraps to two
     lines (icon then sits at the vertical midpoint of the text
     instead of pinned to the first line). */
  align-items: center;
  font-size: var(--cm-text-sm);
  line-height: var(--cm-lh-normal);
  color: #ffffff;
}

/* The base stylesheet has a `* { color: var(--text-color) }` rule that
   was forcibly setting the bullet body span to the muted text-body
   color in dark mode, ignoring the parent li's #ffffff. Re-assert
   pure white on the descendant text-bearing elements explicitly. */
.login-features li span,
.login-features li strong {
  color: #ffffff;
}

.login-features li i {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.15);
  color: var(--cm-teal-300);
  font-size: 14px;
  flex-shrink: 0;
  /* Removed margin-top: 2px — was offsetting the icon when rows used
     align-items: start. With align-items: center on the row the icon
     centers naturally without the manual nudge. */
}

.login-features li strong {
  color: #ffffff;
  font-weight: var(--cm-fw-semibold);
}

/* ===== Form column (right column on desktop) ============================== */
.login-form-column {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--cm-space-8);
  background: var(--cm-bg-body);
  min-height: 100vh;
  box-sizing: border-box;
  overflow-y: auto;
}

/* Responsive collapse — stack vertically on narrower viewports. */
@media (max-width: 960px) {
  .page-container.login-shell {
    flex-direction: column;
  }
  .login-marketing {
    flex: 0 0 auto;
    padding: var(--cm-space-8) var(--cm-space-6);
  }
  .login-marketing-inner {
    max-width: 560px;
    text-align: center;
    align-items: center;
  }
  .login-headline {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
  }
  .login-features li {
    text-align: left;
    margin: 0 auto;
    max-width: 460px;
  }
  .login-form-column {
    min-height: auto;
    padding: var(--cm-space-6);
  }
}

@media (max-width: 600px) {
  .login-marketing {
    padding: var(--cm-space-6) var(--cm-space-5);
  }
  .login-form-column {
    padding: var(--cm-space-5) var(--cm-space-4);
  }
}

/* The card */
.container#sign-in-flex-container,
.container#mfa-flex-container,
.container#phone-flex-container,
.container#phone-verify-flex-container,
.container#totp-flex-container,
.container#totp-verify-flex-container,
.container#change-password-flex-container,
.container#reset-password-flex-container {
  width: 100%;
  max-width: 420px;
  background: var(--cm-bg-surface);
  border: 1px solid var(--cm-border);
  border-radius: var(--cm-radius-xl);
  box-shadow: var(--cm-shadow-md);
  padding: var(--cm-space-8);
  margin: 0 auto;
  box-sizing: border-box;
}

/* Heading row — center it (was jc-start), drop the bottom shadow underline */
.container[id$='-flex-container'] .row.bottom-shadow {
  box-shadow: none !important;
  justify-content: center !important;
  border-bottom: 1px solid var(--cm-border);
  margin-bottom: var(--cm-space-4);
  padding-bottom: var(--cm-space-3) !important;
  padding-top: 0 !important;
}

.container[id$='-flex-container'] h2 {
  font-size: var(--cm-text-2xl);
  font-weight: var(--cm-fw-semibold);
  color: var(--cm-text-heading);
  margin: 0;
  padding: 0 !important;
  text-align: center;
}

/* Form rows — tighter rhythm */
.container[id$='-flex-container'] form .row {
  margin-bottom: var(--cm-space-3);
  padding-bottom: 0 !important;
}

.container[id$='-flex-container'] form .row:last-child {
  margin-bottom: 0;
  margin-top: var(--cm-space-2);
  justify-content: center;
}

.container[id$='-flex-container'] form input {
  width: 100%;
  box-sizing: border-box;
}

.container[id$='-flex-container'] form button.button {
  min-width: 160px;
  width: 100%;
}

/* When a row holds multiple buttons (e.g. Verify / Back on the TOTP and
   Phone enrollment screens), share the row's width instead of each button
   claiming 100% (which would overflow the card horizontally). */
.container[id$='-flex-container'] form .row button.button:not(:only-child) {
  flex: 1 1 0;
  width: auto;
}

/* Footer links (Terms / Privacy / etc.) */
.container[id$='-flex-container'] .row.gap-large.mg-xlarge {
  margin: var(--cm-space-6) 0 0 !important;
  justify-content: center;
  gap: var(--cm-space-4) !important;
}

.container[id$='-flex-container'] .link {
  font-size: var(--cm-text-xs);
  color: var(--cm-text-muted);
  text-decoration: none;
}

.container[id$='-flex-container'] .link:hover {
  color: var(--cm-interactive);
}

/* MFA / verification panels: paragraph copy and instructional text */
.container[id$='-flex-container'] p {
  font-size: var(--cm-text-sm);
  color: var(--cm-text-body);
  line-height: var(--cm-lh-normal);
  margin: 0 0 var(--cm-space-3);
  text-align: center;
}

.container[id$='-flex-container'] p b {
  color: var(--cm-text-heading);
  font-weight: var(--cm-fw-semibold);
}

/* Legacy floating .logo-div is hidden — the new layout puts the logo
   inside the marketing panel via .login-brand. */
.logo-div {
  display: none !important;
}

/* ===== HITRUST trust band — dark gradient context overrides ===============
   Base styles for .trust-band live in stylesheetv3.css (token-based, work
   on light backgrounds). Inside .login-marketing the brand gradient
   demands a translucent border and pure white text for legibility.
   ========================================================================== */
.login-marketing .trust-band {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.login-marketing .trust-band .trust-statement,
.login-marketing .trust-band .trust-statement strong {
  /* Pure white — translucency was reading as low-contrast on the gradient. */
  color: #ffffff;
}
