/**
 * 主题三 · 认证页（奶油底 / 珊瑚橙 / 居中表单无背景卡）
 * 原创 th3-auth，禁止 st-* / 左右分栏壳。
 */
:root {
  --th3-auth-bg: #FBFAF7;
  --th3-auth-bg2: #F4F1EA;
  --th3-auth-card: #FFFFFF;
  --th3-auth-fg: #0B0B0B;
  --th3-auth-fg2: #3A3A3A;
  --th3-auth-muted: #8A8A82;
  --th3-auth-border: #E8E3D8;
  --th3-auth-accent: #FF4D2D;
  --th3-auth-accent-soft: #FFE8E1;
  --th3-auth-shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 24px 60px -16px rgba(11, 11, 11, 0.14);
  --th3-auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.th3-auth-body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  background:
    radial-gradient(ellipse 70% 50% at 80% -10%, color-mix(in srgb, var(--th3-auth-accent) 18%, transparent), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 110%, color-mix(in srgb, #0D9488 12%, transparent), transparent 50%),
    var(--th3-auth-bg);
  color: var(--th3-auth-fg);
  -webkit-font-smoothing: antialiased;
}

.th3-auth-body .font-display {
  font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  letter-spacing: -0.02em;
}

.th3-auth-body .font-mono {
  font-family: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
}

.th3-auth {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.th3-auth__glow {
  position: absolute;
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  border-radius: 50%;
  background: color-mix(in srgb, var(--th3-auth-accent) 22%, transparent);
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
  top: 12%;
  right: 8%;
  z-index: 0;
}

.th3-auth__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.th3-auth__card.glass {
  background: transparent;
}

.th3-auth__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--th3-auth-muted);
}

.th3-auth__title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--th3-auth-fg);
}

.th3-auth__sub {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--th3-auth-fg2);
}

.th3-auth__msg {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.45;
  border: 1px solid var(--th3-auth-border);
  background: var(--th3-auth-bg2);
  color: var(--th3-auth-fg2);
}

.th3-auth__msg--error {
  background: color-mix(in srgb, #ef4444 8%, var(--th3-auth-card));
  border-color: color-mix(in srgb, #ef4444 28%, var(--th3-auth-border));
  color: #b91c1c;
}

.th3-auth__msg--success {
  background: color-mix(in srgb, #0D9488 10%, var(--th3-auth-card));
  border-color: color-mix(in srgb, #0D9488 30%, var(--th3-auth-border));
  color: #0f766e;
}

.th3-auth__msg--info {
  background: var(--th3-auth-accent-soft);
  border-color: color-mix(in srgb, var(--th3-auth-accent) 28%, var(--th3-auth-border));
  color: var(--th3-auth-fg2);
}

.th3-auth__msg a {
  color: var(--th3-auth-accent);
  font-weight: 600;
  text-decoration: none;
}

.th3-auth__msg a:hover {
  text-decoration: underline;
}

.th3-auth form {
  margin-top: 1.25rem;
}

.th3-auth__field {
  margin-bottom: 0.85rem;
}

.th3-auth__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--th3-auth-bg2);
  color: var(--th3-auth-fg);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.25s var(--th3-auth-ease), background 0.25s, box-shadow 0.25s var(--th3-auth-ease);
}

.th3-auth__input::placeholder {
  color: var(--th3-auth-muted);
}

.th3-auth__input:focus {
  border-color: var(--th3-auth-accent);
  background: var(--th3-auth-card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--th3-auth-accent) 18%, transparent);
}

.th3-auth__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.th3-auth__pw-wrap {
  position: relative;
}

.th3-auth__pw-wrap .th3-auth__input {
  padding-right: 2.75rem;
}

.th3-auth__pw-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--th3-auth-muted);
  cursor: pointer;
  padding: 0;
}

.th3-auth__pw-toggle:hover {
  color: var(--th3-auth-fg);
  background: color-mix(in srgb, var(--th3-auth-fg) 5%, transparent);
}

.th3-auth__pw-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

.th3-auth__group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.th3-auth__group .th3-auth__input {
  flex: 1;
  min-width: 0;
}

.th3-auth__code-btn {
  flex: 0 0 auto;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--th3-auth-border);
  background: var(--th3-auth-card);
  color: var(--th3-auth-fg);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.2s var(--th3-auth-ease);
}

.th3-auth__code-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--th3-auth-accent) 45%, var(--th3-auth-border));
  color: var(--th3-auth-accent);
}

.th3-auth__code-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.th3-auth__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin: 0.15rem 0 0.85rem;
  font-size: 0.875rem;
  position: relative;
  z-index: 3;
}

.th3-auth__row a,
.th3-auth__mode-toggle {
  color: var(--th3-auth-fg2);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 6px 0;
  margin: 0;
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.th3-auth__row a:hover,
.th3-auth__mode-toggle:hover {
  color: var(--th3-auth-accent);
}

.th3-auth__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.9rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--th3-auth-fg);
  color: var(--th3-auth-bg);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.3s var(--th3-auth-ease), background 0.25s, box-shadow 0.3s var(--th3-auth-ease);
}

.th3-auth__submit:hover:not(:disabled) {
  background: var(--th3-auth-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -10px color-mix(in srgb, var(--th3-auth-accent) 55%, transparent);
}

.th3-auth__submit:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.th3-auth__submit:disabled,
.th3-auth__submit.is-loading {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.th3-auth__oauth {
  margin-top: 1.35rem;
  text-align: center;
}

.th3-auth__oauth-label {
  font-size: 0.75rem;
  color: var(--th3-auth-muted);
  margin-bottom: 0.65rem;
}

.th3-auth__oauth-icons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.th3-auth__oauth-icons a {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--th3-auth-border);
  background: var(--th3-auth-card);
  transition: transform 0.25s var(--th3-auth-ease), border-color 0.25s, box-shadow 0.25s;
}

.th3-auth__oauth-icons a:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--th3-auth-accent) 40%, var(--th3-auth-border));
  box-shadow: 0 8px 20px -12px rgba(11, 11, 11, 0.25);
}

.th3-auth__oauth-icons img {
  display: block;
  width: 22px;
  height: 22px;
}

.th3-auth__foot {
  margin-top: 1.15rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--th3-auth-fg2);
}

.th3-auth__foot a {
  color: var(--th3-auth-accent);
  font-weight: 600;
  text-decoration: none;
}

.th3-auth__foot a:hover {
  text-decoration: underline;
}

/* 角色分段 */
.th3-auth__role {
  margin-bottom: 0.85rem;
}

.th3-auth__role-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  background: var(--th3-auth-bg2);
  border: 1px solid var(--th3-auth-border);
}

.th3-auth__role-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.65rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--th3-auth-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.th3-auth__role-btn.is-active {
  color: var(--th3-auth-fg);
}

.th3-auth__role-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--th3-auth-card);
  box-shadow: 0 1px 4px rgba(11, 11, 11, 0.08);
  transition: transform 0.28s var(--th3-auth-ease);
  pointer-events: none;
}

.th3-auth__role-track[data-role="developer"] .th3-auth__role-thumb {
  transform: translateX(100%);
}

.th3-auth__card.is-shake {
  animation: th3AuthShake 0.42s var(--th3-auth-ease);
}

@keyframes th3AuthShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .th3-auth__submit:hover:not(:disabled),
  .th3-auth__oauth-icons a:hover {
    transform: none;
  }
  .th3-auth__card.is-shake {
    animation: none;
  }
}
