/* ==========================================================================
   登录 / 注册页样式（与 api.routellm.cn 同款：左侧视频品牌故事面板 + 右侧表单卡）
   桌面双栏 + 手机单栏自适应，明暗主题跟随 style.css 的 CSS 变量。
   ========================================================================== */

.gateway-login {
  min-height: 100svh;
  display: flex;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------- 左侧品牌故事面板 ---------- */
.gateway-story {
  position: relative;
  display: none;
  flex: 1.1;
  overflow: hidden;
  background: #000;
}
@media (min-width: 1024px) {
  .gateway-story { display: block; }
}
.gateway-story__bg,
.gateway-story-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gateway-story__bg { opacity: 0.55; }
.gateway-story-video { opacity: 0.9; }
.gateway-story__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 12, 0.2) 0%, rgba(5, 8, 12, 0.55) 60%, rgba(5, 8, 12, 0.85) 100%);
}
.gateway-story-inner {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
}
.gateway-story__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.gateway-story__brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
}
.gateway-story__brand span {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.gateway-story-copy h1 {
  margin: 0;
  max-width: 460px;
  color: #fff;
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
}
.gateway-story-copy h1 span {
  background: linear-gradient(90deg, #ffb37a, #ff7a59);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gateway-description {
  margin: 18px 0 0;
  max-width: 420px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.75;
}
.gateway-models {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  color: rgba(255, 255, 255, 0.85);
}
.gateway-models > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}
.gateway-models svg {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

/* ---------- 右侧表单面板 ---------- */
.gateway-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.gateway-card {
  position: relative;
  width: 100%;
  max-width: 448px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 28px 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}
.gateway-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.gateway-card__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--foreground);
  text-decoration: none;
}
.gateway-card__brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
}
.gateway-card__brand span {
  font-size: 15px;
  font-weight: 600;
}
.gateway-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.gateway-theme-btn:hover { color: var(--foreground); }
.gateway-theme-btn svg { width: 17px; height: 17px; }
.gateway-theme-btn .icon-moon { display: none; }
html.dark .gateway-theme-btn .icon-moon { display: block; }
html.dark .gateway-theme-btn .icon-sun { display: none; }

.gateway-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.gateway-card__sub {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.gateway-field {
  display: block;
  margin-bottom: 14px;
}
.gateway-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted-foreground);
}
.gateway-field input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gateway-field input::placeholder { color: var(--muted-foreground); opacity: 0.75; }
.gateway-field input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
}
.gateway-field__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.gateway-field__row label { margin-bottom: 0; }
.gateway-field__row a {
  font-size: 12.5px;
  color: var(--primary);
  text-decoration: none;
}
.gateway-field__row a:hover { text-decoration: underline; }

.gateway-error {
  display: none;
  margin: 2px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, #ef4444 12%, transparent);
  border: 1px solid color-mix(in srgb, #ef4444 35%, transparent);
  color: #ef4444;
  font-size: 13px;
  line-height: 1.5;
}

.gateway-submit {
  margin-top: 6px;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.gateway-submit:hover { opacity: 0.92; }
.gateway-submit:active { transform: translateY(1px); }
.gateway-submit[disabled] { opacity: 0.55; cursor: not-allowed; }

.gateway-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--muted-foreground);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gateway-divider::before,
.gateway-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.gateway-github {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.gateway-github:hover { background: color-mix(in srgb, var(--foreground) 6%, transparent); }
.gateway-github svg { width: 18px; height: 18px; }

.gateway-register {
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted-foreground);
}
.gateway-register a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.gateway-register a:hover { text-decoration: underline; }

.gateway-home {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
}
.gateway-home a { color: var(--muted-foreground); text-decoration: none; }
.gateway-home a:hover { color: var(--foreground); }

/* 底部提示 */
.gateway-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(8px);
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--popover);
  color: var(--foreground);
  font-size: 13px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 50;
}
.gateway-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 移动端 */
@media (max-width: 767px) {
  .gateway-panel { padding: 28px 16px; }
  .gateway-card { padding: 24px 20px 22px; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .gateway-login *, .gateway-login *::before, .gateway-login *::after {
    transition: none !important;
    animation: none !important;
  }
  .gateway-story-video { display: none; }
}

/* 邮箱验证码行 */
.gateway-verify-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.gateway-verify-row input { flex: 1 1 auto; min-width: 0; }
.gateway-send-code {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.gateway-send-code:hover { background: color-mix(in srgb, var(--foreground) 6%, transparent); }
.gateway-send-code[disabled] { opacity: 0.55; cursor: not-allowed; }