.auth-dialog-page {
  min-height: 100vh;
  background: #f4f5f7;
}

.auth-dialog-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.auth-intro {
  max-width: 36rem;
  color: var(--mk-text-muted, #6b7994);
}

.auth-card {
  position: relative;
  width: min(490px, 100%);
  min-height: 703px;
  margin: 0 auto;
  padding: 2.125rem 2.5rem 2.5rem;
  border: 0;
  border-radius: 24px;
  background: var(--mk-surface, #fff);
  box-sizing: border-box;
}

.auth-dialog-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mk-ink, #161f30);
  cursor: pointer;
}

dialog.auth-card {
  margin: auto;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

dialog.auth-card::backdrop {
  background: rgb(22 31 48 / 0.28);
}

.auth-dialog-page dialog.auth-card[open] {
  display: block;
}

.auth-dialog-page dialog.auth-card::backdrop {
  background: #f4f5f7;
}

.auth-dialog-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1.5rem;
  color: var(--mk-ink, #161f30);
  text-decoration: none;
}

.auth-dialog-brand .site-brand-wordmark {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.auth-card > h1 {
  margin: 0 0 1rem;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--mk-ink, #161f30);
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.auth-form label:not(.signup-consent):not(.signup-explicit-consent) {
  font-weight: 400;
  font-size: 16px;
  color: var(--mk-text-muted, #6b7994);
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[inputmode="numeric"] {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 0.5rem;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: #f4f5f7;
  font: inherit;
  font-size: 16px;
  box-sizing: border-box;
}

.auth-form button[type="submit"] {
  width: 100%;
  margin-top: 0.25rem;
  min-height: 50px;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 8px;
  background: var(--mk-lavender-subtle, #f1f1fe);
  color: var(--mk-accent, #7679f2);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.auth-form button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-form-error {
  margin: 0;
  color: var(--mk-danger-text, #9b1c1c);
  font-size: 0.95rem;
  line-height: 1.4;
}

.auth-form-error:focus-visible {
  outline: 2px solid var(--mk-accent, #7679F2);
  outline-offset: 2px;
}

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

.auth-form-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.auth-form-links a {
  text-decoration: none;
}

.signup-consent,
.signup-explicit-consent {
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.45;
}

.legal-draft-notice {
  margin: 0;
  font-size: 0.9rem;
  color: var(--mk-text-muted, #6b7994);
}

.auth-page-status {
  max-width: 28rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--mk-surface-subtle, #f3f5fa);
  color: var(--mk-ink, #161f30);
}

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