/* Full-page account access. Keep account API and native dialog behavior separate. */
#auth-dialog {
  --auth-page: #141414;
  --auth-field: #1b1b1b;
  --auth-text: #f9fafb;
  --auth-muted: #a0a0a4;
  --auth-line: #383838;
  --auth-hover: #252525;
  --auth-primary: #f9fafb;
  --auth-primary-text: #161616;
  --auth-error: #f0a1a1;
  --auth-success: #a0cfb6;
  position: fixed;
  inset: 0;
  display: none;
  width: 100%;
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--auth-text);
  background: var(--auth-page);
  box-shadow: none;
  font: 400 14px/1.5 "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
#auth-dialog[open] { display: block; }
#auth-dialog::backdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
#auth-dialog *, #auth-dialog *::before, #auth-dialog *::after { box-sizing: border-box; }
#auth-dialog [hidden], #auth-dialog .liquid-glass-layer { display: none !important; }
#auth-dialog button, #auth-dialog input, #auth-dialog a { -webkit-tap-highlight-color: transparent; }
#auth-dialog button { font-family: inherit; cursor: pointer; }
#auth-dialog button:disabled { cursor: wait; opacity: .5; }
#auth-dialog :is(button, a):focus-visible { outline: 2px solid #729bdf; outline-offset: 4px; }
#auth-dialog .auth-shell {
  display: grid;
  grid-template-columns: clamp(360px, 32.6vw, 600px) minmax(0, 1fr);
  min-height: 100%;
  direction: ltr;
}
#auth-dialog .auth-story {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background: #12202e;
}
/* Same asset and crop used by the reference auth sidebar; no synthetic blur layers. */
#auth-dialog .auth-story-art {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  background-image: url("/art/auth-sidebar-background.webp"), linear-gradient(180deg, #7594b7 0%, #4f6375 31%, #2d3b4d 56%, #121519 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}
#auth-dialog .auth-story-art::before,
#auth-dialog .auth-story-art::after { content: none; }
#auth-dialog .auth-story-copy { width: 100%; max-width: 540px; padding: 64px clamp(40px, 3.9vw, 72px); }
#auth-dialog .auth-story h2 {
  max-width: 390px;
  margin: 0 0 24px;
  color: #fff;
  font: 500 38px/1.46 "DM Sans", system-ui, sans-serif;
  letter-spacing: -.035em;
  text-align: start;
  text-wrap: balance;
}
#auth-dialog .auth-story p { max-width: 390px; margin: 0; color: #dce2e9; font-size: 14px; line-height: 1.7; }
#auth-dialog .auth-story-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 40px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  color: #151a21;
  background: #f9fafb;
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
}
#auth-dialog .auth-story-link:hover { background: #e9edf3; }
#auth-dialog .auth-story-link svg { flex: none; width: 16px; height: 16px; margin-inline-start: 8px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#auth-dialog .auth-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(min-content, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 100svh;
  padding: 48px 40px 24px;
  background: var(--auth-page);
}
#auth-dialog .auth-card { width: min(336px, 100%); min-width: 0; max-width: 100%; margin: 48px auto; }
#auth-dialog .auth-logo { display: block; width: 150px; height: auto; margin: 0 auto 46px; filter: invert(1); }
#auth-dialog #auth-close {
  position: absolute;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--auth-muted);
  background: transparent;
  box-shadow: none;
}
#auth-dialog #auth-close:hover { color: var(--auth-text); background: var(--auth-hover); }
#auth-dialog #auth-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
#auth-dialog #auth-title,
#auth-dialog .auth-fields > .auth-label,
#auth-dialog #auth-email-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
#auth-dialog #auth-description { margin: 0 0 20px; color: var(--auth-muted); font-size: 12px; line-height: 1.5; text-align: center; }
#auth-dialog[data-auth-view="login"] #auth-description { display: none; }
#auth-dialog #auth-plan { margin: 0 0 18px; padding: 0; border: 0; border-radius: 0; color: var(--auth-muted); background: none; font-size: 12px; text-align: center; }
#auth-dialog #auth-form { display: flex; flex-direction: column; margin: 0; }
#auth-dialog .auth-fields { order: 0; }
#auth-dialog .auth-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 11px 17px;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  outline: none;
  color: var(--auth-text);
  background: var(--auth-field);
  box-shadow: none;
  font: 400 14px/24px "DM Sans", system-ui, sans-serif;
  transition: border-color .15s ease;
}
#auth-dialog .auth-input::placeholder { color: var(--auth-muted); opacity: .85; }
#auth-dialog .auth-input:hover { border-color: color-mix(in srgb, var(--auth-line), var(--auth-text) 16%); }
#auth-dialog .auth-input:focus { border-color: #729bdf; outline: 2px solid #729bdf30; outline-offset: 2px; }
#auth-dialog .auth-input[aria-invalid="true"] { border-color: var(--auth-error); }
#auth-dialog .auth-input:disabled { opacity: .6; }
#auth-dialog .auth-password-field { position: relative; margin-top: 20px; }
#auth-dialog .auth-password-field .auth-input { padding-inline-end: 48px; }
#auth-dialog #auth-password-toggle {
  position: absolute;
  inset-inline-end: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--auth-muted);
  background: transparent;
}
#auth-dialog #auth-password-toggle:hover { color: var(--auth-text); }
#auth-dialog #auth-password-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#auth-dialog .auth-eye-slash { display: none; }
#auth-dialog #auth-password-toggle[aria-pressed="true"] .auth-eye-slash { display: block; }
#auth-dialog .auth-password-help { margin: 7px 17px 0; color: var(--auth-muted); font-size: 11px; line-height: 1.6; }
#auth-dialog .auth-email-error { margin: 8px 17px 0; color: var(--auth-error); font-size: 12px; line-height: 1.5; }
#auth-dialog #auth-agreement { order: 1; margin-top: 20px; }
#auth-dialog .auth-agreement-row { display: block; margin: 0; color: var(--auth-muted); font-size: 11.5px; line-height: 1.7; text-align: center; }
#auth-dialog .auth-agreement-row input { width: 15px; height: 15px; margin: 3px 0 0; padding: 0; accent-color: #527cd3; cursor: pointer; }
#auth-dialog .auth-agreement-row label { margin: 0; color: var(--auth-muted); font-size: 11.5px; font-weight: 400; line-height: 1.65; cursor: pointer; }
#auth-dialog .auth-agreement a, #auth-dialog #auth-policy-links a { color: var(--auth-text); text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 2px; }
#auth-dialog .auth-agreement-note { margin: 8px 0 0 24px; padding: 0; border: 0; border-radius: 0; color: var(--auth-muted); background: none; font-size: 11.5px; line-height: 1.65; }
#auth-dialog #auth-policy-links { order: 1; margin: 20px 0 16px; padding: 0; border: 0; color: var(--auth-muted); background: none; font-size: 11.5px; line-height: 1.65; }
#auth-dialog .auth-actions-row { order: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 14px; }
#auth-dialog #auth-forgot { display: inline-flex; align-items: center; min-height: 24px; margin: 0; color: var(--auth-text); font-size: 12px; text-decoration: none; }
#auth-dialog #auth-forgot:hover { text-decoration: underline; text-underline-offset: 3px; }
#auth-dialog .auth-tabs { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; border: 0; border-radius: 0; color: var(--auth-text); background: none; box-shadow: none; }
#auth-dialog .auth-tabs button { flex: none; min-height: 24px; margin: 0; padding: 0; border: 0; border-radius: 0; color: var(--auth-text); background: none; box-shadow: none; font-size: 12px; font-weight: 400; line-height: 1.5; }
#auth-dialog .auth-tabs button:hover { text-decoration: underline; text-underline-offset: 3px; }
#auth-dialog .auth-submit {
  order: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  color: var(--auth-primary-text);
  background: var(--auth-primary);
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
#auth-dialog .auth-submit:hover { background: color-mix(in srgb, var(--auth-primary), var(--auth-page) 12%); }
#auth-dialog[data-auth-view="signup"] #auth-form > .auth-submit { margin-top: 23px; }
#auth-dialog[data-auth-view="signup"] .auth-actions-row { order: 4; justify-content: center; margin: 17px 0 0; }
#auth-dialog:has(#auth-code-form:not([hidden])) #auth-title { position: static; width: auto; height: auto; margin: 0 0 16px; padding: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal; font: 500 23px/1.35 "DM Sans", system-ui, sans-serif; letter-spacing: -.025em; text-align: center; }
#auth-dialog #auth-code-form { margin: 0; }
#auth-dialog .auth-code-intro { margin: 0 0 6px; color: var(--auth-muted); font-size: 12px; line-height: 1.6; text-align: center; }
#auth-dialog .auth-code-email { margin: 0 0 22px; color: var(--auth-text); font-size: 13px; font-weight: 500; text-align: center; overflow-wrap: anywhere; }
#auth-dialog #auth-code-form .auth-label { display: block; margin: 0 0 8px; color: var(--auth-muted); font-size: 12px; font-weight: 400; }
#auth-dialog .auth-code-input { letter-spacing: .45em; font-size: 20px; font-variant-numeric: tabular-nums; text-align: center; }
#auth-dialog #auth-code-submit { margin-top: 24px; }
#auth-dialog .auth-code-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-top: 16px; }
#auth-dialog .auth-resend { min-height: 32px; padding: 4px 0; border: 0; border-radius: 0; color: var(--auth-text); background: none; font-size: 12px; line-height: 1.5; text-decoration: underline; text-underline-offset: 3px; }
#auth-dialog #auth-status { margin: 18px 0 0; padding: 0; border: 0; color: var(--auth-muted); font-size: 12px; line-height: 1.7; text-align: center; }
#auth-dialog #auth-status:has(.auth-feedback[hidden]):has(.auth-verification-actions[hidden]) { display: none; }
#auth-dialog .auth-feedback { margin: 0; color: var(--auth-muted); }
#auth-dialog .auth-feedback[data-kind="error"] { color: var(--auth-error); }
#auth-dialog .auth-feedback[data-kind="success"] { color: var(--auth-success); }
#auth-dialog .auth-verification-actions { margin-top: 10px; }
#auth-dialog:dir(rtl) :is(.auth-card, .auth-story-copy) { direction: rtl; }

@media (max-width: 1200px) and (min-width: 961px) {
  #auth-dialog .auth-story-copy { padding-inline: 40px; }
  #auth-dialog .auth-story h2 { font-size: 34px; }
}
@media (max-width: 960px) {
  #auth-dialog .auth-shell { grid-template-columns: minmax(0, 1fr); }
  #auth-dialog .auth-story { display: none; }
  #auth-dialog .auth-stage { padding: 56px 24px 24px; }
  #auth-dialog .auth-card { margin-block: 44px; }
}
@media (max-width: 500px) {
  #auth-dialog #auth-close { top: 16px; right: 16px; }
  #auth-dialog .auth-stage { padding: 56px 24px 20px; }
  #auth-dialog .auth-card { margin-block: 36px; }
  #auth-dialog .auth-logo { margin-bottom: 38px; }
  #auth-dialog .auth-input { font-size: 16px; }
}
@media (max-height: 650px) {
  #auth-dialog .auth-stage { padding-top: 52px; padding-bottom: 18px; }
  #auth-dialog .auth-card { margin-block: 22px; }
  #auth-dialog .auth-logo { margin-bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  #auth-dialog .auth-input { transition: none; }
}

/* Inline signup verification, matching the account form rather than a separate code page. */
#auth-dialog .auth-signup-code-field { margin-top: 20px; }
#auth-dialog .auth-signup-code-control { position: relative; height: 48px; border: 1px solid var(--auth-line); border-radius: 999px; background: var(--auth-field); }
#auth-dialog .auth-signup-code-control:focus-within { border-color: #729bdf; outline: 2px solid #729bdf30; outline-offset: 2px; }
#auth-dialog .auth-signup-code-control .auth-input { height: 46px; min-height: 46px; padding-inline-end: 146px; border: 0; background: transparent; outline: none; letter-spacing: .06em; box-shadow: none; }
#auth-dialog .auth-signup-code-control .auth-input::placeholder { letter-spacing: normal; }
#auth-dialog .auth-signup-code-send { position: absolute; inset-inline-end: 7px; top: 7px; max-width: 48%; min-height: 32px; padding: 0 12px; border: 0; border-inline-start: 1px solid var(--auth-line); color: var(--auth-text); background: transparent; font-size: 12px; font-weight: 400; line-height: 20px; white-space: nowrap; }
#auth-dialog .auth-signup-code-send:hover { color: #b7cff8; }
#auth-dialog .auth-signup-code-send:disabled { cursor: default; }
#auth-dialog[data-auth-view="signup"] .auth-card { margin-block: 24px; }
#auth-dialog[data-auth-view="signup"] .auth-logo { margin-bottom: 34px; }
#auth-dialog[data-auth-view="signup"] #auth-description { display: none; }
#auth-dialog[data-auth-view="signup"] #auth-agreement { margin-top: 20px; }
#auth-dialog input:-webkit-autofill { -webkit-text-fill-color: var(--auth-text); caret-color: var(--auth-text); -webkit-box-shadow: 0 0 0 1000px var(--auth-field) inset; }
