@import url("superdesign-forms.css");

html:has(.auth-dialog-page) {
  background: #1e1e1e;
}

.auth-dialog-page {
  max-width: 1512px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 40px;
  background: #f4f5f7;
  box-sizing: border-box;
}

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

.auth-intro {
  max-width: 36rem;
  margin: 0 0 0.85rem;
  color: var(--mk-text-muted, #6b7994);
  font-size: 1rem;
  line-height: 1.45;
}

.auth-intro a {
  color: var(--mk-accent, #7679f2);
  font-weight: 600;
  text-decoration: none;
}

.auth-card {
  position: relative;
  display: flex;
  flex-direction: column;
  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;
}

dialog.auth-overlay-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 1512px);
  max-width: 1512px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 1rem;
  border: 0;
  background: transparent;
  box-sizing: border-box;
}

dialog.auth-overlay-shell::backdrop {
  background: #f4f5f7;
}

dialog.auth-overlay-shell[open] {
  display: flex;
}

.auth-overlay-card {
  flex: 0 1 auto;
  max-height: calc(100vh - 6rem);
  overflow: auto;
}

.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 .app-brand-wordmark {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

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

body[data-auth-flow="login"] #auth-dialog-intro > .auth-intro,
body[data-auth-flow="forgot-password"] #auth-dialog-intro > .auth-intro,
body[data-auth-flow="magic-link"] #auth-dialog-intro > .auth-intro {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.auth-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}

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

.auth-form button[type="submit"] {
  width: 100%;
  margin-top: auto;
  font-weight: 600;
}

.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: 1rem;
  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-dialog-canvas > #auth-dialog-intro,
dialog.auth-overlay-shell > #auth-dialog-intro {
  width: min(490px, 100%);
  margin: 1rem 0 0;
}

.auth-dialog-canvas > .legal-draft-notice,
dialog.auth-overlay-shell > .legal-draft-notice,
.auth-dialog-canvas > .auth-page-status,
dialog.auth-overlay-shell > .auth-page-status,
.auth-dialog-canvas > .auth-callback-status,
dialog.auth-overlay-shell > .auth-callback-status {
  width: min(490px, 100%);
  margin: 0.75rem 0 0;
}

.auth-form-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  width: min(490px, 100%);
  margin: 1rem 0 0;
  font-size: 1rem;
  justify-content: center;
}

.auth-form-links a {
  color: var(--mk-accent, #7679f2);
  font-weight: 600;
  text-decoration: none;
}

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

.signup-consent a,
.signup-explicit-consent a {
  color: var(--mk-accent, #7679f2);
  font-weight: 600;
  text-decoration: none;
}

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

.auth-callback-status {
  margin: 0 0 1rem;
  color: var(--mk-text-muted, #6b7994);
  font-size: 1rem;
  line-height: 1.45;
  text-align: center;
}

.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);
  font-size: 1rem;
  line-height: 1.45;
}

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

@media (max-width: 720px) {
  .auth-dialog-page {
    border-radius: 0;
  }
}
