/* 专注登录：居中表单、衬线标题与浅蓝白留白。控件外观由 controls.css 提供。 */

:root { color-scheme: light; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(150deg, #fff 30%, #f9fcfe 62%, #eff8fd 100%);
  color: #303d47;
}

/* portal.css 的暗色网格和暗角不应透到这两张页面上。 */
body::before,
body::after { display: none; }

.au {
  --au-ink: #303d47;
  --au-muted: #667a87;
  --au-accent: #4d7790;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  /* 注册表在小屏会比一屏高；不能用裁切把底下的提交按钮吞掉。 */
  overflow: visible;
}

.au-skip {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 12px;
  background: #0b6fa6;
  box-shadow: 0 8px 21px rgba(19, 92, 135, 0.24);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
}

.au-skip:focus { transform: none; }

.au-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(24px, 4vw, 64px);
}

.au-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--au-ink); font-size: 14px; font-weight: 650; text-decoration: none; }
.au-brand img { display: block; flex: 0 0 auto; border-radius: 8px; }
.au-home { padding: 10px 0; color: var(--au-muted); font-size: 12px; text-decoration: none; }
.au-home:hover { color: var(--au-accent); text-decoration: underline; text-underline-offset: 4px; }

.au-main {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 100%;
  min-height: 0;
  padding: 48px 24px 72px;
}

.au-panel {
  position: relative;
  width: min(100%, 400px);
  margin: 0;
  color: var(--au-ink);
}

.au-panel__head { display: grid; gap: 12px; margin-bottom: 36px; text-align: center; }
/* Keep the result announcement focused without outlining the entire card. */
.au-panel > #card[tabindex="-1"]:focus { outline: none; }

.au__h1 {
  margin: 0;
  color: var(--au-ink);
  font-family: var(--portal-serif);
  font-size: clamp(32px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-wrap: balance;
}

.au__sub { margin: 0; color: var(--au-muted); font-size: 14px; line-height: 1.7; text-wrap: pretty; }

/* 只有一句结果和一两个按钮的页面(邮件偏好):和标题一样走中轴 */
.au-panel__status { margin: 0 0 16px; color: var(--au-muted); font-size: 14px; line-height: 1.7; text-align: center; }
.au-panel__status:empty { display: none; }
.au-panel__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* 错误页标题上方那个小号的状态码(404):给支持排查用,不抢标题 */
.au-error-code { margin: 0; color: var(--au-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; }

.au-field { margin: 0 0 22px; }

.au-field__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.au-field label { color: var(--au-ink); font-size: 13px; font-weight: 550; }

.au-field__aside {
  color: var(--au-accent);
  font-size: 12px;
  font-weight: 500;
  text-decoration-color: #bfd6e3;
  text-underline-offset: 3px;
}

.au-form-help { margin: 15px 0 0; text-align: center; }

.au-password { position: relative; }

/* 认证页的密码复合控件：按钮在输入框内部，不占用两次输入之间的 Tab 顺序。 */
button[data-password-toggle] {
  position: absolute;
  top: 3px;
  /* 逻辑方向:阿拉伯语界面里按钮跟着挪到输入框的另一头 */
  inset-inline-end: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}
button[data-password-toggle] svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
button[data-password-toggle] .au-password__slash { display: none; }
button[data-password-toggle][aria-pressed="true"] .au-password__slash { display: initial; }

/* Base field appearance and validation states come from shared controls.css. */
.au-field input { width: 100%; }
.au-password input { padding-inline-end: 56px; }

.au-hint { margin: 7px 1px 0; color: var(--au-muted); font-size: 12px; line-height: 1.6; }

.au-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 100%; margin-top: 8px; overflow: hidden; }

/*
 * 表单上方那句话跟着卡片居中:标题、副标题、按钮都在中轴上,只有它靠左会显得歪。
 * 不换行 —— 长句在文字自己的那一栏里折行(也居中),圆点始终贴着第一行。
 */
.au-say {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  margin: 0 0 17px;
  padding: 11px 12px;
  border: 1px solid rgba(30, 122, 165, 0.2);
  border-radius: 14px;
  background: rgba(233, 248, 253, 0.78);
  color: #1a526e;
  font-size: 13px;
  line-height: 1.55;
}

.au-say[hidden] { display: none; }
/* 默认(note)也要有颜色:原来是透明的,占着位置却看不见,文字就凭空往右偏了一截 */
.au-say__dot { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 0.52em; border-radius: 50%; background: #2d8fc0; box-shadow: 0 0 0 3px rgba(45, 143, 192, 0.13); }
.au-say--bad { border-color: rgba(198, 92, 81, 0.38); background: #fff1ed; color: #7b382f; }
.au-say--bad .au-say__dot { background: #c65c51; box-shadow: 0 0 0 3px rgba(198, 92, 81, 0.13); }
.au-say--ok { border-color: rgba(20, 137, 162, 0.3); background: #e6f8f5; color: #17616d; }
.au-say--ok .au-say__dot { background: #168294; box-shadow: 0 0 0 3px rgba(22, 130, 148, 0.12); }

.au-panel__switch {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 30px 0 0;
  padding-top: 0;
  border-top: 0;
  color: var(--au-muted);
  font-size: 13px;
  line-height: 1.45;
}

.au-panel__switch a {
  color: var(--au-accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.au-panel__switch a:hover { text-decoration: underline; text-underline-offset: 4px; }

.au-footer { padding: 24px; color: var(--au-muted); font-size: 12px; line-height: 1.7; text-align: center; }

.au-done { animation: au-enter 260ms ease-out both; }
.au-done__h { margin: 0 0 14px; color: var(--au-ink); font-family: var(--portal-serif); font-weight: 400; font-size: 28px; line-height: 1.5; text-wrap: balance; }
.au-done__p { margin: 0 0 20px; color: var(--au-muted); font-size: 14px; line-height: 1.7; text-wrap: pretty; overflow-wrap: anywhere; }
.au-done ol { margin: 0 0 20px; padding-inline-start: 20px; color: var(--au-ink); font-size: 13.5px; line-height: 1.75; }

@keyframes au-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 650px) {
  .au-header { padding: 18px 24px; }
  .au-main { padding: 40px 24px 48px; }
  .au-panel__head { margin-bottom: 30px; }
  .au-footer { padding: 20px 24px; }
}

@media (prefers-contrast: more) {
  .au-muted,
  .au-hint { color: #355a73; }
}

@media (prefers-reduced-motion: reduce) {
  .au *,
  .au *::before,
  .au *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 语言选择和「返回首页」并排；控件外观由共享导航变体提供。 */
.au-header__actions { display: flex; align-items: center; gap: 10px; }
.au-header__actions select.ui-language { max-width: 128px; }

/* 消息里可以直接点的下一步(例如「重发验证邮件」)。外观归 controls.css,这里只管位置 */
.au-say__action {
  /* 不被长句挤成两行(「重新/发送」) */
  flex: 0 0 auto;
  white-space: nowrap;
  margin-inline-start: 8px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.au-say__action[disabled] { opacity: .55; cursor: default; }

/* Social login reuses shared controls; only arrangement belongs here. */
.au-social { margin-block-end: 24px; }
.au-social[hidden], .au-social [hidden] { display: none; }
.au-social__button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.au-social__button img { width: 20px; height: 20px; flex: 0 0 auto; }
.au-social__consent { margin-block: 16px; }
.au-social__back { margin-block-start: 12px; }
.au-social__separator { display: flex; align-items: center; gap: 12px; margin: 20px 0 0; color: var(--au-muted); font-size: 12px; }
.au-social__separator::before, .au-social__separator::after { content: ""; flex: 1; height: 1px; background: var(--au-border, #d5e4ec); }
/* Google callback is a transition screen from the first paint, before async scripts run. */
.au-transition { display: none; text-align: center; min-height: 240px; align-content: center; justify-items: center; gap: 16px; }
.au-transition h1 { margin: 0; font-size: 26px; line-height: 1.4; }
.au-transition p { margin: 0; color: var(--au-muted); line-height: 1.7; }
.au-transition__spinner { width: 32px; height: 32px; border: 3px solid #d8e8f4; border-top-color: #3879a7; border-radius: 50%; animation: au-transition-spin .8s linear infinite; }
html[data-auth-transition] #card > :not(.au-transition) { display: none !important; }
html[data-auth-transition] .au-transition { display: grid; }
@keyframes au-transition-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .au-transition__spinner { animation: none; } }
