/* Code API 注册页（/auth）。
   页面现在是「暂未开放注册」的状态：表单都带着 disabled，样式和开放后一致。 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-opsz-normal.woff2") format("woff2-variations");
}

:root {
  color-scheme: dark;
  --page: oklch(14.5% 0 0);
  --fg: oklch(98.5% 0 0);
  --muted-fg: oklch(70.8% 0 0);
  --line: oklch(100% 0 0 / .1);              /* 分割线、卡片边框 */
  --line-strong: oklch(100% 0 0 / .15);      /* 输入框、次要按钮的边框 */
  --fill: oklch(100% 0 0 / .045);            /* 输入框、次要按钮的底色 */
  --card: oklch(20.5% 0 0 / .9);
  --mark: #fff;
  --btn-bg: oklch(92.2% 0 0);                /* 主按钮 */
  --btn-fg: oklch(20.5% 0 0);
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
html.light {
  color-scheme: light;
  --page: oklch(100% 0 0);
  --fg: oklch(14.5% 0 0);
  --muted-fg: oklch(55.6% 0 0);
  --line: oklch(14.5% 0 0 / .1);
  --line-strong: oklch(14.5% 0 0 / .15);
  --fill: oklch(14.5% 0 0 / .05);
  --card: oklch(100% 0 0 / .9);
  --mark: oklch(20.5% 0 0);
  --btn-bg: oklch(20.5% 0 0);
  --btn-fg: oklch(98.5% 0 0);
}

*, *::before, *::after { box-sizing: border-box; border: 0 solid; margin: 0; padding: 0; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; font-family: var(--sans); }
body { line-height: inherit; color: var(--fg); background: var(--page); }
h1, p { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
button, input { font: inherit; letter-spacing: inherit; color: inherit; background: transparent; border-radius: 0; }
svg { display: block; vertical-align: middle; }

/* ---------- 整页：光带背景 + 居中的卡片 ---------- */
.auth {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 100vh; height: 100svh; padding: 16px; overflow: hidden; background: var(--page);
}
/* 光带画在这块画布上，带透明度，叠在页面底色上面 */
#aurora { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
/* 没有 WebGL 时的兜底：三道静态的斜向渐变，位置和画布上的三道光对应 */
html.no-webgl .auth::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(127deg, transparent 30%, oklch(62.7% .265 303.9 / .55) 46%, transparent 62%) 70% -10% / 80% 70% no-repeat,
    linear-gradient(90deg, oklch(62.7% .265 303.9 / .7), oklch(80% .12 320 / .9) 35%, oklch(62.7% .265 303.9 / .7) 75%) 0 44% / 100% 12% no-repeat,
    linear-gradient(135deg, transparent 35%, oklch(62.7% .265 303.9 / .5) 50%, transparent 65%) 10% 100% / 70% 45% no-repeat;
  filter: blur(30px);
}
html.no-webgl.light .auth::before { opacity: .6; }

.corner { position: absolute; top: 16px; z-index: 20; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--fill); transition: background-color .15s; }
.corner:hover { background: oklch(100% 0 0 / .09); }
html.light .corner:hover { background: oklch(14.5% 0 0 / .09); }
.theme { right: 16px; display: grid; place-items: center; width: 36px; cursor: pointer; }
.theme .ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme .sun { display: none; }
html.light .theme .sun { display: block; }
html.light .theme .moon { display: none; }
.back { left: 16px; display: inline-flex; align-items: center; padding: 0 12px; font-size: 14px; line-height: 20px; font-weight: 500; }

/* ---------- 卡片 ---------- */
.card {
  position: relative; z-index: 10; display: flex; flex-direction: column; gap: 24px;
  width: 100%; max-width: 448px; max-height: 100%; overflow: hidden auto; scrollbar-width: none;
  padding: 24px 0; border: 1px solid var(--line); border-radius: 24px;
  background: var(--card); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: card-in .4s ease-out both;
}
.card::-webkit-scrollbar { display: none; }
.mark { position: absolute; top: 16px; right: 16px; width: 80px; height: 80px; fill: var(--mark); opacity: .15; pointer-events: none; }

.head { display: grid; gap: 6px; padding: 0 24px; }
.title { font-size: 24px; line-height: 32px; font-weight: 700; font-style: italic; letter-spacing: -.01em; }
.desc { font-size: 14px; line-height: 20px; color: var(--muted-fg); }
.body { padding: 0 24px; }

/* 「暂未开放」的提示 */
.notice {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; padding: 10px 12px;
  border: 1px solid oklch(76.9% .188 70.08 / .3); border-radius: 8px;
  background: oklch(76.9% .188 70.08 / .1); font-size: 14px; line-height: 20px;
}
.notice svg { flex: none; margin-top: 2px; fill: none; stroke: oklch(80.9% .163 70.08); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 表单 ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field label { display: flex; align-items: center; font-size: 14px; line-height: 14px; font-weight: 500; user-select: none; }
.field input {
  width: 100%; min-width: 0; height: 36px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--fill); font-size: 14px; line-height: 20px; outline: none;
  transition: color .15s, box-shadow .15s, border-color .15s, opacity .15s;
}
.field input::placeholder { color: var(--muted-fg); }
.field input:focus-visible { border-color: var(--line-strong); box-shadow: 0 0 0 3px oklch(100% 0 0 / .1); }
html.light .field input:focus-visible { border-color: oklch(14.5% 0 0 / .15); box-shadow: 0 0 0 3px oklch(14.5% 0 0 / .1); }
html.light .field input { background: oklch(100% 0 0); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 36px; padding: 8px 16px; border-radius: 8px;
  font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, color .15s, opacity .15s;
}
.btn.primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn.primary:hover:not(:disabled) { background: color-mix(in oklab, var(--btn-bg) 90%, transparent); }
.btn.ghost { position: relative; padding: 8px 12px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--fill); color: var(--fg); }
.btn.ghost:hover:not(:disabled) { background: oklch(100% 0 0 / .09); }
html.light .btn.ghost:hover:not(:disabled) { background: oklch(14.5% 0 0 / .09); }
.btn.ghost .big { position: absolute; left: -7px; top: -6px; width: 48px; height: 48px; fill: currentColor; opacity: .2; }
/* 禁用（暂未开放时）：整体变淡，不可点 */
.btn:disabled, .field input:disabled { opacity: .5; pointer-events: none; cursor: not-allowed; }

.divider { position: relative; display: flex; align-items: center; justify-content: center; height: 16px; margin: 24px 0; }
.divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.divider span { position: relative; padding: 0 8px; background: var(--card); font-size: 12px; line-height: 16px; color: var(--muted-fg); }

@keyframes card-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}
