/* Auth uses Cloud's existing rm tokens, brand, buttons and form primitives. */
.auth-page {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background: var(--rm-panel, #f7f7f6);
  color: var(--rm-ink, #111);
  font-family: var(--rm-sans, system-ui, sans-serif);
}

.auth-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  width: min(100%, 508px);
  margin-inline: auto;
  padding: 44px 24px 32px;
  flex-direction: column;
  justify-content: center;
}

.auth-brand { display: flex; justify-content: center; margin-bottom: 28px; }
.auth-brand .brand-mark { min-height: 44px; font-size: 16px; }
.auth-card {
  min-width: 0;
  padding: 36px;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-large);
  background: var(--rm-white);
  box-shadow: 0 6px 24px rgb(17 17 17 / 3%);
  overflow-wrap: anywhere;
}
.auth-heading { margin-bottom: 28px; }
.auth-heading h1 {
  margin: 0;
  font-family: var(--rm-serif);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.auth-description { margin: 12px 0 0; color: var(--rm-muted); font-size: 14px; line-height: 1.6; }
.auth-badge {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 6px 10px;
  border: 1px solid var(--rm-line);
  border-radius: 999px;
  background: var(--rm-panel);
  color: var(--rm-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}
.auth-form { display: grid; gap: 20px; }
.auth-field { display: grid; gap: 8px; min-width: 0; }
.auth-field label { color: var(--rm-ink); font-size: 13px; font-weight: 650; }
.auth-input { min-width: 0; min-height: 48px; padding: 11px 13px; border-color: #92928b; border-radius: var(--rm-radius-small); font-size: 16px; }
.auth-input[aria-invalid="true"] { border-color: var(--rm-danger); }
.auth-page :is(a, button, input, select, .auth-error-summary):focus-visible {
  outline: 2px solid var(--rm-ink);
  outline-offset: 3px;
}
.auth-card :is(p, h2) { overflow-wrap: anywhere; }
.auth-hint { margin: 0; color: var(--rm-muted); font-size: 12px; line-height: 1.5; }
.auth-field-error { margin: 0; color: var(--rm-danger); font-size: 12px; line-height: 1.5; }
.auth-primary { width: 100%; min-height: 48px; padding: 13px 18px; font-size: 14px; line-height: 1.4; white-space: normal; text-align: center; }
.auth-form .auth-primary { margin-top: 4px; }
.auth-secondary { display: grid; gap: 2px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rm-line); }
.auth-secondary a, .auth-return { display: inline-flex; min-height: 44px; align-items: center; font-size: 13px; line-height: 1.5; text-decoration: underline; text-underline-offset: 4px; }
.auth-secondary a { color: var(--rm-muted); }
.auth-secondary a:hover, .auth-return:hover { color: var(--rm-ink); }
.auth-secondary > a, .auth-return { color: var(--rm-ink); font-weight: 400; text-decoration: none; }
.auth-secondary > a:hover, .auth-secondary > a:focus-visible, .auth-return:hover, .auth-return:focus-visible { text-decoration: underline; }
.auth-secondary p { margin: 0; color: var(--rm-muted); font-size: 13px; line-height: 1.6; }
.auth-secondary p a { color: var(--rm-ink); font-weight: 400; }
.auth-secondary--login { gap: 0; padding-top: 0; border-top: 0; }
.auth-secondary--login > a { min-height: 32px; }
.auth-invite-note { margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--rm-line); color: var(--rm-muted); font-size: 12px; line-height: 1.6; }
.auth-invite-note p { margin: 0; }
.auth-invite-note p + p { margin-top: 6px; }
.auth-identity { display: flex; gap: 12px; align-items: center; padding: 16px; margin: 0 0 24px; border: 1px solid var(--rm-line); border-radius: var(--rm-radius-small); background: var(--rm-panel); }
.auth-identity > div { min-width: 0; }
.auth-identity__icon { display: inline-flex; flex: 0 0 20px; color: var(--rm-muted); }
.auth-identity__icon svg { width: 20px; height: 20px; }
.auth-identity__label { margin: 0 0 5px; color: var(--rm-muted); font-size: 11px; line-height: 1.5; }
.auth-identity__email { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.5; }
.auth-notice { margin: 0 0 24px; padding: 15px 16px; border: 1px solid var(--rm-line); border-radius: var(--rm-radius-small); background: var(--rm-panel); color: var(--rm-muted); font-size: 13px; line-height: 1.6; }
.auth-notice p { margin: 0; }
.auth-notice .auth-notice__label { margin-bottom: 4px; font-weight: 650; }
.auth-notice--error { border-color: #f0dcdc; background: #fff8f8; color: var(--rm-danger); }
.auth-notice--success { border-color: #dce9e0; background: #f4faf5; color: var(--rm-success); }
.auth-error-summary h2 { margin: 0; font: inherit; font-weight: 650; }
.auth-error-summary ul { margin: 8px 0 0; padding-left: 18px; }
.auth-error-summary li + li { margin-top: 5px; }
.auth-error-summary a { font-weight: 600; text-decoration: none; }
.auth-error-summary a:hover, .auth-error-summary a:focus-visible { border-radius: 3px; background: #f7e9e9; }
.auth-form .auth-notice { margin-bottom: 0; }
.auth-terminal-actions { display: grid; gap: 12px; }
.auth-terminal-actions .auth-return { justify-content: center; }
.auth-check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 13px; color: var(--rm-muted); }
.auth-check input { width: 18px; height: 18px; accent-color: var(--rm-dark); }
.auth-footer { margin: 24px 0 0; color: var(--rm-muted); font-size: 12px; text-align: center; line-height: 1.5; }
.auth-progress { display: flex; gap: 10px; align-items: center; }
.auth-progress::before { content: ""; width: 10px; height: 10px; flex: 0 0 10px; border: 2px solid currentColor; border-radius: 50%; }
.auth-page [hidden] { display: none !important; }
.auth-account-section { margin-top: 24px; }
@media (max-width: 480px) {
  .auth-shell { padding: 24px 16px; }
  .auth-brand { margin-bottom: 18px; }
  .auth-card { padding: 26px 24px; border-radius: 18px; }
  .auth-heading h1 { font-size: 30px; }
  .auth-heading { margin-bottom: 24px; }
  .auth-identity { padding: 13px; gap: 10px; }
}
@media (max-width: 350px) {
  .auth-card { padding: 24px 18px; }
}
