/* Shuma 登录页 —— 1:1 对标 Trae 视觉令牌：方角、克制、单色阶 + 深青点缀 */

:root {
  --bg: #1a1b1d;
  --text: #d1d3db;
  --text-dim: #666b75;
  --line-1: rgba(224, 226, 242, 0.1);
  --line-2: rgba(224, 226, 242, 0.16);
  --line-3: rgba(224, 226, 242, 0.2);
  --overlay-1: rgba(224, 226, 242, 0.04);
  --overlay-2: rgba(224, 226, 242, 0.06);
  --overlay-3: rgba(224, 226, 242, 0.1);
  --brand: #1da08c;
  --brand-hover: #16937f;
  --brand-soft: rgba(29, 160, 140, 0.3);
  --onbrand: #0b0c0e;
  --danger: #f76e6e;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部品牌行 */
.topbar {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: opacity 0.16s ease;
}
.wordmark:hover { opacity: 0.72; }

/* 语言切换：文字式、方角、克制 */
.lang {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-btn {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 4px 2px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  cursor: pointer;
  position: relative;
  transition: color 0.16s ease;
}
.lang-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform 0.2s var(--ease-out);
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { color: var(--text); }
.lang-btn.active::after { transform: scaleX(1); }
.lang-split {
  width: 1px;
  height: 12px;
  background: var(--line-2);
}

/* 舞台 */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 56px;
}
.pane {
  width: 368px;
  max-width: 100%;
}

/* 标题：34 / 600，与 Trae 一致 */
.title {
  margin: 0 0 40px;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
}
#pane-done .title,
#pane-halt .title {
  font-size: 24px;
  margin-bottom: 16px;
}

@keyframes paneIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.code-only:not([hidden]),
.pass-only:not([hidden]) {
  animation: paneIn 0.26s var(--ease-out) both;
}

/* 输入控件：48 高、直角、半透明细边框 */
.field-input {
  width: 100%;
  height: 48px;
  margin-bottom: 16px;
  padding: 0 14px;
  border: 1px solid var(--line-1);
  border-radius: 0;
  background: var(--overlay-1);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.field-input::placeholder { color: var(--text-dim); }
.field-input:hover { border-color: var(--line-2); }
.field-input:focus { border-color: var(--line-3); }

.field-input:-webkit-autofill,
.field-input:-webkit-autofill:hover,
.field-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #232427 inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

/* 复合输入行（图形验证码 / 邮箱验证码） */
.field-row {
  height: 48px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-1);
  border-radius: 0;
  background: var(--overlay-1);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.field-row:hover { border-color: var(--line-2); }
.field-row:focus-within { border-color: var(--line-3); }
.field-row input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.field-row input::placeholder { color: var(--text-dim); }
.row-split {
  flex: none;
  width: 1px;
  height: 24px;
  background: var(--line-2);
}
.captcha-img {
  flex: none;
  width: 108px;
  height: 100%;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.16s ease;
}
.captcha-img:hover { opacity: 0.85; }
.captcha-img svg {
  width: 88px;
  height: 32px;
  display: block;
}
.captcha-img.is-loading { opacity: 0.4; }

.code-box #send-code {
  flex: none;
  height: 100%;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease, opacity 0.16s ease;
}
.code-box #send-code:hover:not(:disabled) { color: #fff; }
.code-box #send-code:disabled { color: var(--text-dim); cursor: not-allowed; }

.pass-only .pass-field { margin-bottom: 10px; }
.alt-hint {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.error {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--danger);
  animation: paneIn 0.22s var(--ease-out) both;
}

/* 协议勾选 */
.agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 24px 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.agree input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.agree-box {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border-radius: 1px;
  border: 1px solid var(--line-3);
  background: var(--overlay-1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
}
.agree-box svg {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s var(--ease-out), transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.agree-box svg path {
  fill: none;
  stroke: var(--onbrand);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.agree input:checked + .agree-box {
  background: var(--brand);
  border-color: var(--brand);
}
.agree input:checked + .agree-box svg {
  opacity: 1;
  transform: scale(1);
}
.agree input:focus-visible + .agree-box {
  outline: 1px solid var(--line-3);
  outline-offset: 2px;
}
.agree-text a {
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.16s ease;
}
.agree-text a:hover { opacity: 0.7; }

/* 主按钮：48 高、直角、纯色深青 */
.submit {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 0;
  background: var(--brand);
  color: var(--onbrand);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.12s ease, opacity 0.16s ease;
}
.submit:hover:not(.is-off) { background: var(--brand-hover); }
.submit:active:not(.is-off) { transform: scale(0.992); }
.submit.is-off {
  background: var(--brand-soft);
  color: rgba(11, 12, 14, 0.62);
  cursor: not-allowed;
}
.submit.is-busy { opacity: 0.72; cursor: default; }

/* 分隔线 + 备选入口 */
.alt-divider {
  border: 0;
  height: 1px;
  margin: 24px 0 16px;
  background: var(--line-2);
}
.alt-btn {
  width: 100%;
  height: 48px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--overlay-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.alt-btn:last-of-type { margin-bottom: 0; }
.alt-btn:hover { background: var(--overlay-3); }
.alt-btn svg {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}
.alt-btn.active {
  background: rgba(29, 160, 140, 0.08);
  border-color: rgba(29, 160, 140, 0.45);
}

.foot {
  margin: 20px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* 成功态 / 拦截态 */
#pane-done,
#pane-halt { text-align: center; }
.subtitle {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}
.subtitle b { color: var(--text); font-weight: 600; }
.return-hint {
  margin: 0 0 28px;
  font-size: 13px;
  color: var(--text-dim);
}
.done-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.done-ring {
  fill: none;
  stroke: rgba(224, 226, 242, 0.22);
  stroke-width: 2;
}
.done-check {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 0.5s 0.15s var(--ease-out) forwards;
}
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.submit-ghost {
  background: transparent;
  border: 1px solid var(--line-1);
  color: var(--text);
}
.submit-ghost:hover { background: var(--overlay-2); }
.submit-ghost:active { transform: scale(0.992); }

@media (max-width: 420px) {
  .title { font-size: 30px; margin-bottom: 32px; }
  .topbar { padding: 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .done-check { stroke-dashoffset: 0; }
}
