/* Auth screens — maroon brand aligned with Peer Review Portal mockup */

:root {
  --auth-maroon: #6b0f1f;
  --auth-maroon-dark: #5a0d1a;
  --auth-maroon-button: #7a1024;
}

body {
  font-family: var(--font-sans);
}

.auth-messages {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-messages__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  border: 1px solid transparent;
}

.auth-messages__text {
  flex: 1;
  margin: 0;
  line-height: 1.45;
}

.auth-messages__close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.125rem -0.25rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.auth-messages__close:hover,
.auth-messages__close:focus-visible {
  opacity: 1;
  background: rgba(17, 24, 39, 0.06);
  outline: none;
}

.auth-messages__item--success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.auth-messages__item--error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.auth-messages__item--info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.auth-messages__item--warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.auth-messages__item--debug {
  background: #f9fafb;
  color: #374151;
  border-color: #e5e7eb;
}

/* Outer shell: equal gutter on top, left, and bottom (see mockup) */
.auth-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: #fff;
}

@media (min-width: 1024px) {
  .auth-page {
    flex-direction: row;
  }
}

.auth-panel-shell {
  --auth-panel-gutter: 1.5rem;
  background: #fff;
  padding: var(--auth-panel-gutter);
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .auth-panel-shell {
    width: min(440px, 40%);
    flex-shrink: 0;
    min-height: 100vh;
    box-sizing: border-box;
    padding-top: var(--auth-panel-gutter);
    padding-left: var(--auth-panel-gutter);
    padding-bottom: var(--auth-panel-gutter);
    padding-right: 0;
  }
}

@media (min-width: 1280px) {
  .auth-panel-shell {
    --auth-panel-gutter: 1.75rem;
  }
}

.auth-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--auth-maroon);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem;
  color: #fff;
  min-height: 0;
}

@media (min-width: 1024px) {
  .auth-panel {
    min-height: calc(100vh - (2 * var(--auth-panel-gutter)));
    padding: 2.5rem 2rem;
    border-radius: 1.5rem;
  }
}

.auth-form-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
  padding: 3rem 1.5rem;
}

@media (min-width: 640px) {
  .auth-form-shell {
    padding: 3rem 2rem;
  }
}

@media (min-width: 1024px) {
  .auth-form-shell {
    padding: 3rem 2.5rem 3rem 2rem;
  }
}

@media (min-width: 1280px) {
  .auth-form-shell {
    padding: 3rem 4rem 3rem 2.5rem;
  }
}

.friend-health-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

.friend-health-logo--auth {
  max-height: 2.5rem;
}

/* Brand row above the login form (white panel) */
.auth-form-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.auth-form-logos__divider {
  width: 1px;
  height: 2rem;
  flex-shrink: 0;
  background: #d1d5db;
}

.auth-form-logos__partner {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--auth-maroon-button);
}

.auth-form-title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: center;
  color: #0f172a;
}

.auth-form-subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: center;
  color: #64748b;
}

.auth-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-base-content);
}

.auth-feature-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.auth-input {
  display: block;
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-maroon-button);
  box-shadow: 0 0 0 3px rgba(122, 16, 36, 0.15);
}

.auth-input--password {
  padding-right: 2.75rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 0;
}

.auth-password-toggle:hover {
  color: #4b5563;
}

.auth-btn-primary {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 9999px;
  background-color: var(--auth-maroon-button);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.auth-btn-primary:hover {
  background-color: var(--auth-maroon-dark);
}

.auth-btn-sso {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  margin-top: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  background-color: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.auth-btn-sso:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
  text-decoration: none;
}

.auth-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--auth-maroon-button);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: #9ca3af;
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.hidden {
  display: none !important;
}

/* Sidebar inner layout (login + verify) */
.auth-sidebar-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.auth-sidebar-lead {
  margin-top: 1.25rem;
  max-width: 22rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.auth-sidebar-features {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .auth-sidebar-features {
    margin-top: 0;
  }
}

.auth-sidebar-feature {
  display: flex;
  gap: 1rem;
}

.auth-sidebar-feature__title {
  font-size: 0.875rem;
  font-weight: 600;
}

.auth-sidebar-feature__text {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}

/* Two-factor verification (right panel) */
.auth-verify {
  width: 100%;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.auth-verify__header {
  text-align: center;
}

.auth-verify__icon-wrap {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: #fce8ec;
  color: var(--auth-maroon-button);
}

.auth-verify__title {
  margin-top: 1.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}

.auth-verify__subtitle {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #6b7280;
}

.auth-verify__form {
  margin-top: 2rem;
}

.auth-signing-in-box {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #f5c2cb;
  background: #fdf2f4;
  font-size: 0.875rem;
  color: #374151;
  text-align: center;
}

.auth-signing-in-box strong {
  font-weight: 600;
  color: var(--auth-maroon-button);
}

.auth-otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.625rem;
  margin: 1.5rem 0;
}

.auth-otp-digit {
  width: 100%;
  aspect-ratio: 1;
  max-height: 3.5rem;
  border-radius: 0.625rem;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  color: #111827;
}

.auth-otp-digit:focus {
  outline: none;
  border-color: var(--auth-maroon-button);
  box-shadow: 0 0 0 3px rgba(122, 16, 36, 0.15);
}

.auth-verify__help {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}

.auth-link--semibold {
  font-weight: 600;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  margin-top: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-maroon-button);
  text-decoration: none;
}

.auth-back-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.auth-dev-login {
  margin-top: 1.5rem;
  padding: 1rem 1.125rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.auth-dev-login__label {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

.auth-dev-login__select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  font-size: 0.875rem;
  color: #0f172a;
}

.auth-dev-login__password {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.auth-dev-login__password code {
  font-size: 0.8125rem;
  color: #334155;
}

/* Request access dialog (no public signup) */
body.auth-dialog-open {
  overflow: hidden;
}

.auth-request-access {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}

.auth-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-dialog[hidden] {
  display: none;
}

.auth-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.auth-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(24rem, 100%);
  background: var(--color-base-100, #fff);
  color: var(--color-base-content, #0f172a);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.auth-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.125rem 0.75rem;
  border-bottom: 1px solid var(--color-base-200, #f1f5f9);
}

.auth-dialog__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-base-content, #0f172a);
}

.auth-dialog__close {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: color-mix(in oklch, var(--color-base-content, #64748b) 65%, transparent);
  cursor: pointer;
}

.auth-dialog__close:hover,
.auth-dialog__close:focus-visible {
  background: color-mix(in oklch, var(--color-base-content, #111827) 8%, transparent);
  color: var(--color-base-content, #0f172a);
  outline: none;
}

.auth-dialog__body {
  padding: 1rem 1.125rem 0.25rem;
}

.auth-dialog__lead {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-base-content, #0f172a);
  line-height: 1.45;
}

.auth-dialog__text {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: color-mix(in oklch, var(--color-base-content, #475569) 75%, transparent);
  line-height: 1.5;
}

.auth-dialog__text--muted {
  color: color-mix(in oklch, var(--color-base-content, #64748b) 65%, transparent);
}

.auth-dialog__contact {
  margin: 1rem 0 0;
  padding: 0.75rem 0.875rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--auth-maroon-button, #7a1024) 6%, var(--color-base-100, #fff));
  border: 1px solid color-mix(in srgb, var(--auth-maroon-button, #7a1024) 18%, var(--color-base-300, #e2e8f0));
}

.auth-dialog__contact-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: color-mix(in oklch, var(--color-base-content, #64748b) 65%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.auth-dialog__footer {
  padding: 0.75rem 1.125rem 1.125rem;
}

.auth-dialog__done {
  width: 100%;
}
