/* HemoLinker V31 AUTH — deterministic two-column layout
   Desktop: LEFT 50% red / RIGHT 50% white.
   One page-level scrollbar only. No nested scrolling containers. */

/* Kill all legacy auth overflow/height behavior. */
html:has(body.auth-body),
html.auth-document {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100% !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #b42318 !important;
}

body.auth-body {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  background: #b42318 !important;
}

/* The grid itself owns the two visual halves. Its height grows with the
   tallest auth panel, so the red side always reaches the exact bottom. */
body.auth-body .auth-page {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  align-items: stretch !important;
  width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: #b42318 !important;
}

/* LEFT HALF — RED. It stretches with the grid row, including when the
   registration form is taller than the viewport. */
body.auth-body .auth-page > .auth-visual {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100% !important;
  height: auto !important;
  align-self: stretch !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative !important;
  background: #b42318 !important;
  background-image: none !important;
  color: #fff !important;
}

body.auth-body .auth-page > .auth-visual::before,
body.auth-body .auth-page > .auth-visual::after,
body.auth-body .auth-page > .auth-visual .auth-visual-inner::before,
body.auth-body .auth-page > .auth-visual .auth-visual-inner::after {
  content: none !important;
  display: none !important;
}

body.auth-body .auth-page > .auth-visual .auth-visual-inner {
  width: 100% !important;
  min-height: 100% !important;
  height: auto !important;
  box-sizing: border-box !important;
  background: #b42318 !important;
  background-image: none !important;
  color: #fff !important;
}

body.auth-body .auth-page > .auth-visual .auth-brand-name,
body.auth-body .auth-page > .auth-visual .auth-visual-content,
body.auth-body .auth-page > .auth-visual .auth-visual-content h2,
body.auth-body .auth-page > .auth-visual .auth-feature,
body.auth-body .auth-page > .auth-visual .auth-stat,
body.auth-body .auth-page > .auth-visual .auth-stat strong,
body.auth-body .auth-page > .auth-visual .auth-visual-tagline,
body.auth-body .auth-page > .auth-visual .auth-testimonial-text,
body.auth-body .auth-page > .auth-visual .auth-testimonial-author {
  color: #fff !important;
  opacity: 1 !important;
}

body.auth-body .auth-page > .auth-visual .auth-testimonial {
  background: rgba(255,255,255,.10) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.25) !important;
  box-shadow: none !important;
}

body.auth-body .auth-page > .auth-visual .auth-testimonial-author > div:last-child {
  color: rgba(255,255,255,.86) !important;
}

body.auth-body .auth-page > .auth-visual .auth-feature-icon {
  color: #20c997 !important;
}

/* RIGHT HALF — WHITE. It also stretches to the same grid-row bottom. */
body.auth-body .auth-page > .auth-panel-wrap {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100% !important;
  height: auto !important;
  max-height: none !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: clamp(30px, 4vw, 54px) clamp(28px, 4vw, 56px) 42px !important;
  overflow: visible !important;
  background: #fff !important;
  background-image: none !important;
  color: #101828 !important;
}

body.auth-body .auth-page > .auth-panel-wrap .auth-panel {
  width: 100% !important;
  max-width: 680px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  color: #101828 !important;
}

/* Never allow a child to become a second scrolling viewport. */
body.auth-body .auth-page,
body.auth-body .auth-page > .auth-visual,
body.auth-body .auth-page > .auth-visual .auth-visual-inner,
body.auth-body .auth-page > .auth-panel-wrap,
body.auth-body .auth-page > .auth-panel-wrap .auth-panel {
  overflow-x: visible !important;
  overflow-y: visible !important;
}

body.auth-body .auth-panel .auth-back,
body.auth-body .auth-panel .auth-title,
body.auth-body .auth-panel .auth-subtitle,
body.auth-body .auth-panel .form-label,
body.auth-body .auth-panel .auth-note,
body.auth-body .auth-panel .auth-switch,
body.auth-body .auth-panel .form-divider,
body.auth-body .auth-panel .form-link,
body.auth-body .auth-panel .login-forgot-wrap .form-link {
  color: #344054 !important;
}

body.auth-body .auth-panel .form-link,
body.auth-body .auth-panel .login-forgot-wrap .form-link {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

/* Auth pages do not expose theme controls. */
body.auth-body .theme-toggle,
body.auth-body .register-theme-toggle,
body.auth-body [data-theme-toggle] {
  display: none !important;
}

/* Compact rhythm without artificial empty space. */
body.auth-body .auth-panel .auth-back { margin-bottom: 12px !important; }
body.auth-body .auth-panel-header { margin-bottom: 14px !important; }
body.auth-body .auth-panel .auth-title { margin-bottom: 6px !important; }
body.auth-body .auth-panel .auth-subtitle { margin-bottom: 0 !important; }
body.auth-body .auth-panel .form-group { margin-bottom: 9px !important; }
body.auth-body .auth-panel .form-divider { margin: 10px 0 7px !important; }
body.auth-body .auth-panel .form-control,
body.auth-body .auth-panel select,
body.auth-body .auth-panel input,
body.auth-body .auth-panel textarea {
  min-height: 44px !important;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  box-sizing: border-box !important;
  background: #fff !important;
  color: #182230 !important;
  border-color: #d0d5dd !important;
}
body.auth-body .auth-panel .form-control::placeholder,
body.auth-body .auth-panel input::placeholder,
body.auth-body .auth-panel textarea::placeholder { color: #667085 !important; }
body.auth-body .auth-panel .form-input-icon-btn { color: #475467 !important; }
body.auth-body .auth-panel .btn-lg { min-height: 46px !important; padding: 9px 16px !important; }
body.auth-body .auth-panel .btn-primary {
  background: #b42318 !important;
  color: #fff !important;
  border-color: #b42318 !important;
}
body.auth-body .auth-panel .btn-primary:hover { background: #9f1f16 !important; }
body.auth-body .auth-panel .auth-note { margin: 8px 0 !important; color: #667085 !important; }
body.auth-body .auth-panel .auth-switch { margin-top: 8px !important; margin-bottom: 0 !important; }
body.auth-body .auth-panel .form-divider { color: #667085 !important; }
body.auth-body .auth-panel .form-divider::before,
body.auth-body .auth-panel .form-divider::after { background: #d0d5dd !important; }

/* Login: email → password → forgot password → sign in. */
#login-form {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  gap: 0 !important;
}
#login-form .form-group { width: 100% !important; min-width: 0 !important; }
#login-form .login-forgot-wrap {
  display: flex !important;
  justify-content: flex-end !important;
  margin-top: 7px !important;
  margin-bottom: 0 !important;
  line-height: 1.2 !important;
}
#login-form #login-btn { width: 100% !important; margin-top: 10px !important; }

/* Register password fields stay full width. */
#register-form { width: 100% !important; display: block !important; }
#register-form > .form-grid-2 {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
  column-gap: 14px !important;
  row-gap: 0 !important;
  margin: 0 !important;
}
#register-form .form-grid-2 > .form-group { min-width: 0 !important; }
#register-form .register-password-stack {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  gap: 8px !important;
}
#register-form .register-password-stack .form-group {
  width: 100% !important;
  min-width: 0 !important;
  margin-bottom: 0 !important;
}
#register-form .register-password-stack .form-control { width: 100% !important; }

/* MOBILE: one column, one browser/page scrollbar. The visual half is hidden;
   the form occupies the page naturally without an inner scroll container. */
@media (max-width: 820px) {
  html:has(body.auth-body),
  html.auth-document {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  body.auth-body {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    background: #fff !important;
  }
  body.auth-body .auth-page {
    display: block !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: auto !important;
    background: #fff !important;
  }
  body.auth-body .auth-page > .auth-visual { display: none !important; }
  body.auth-body .auth-page > .auth-panel-wrap {
    display: flex !important;
    width: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: auto !important;
    padding: 24px 18px 32px !important;
    background: #fff !important;
    color: #101828 !important;
    overflow: visible !important;
  }
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel,
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel .auth-back,
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel .auth-title,
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel .auth-subtitle,
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel .form-label,
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel .auth-note,
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel .auth-switch,
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel .form-divider,
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel .form-link,
  body.auth-body .auth-page > .auth-panel-wrap .auth-panel .login-forgot-wrap .form-link {
    color: #344054 !important;
  }
  #register-form > .form-grid-2 { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  body.auth-body .auth-page > .auth-panel-wrap { padding: 20px 14px 28px !important; }
  body.auth-body .auth-panel .auth-title { font-size: 1.65rem !important; }
  body.auth-body .auth-panel .auth-subtitle { font-size: .95rem !important; }
}
