/**
 * RxVault public authentication screens — light, accessible patient design system.
 */
body.rx-auth {
  /* Design tokens — mirror patient portal light theme */
  --rx-primary: #178a52;
  --rx-primary-hover: #126f42;
  --rx-primary-soft: #e4f3ea;
  --rx-bg: #f4f6f3;
  --rx-surface: #ffffff;
  --rx-surface-soft: #eef2ee;
  --rx-heading: #1a2332;
  --rx-text: #2c3545;
  --rx-text-muted: #5c6678;
  --rx-border: #dde3dc;
  --rx-danger-soft: #fdecea;
  --rx-focus-ring: 0 0 0 3px rgba(23, 138, 82, 0.35);
  --rx-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rx-text-body: 1rem;
  --rx-text-small: 0.875rem;
  --rx-text-meta: 0.8125rem;
  --rx-text-label: 0.875rem;
  --rx-space-xs: 4px;
  --rx-space-sm: 8px;
  --rx-space-md: 16px;
  --rx-space-lg: 24px;
  --rx-radius-md: 10px;
  --rx-radius-lg: 16px;
  --rx-radius-pill: 999px;
  --rx-touch-min: 44px;
  --rx-shadow-md: 0 8px 24px rgba(15, 26, 20, 0.08);

  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--rx-font);
  font-size: var(--rx-text-body);
  line-height: 1.5;
  color: var(--rx-text);
  background: var(--rx-bg);
}

/* Override legacy styles.css dark auth chrome.
   styles.css still sets .auth-container { justify-content: center }
   and .auth-form { text-align: center }. Those rules are what made the
   labels look centered and left the login group sitting high. */
body.rx-auth .auth-container {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 20px 16px;
  background: var(--rx-bg) !important;
  overflow: visible;
  position: relative;
  left: auto;
  right: auto;
}

body.rx-auth .auth-card {
  background: var(--rx-surface) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid var(--rx-border) !important;
  border-radius: var(--rx-radius-lg) !important;
  box-shadow: var(--rx-shadow-md) !important;
  color: var(--rx-text);
  text-align: left;
}

body.rx-auth .auth-form h2 {
  color: var(--rx-heading) !important;
}

body.rx-auth .btn-primary {
  background: var(--rx-primary) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: var(--rx-radius-pill);
  font-weight: 600;
  min-height: var(--rx-touch-min);
}

body.rx-auth .btn-primary:hover {
  background: var(--rx-primary-hover) !important;
  transform: none !important;
  box-shadow: none !important;
}

body.rx-auth .btn::before {
  display: none;
}

.rx-auth #auth-container {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 20px 16px;
  box-sizing: border-box;
}

.rx-auth .rx-auth-panel {
  width: min(440px, 100%);
  max-width: 440px;
  min-width: 0;
  margin: 0 auto;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.rx-auth .rx-auth-brand {
  width: 100%;
  text-align: center;
  margin: 0 0 16px;
}

.rx-auth .rx-auth-brand img {
  width: 48px;
  height: 48px;
  margin-bottom: var(--rx-space-sm, 8px);
}

.rx-auth .rx-auth-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--rx-heading, #0f1a14);
  letter-spacing: -0.02em;
}

.rx-auth .rx-auth-tagline {
  margin: var(--rx-space-xs, 4px) 0 0;
  font-size: var(--rx-text-meta, 0.875rem);
  color: var(--rx-text-muted, #5c6b62);
  font-weight: 500;
}

.rx-auth .auth-card {
  width: 100%;
  max-width: 440px;
  min-width: 0;
  margin: 0;
  background: var(--rx-surface, #fff);
  border: 1px solid var(--rx-border, #d8e0d8);
  border-radius: var(--rx-radius-lg, 16px);
  box-shadow: var(--rx-shadow-md, 0 8px 24px rgba(15, 26, 20, 0.08));
  padding: 24px;
  box-sizing: border-box;
}

.rx-auth .auth-header {
  display: none;
  margin: 0;
}

.rx-auth .auth-form {
  text-align: left;
}

.rx-auth .auth-form h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--rx-heading, #0f1a14);
  text-align: center;
}

.rx-auth .form-group {
  margin-bottom: 14px;
  text-align: left;
}

.rx-auth .form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--rx-text-label, 0.875rem);
  font-weight: 600;
  color: var(--rx-text, #1a2332);
  text-align: left;
}

.rx-auth .form-group input {
  width: 100%;
  box-sizing: border-box;
  min-height: var(--rx-touch-min, 44px);
  padding: 10px 12px;
  border: 1px solid var(--rx-border, #c5cec4);
  border-radius: var(--rx-radius-md, 10px);
  background: #fff;
  color: var(--rx-text, #1a2332);
  font: inherit;
}

.rx-auth .form-group input:focus {
  outline: none;
  border-color: var(--rx-primary, #178a52);
  box-shadow: var(--rx-focus-ring, 0 0 0 3px rgba(23, 138, 82, 0.25));
}

.rx-auth .form-group input:focus-visible,
.rx-auth .auth-form .btn:focus-visible,
.rx-auth .auth-switch a:focus-visible,
.rx-auth .site-footer-links a:focus-visible {
  outline: 2px solid var(--rx-primary, #178a52);
  outline-offset: 2px;
}

.rx-auth .auth-form .btn {
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}

.rx-auth .auth-switch {
  margin: var(--rx-space-md, 16px) 0 0;
  font-size: var(--rx-text-small, 0.875rem);
  color: var(--rx-text-muted, #5c6b62);
  text-align: center;
}

.rx-auth .auth-switch a {
  color: var(--rx-primary, #178a52);
  font-weight: 600;
  text-decoration: none;
}

.rx-auth .auth-switch a:hover {
  text-decoration: underline;
}

.rx-auth .registration-disabled-message {
  color: var(--rx-text-muted, #5c6b62);
  margin: 0 0 var(--rx-space-md, 16px);
  line-height: 1.55;
}

.rx-auth .rx-auth-alert {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--rx-radius-md, 10px);
  font-size: var(--rx-text-small, 0.875rem);
  border: 1px solid transparent;
}

.rx-auth .rx-auth-alert-error {
  background: var(--rx-danger-soft, #fef2f2);
  border-color: rgba(185, 28, 28, 0.25);
  color: #991b1b;
}

.rx-auth .rx-auth-alert-info {
  background: var(--rx-primary-soft, #e8f5ee);
  border-color: rgba(23, 138, 82, 0.2);
  color: #145a32;
}

.rx-auth .security-statement,
.rx-auth .secure-connection {
  display: none;
}

.rx-auth #auth-container > .site-footer {
  width: min(440px, 100%);
  max-width: 440px;
  margin: 8px auto 0;
  padding: 12px 0 0;
  flex: 0 0 auto;
  border-top: 1px solid var(--rx-border, #d8e0d8);
  background: transparent;
}

.rx-auth .site-footer-inner {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  max-width: none;
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: var(--rx-text-meta, 0.8125rem);
  color: var(--rx-text-muted, #5c6b62);
}

.rx-auth .site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
}

.rx-auth .site-footer-links a {
  color: var(--rx-text-muted, #5c6b62);
  text-decoration: none;
}

.rx-auth .site-footer-links a:hover {
  color: var(--rx-primary, #178a52);
  text-decoration: underline;
}
