@import url('variables.css');

/* ── 页面基底：即时设计风格渐变 ── */
body.auth-page {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
}

body.auth-page.mesh-bg-strong {
  background-attachment: fixed;
}

.auth-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── 顶栏 Logo ── */
.auth-topbar {
  padding: 28px 48px;
  flex-shrink: 0;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  backdrop-filter: blur(8px);
}

/* ── 主区域：左文案 + 右卡片 ── */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 0 8vw 48px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.auth-hero {
  flex: 1;
  max-width: 520px;
  color: #fff;
  padding-right: 24px;
}

.auth-hero h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.auth-features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  padding: 0;
  margin: 0;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.95;
}

.auth-features .feat-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  flex-shrink: 0;
}

/* ── 右侧白色卡片 ── */
.auth-card-wrap {
  flex-shrink: 0;
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px 36px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.02),
    0 20px 50px rgba(0, 0, 0, 0.1);
}

.auth-card-header {
  margin-bottom: 28px;
}

.auth-card-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.auth-card-header .auth-switch {
  font-size: 0.875rem;
  color: #888;
  margin: 0;
}

.auth-card-header .auth-switch a {
  color: #3b9eff;
  font-weight: 500;
  text-decoration: none;
  margin-left: 2px;
}

.auth-card-header .auth-switch a:hover {
  color: #1a8ae6;
  text-decoration: underline;
}

/* ── 面板切换 ── */
.auth-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

.auth-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 表单控件 ── */
.auth-field {
  margin-bottom: 16px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input-wrap:focus-within {
  border-color: #3b9eff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 158, 255, 0.12);
}

.auth-input-icon {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 0.95rem;
}

.auth-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 14px 14px 0;
  font-size: 0.95rem;
  color: #1a1a1a;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

.auth-input-wrap input::placeholder {
  color: #bbb;
}

.auth-input-action {
  padding: 0 14px;
  border: none;
  background: none;
  color: #999;
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.auth-input-action:hover {
  color: #3b9eff;
}

.auth-input-suffix-btn {
  margin-right: 6px;
  padding: 8px 14px;
  border: none;
  background: #f0f7ff;
  color: #3b9eff;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  font-family: inherit;
}

.auth-input-suffix-btn:hover:not(:disabled) {
  background: #dbeafe;
}

.auth-input-suffix-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── 密码强度 ── */
.strength-bar {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.strength-segment {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: #eee;
  transition: background 0.25s;
}

.strength-segment.on { background: #3b9eff; }
.strength-segment.weak.on { background: #f59e0b; }
.strength-segment.strong.on { background: #10b981; }

.strength-hints {
  list-style: none;
  padding: 8px 0 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.72rem;
  color: #aaa;
}

.strength-hints li.ok { color: #10b981; }

/* ── 图形验证码行 ── */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.captcha-row img {
  height: 42px;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  cursor: pointer;
  background: #f5f5f5;
}

.captcha-refresh {
  font-size: 0.8rem;
  color: #3b9eff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.captcha-refresh:hover { text-decoration: underline; }

/* ── 主按钮 ── */
.auth-submit {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #8ed4ff 0%, #6ec4f7 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(110, 196, 247, 0.45);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ── 提示与协议 ── */
.auth-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
  line-height: 1.5;
}

.auth-alert.show { display: block; }

.auth-alert.error {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #fed7d7;
}

.auth-legal {
  margin-top: 16px;
  font-size: 0.75rem;
  color: #aaa;
  text-align: center;
  line-height: 1.6;
}

.auth-legal a {
  color: #3b9eff;
  text-decoration: none;
}

.auth-legal a:hover { text-decoration: underline; }

/* ── 底栏 ── */
.auth-footer {
  padding: 20px 48px 28px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.auth-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  margin-left: 12px;
}

.auth-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ── 响应式 ── */
@media (max-width: 960px) {
  .auth-main {
    flex-direction: column;
    justify-content: center;
    padding: 0 20px 32px;
    gap: 32px;
  }

  .auth-hero {
    text-align: center;
    max-width: 100%;
    padding-right: 0;
  }

  .auth-hero h1 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
  }

  .auth-features {
    justify-content: center;
  }

  .auth-card-wrap {
    max-width: 440px;
  }

  .auth-topbar,
  .auth-footer {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 22px 24px;
    border-radius: 16px;
  }

  .auth-topbar {
    padding: 20px;
  }
}
