/* ============================================
   天天三国 - 认证页面样式
   登录 · 注册 · 古风战场美学
   ============================================ */

/* ============================================
   认证页面容器
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  position: relative;
  overflow: hidden;
}

/* 背景装饰层 - 水墨山水意境 */
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    /* 左上角暗红晕染 */
    radial-gradient(ellipse at 10% 10%, rgba(139, 0, 0, 0.15) 0%, transparent 50%),
    /* 右下角金色微光 */
    radial-gradient(ellipse at 90% 90%, rgba(218, 165, 32, 0.08) 0%, transparent 40%),
    /* 中央聚焦光 */
    radial-gradient(ellipse at 50% 40%, rgba(139, 0, 0, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* 飘浮墨点装饰 */
.auth-page::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(218, 165, 32, 0.04) 0%, transparent 3%),
    radial-gradient(circle at 85% 15%, rgba(139, 0, 0, 0.05) 0%, transparent 2%),
    radial-gradient(circle at 70% 75%, rgba(218, 165, 32, 0.03) 0%, transparent 4%),
    radial-gradient(circle at 25% 80%, rgba(139, 0, 0, 0.04) 0%, transparent 2.5%),
    radial-gradient(circle at 50% 50%, rgba(218, 165, 32, 0.02) 0%, transparent 5%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   认证表单卡片
   ============================================ */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 23.75rem;
  background: linear-gradient(
    170deg,
    rgba(30, 18, 18, 0.95) 0%,
    rgba(26, 26, 26, 0.98) 100%
  );
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl) var(--spacing-lg);
  box-shadow:
    var(--shadow-lg),
    0 0 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(218, 165, 32, 0.08);
  animation: authCardEnter 0.6s ease-out both;
}

/* 卡片顶部金线 */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 0.125rem;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-gold-dark) 20%,
    var(--color-gold) 50%,
    var(--color-gold-dark) 80%,
    transparent
  );
  border-radius: 0 0 0.125rem 0.125rem;
}

/* 卡片底部红线 */
.auth-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.875rem;
  right: 1.875rem;
  height: 0.0625rem;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-primary) 30%,
    var(--color-primary-light) 50%,
    var(--color-primary) 70%,
    transparent
  );
}

/* ============================================
   装饰角标
   ============================================ */
.auth-card-corner {
  position: absolute;
  width: 1.5rem;
  height: 1.5rem;
  pointer-events: none;
}

.auth-card-corner::before,
.auth-card-corner::after {
  content: '';
  position: absolute;
  background: var(--color-gold-dark);
}

.auth-card-corner--tl {
  top: 0.5rem;
  left: 0.5rem;
}
.auth-card-corner--tl::before {
  top: 0; left: 0;
  width: 1rem; height: 0.0625rem;
}
.auth-card-corner--tl::after {
  top: 0; left: 0;
  width: 0.0625rem; height: 1rem;
}

.auth-card-corner--tr {
  top: 0.5rem;
  right: 0.5rem;
}
.auth-card-corner--tr::before {
  top: 0; right: 0;
  width: 1rem; height: 0.0625rem;
}
.auth-card-corner--tr::after {
  top: 0; right: 0;
  width: 0.0625rem; height: 1rem;
}

.auth-card-corner--bl {
  bottom: 0.5rem;
  left: 0.5rem;
}
.auth-card-corner--bl::before {
  bottom: 0; left: 0;
  width: 1rem; height: 0.0625rem;
}
.auth-card-corner--bl::after {
  bottom: 0; left: 0;
  width: 0.0625rem; height: 1rem;
}

.auth-card-corner--br {
  bottom: 0.5rem;
  right: 0.5rem;
}
.auth-card-corner--br::before {
  bottom: 0; right: 0;
  width: 1rem; height: 0.0625rem;
}
.auth-card-corner--br::after {
  bottom: 0; right: 0;
  width: 0.0625rem; height: 1rem;
}

/* ============================================
   标题区域
   ============================================ */
.auth-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  animation: authHeaderEnter 0.7s ease-out both;
  animation-delay: 0.15s;
}

/* 印章装饰 */
.auth-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid var(--color-primary-light);
  border-radius: 0.25rem;
  margin-bottom: var(--spacing-md);
  position: relative;
  transform: rotate(-3deg);
  overflow: hidden;
}

.auth-seal::before {
  content: '将';
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--color-primary-light);
  text-shadow: 0 0 8px rgba(139, 0, 0, 0.4);
}

.auth-seal::after {
  content: '';
  position: absolute;
  inset: 0.1875rem;
  border: 1px solid rgba(178, 34, 34, 0.4);
  border-radius: 0.125rem;
}

.auth-seal.has-logo::before,
.auth-seal.has-logo::after {
  display: none;
}

.auth-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.25rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--color-gold);
  letter-spacing: 6px;
  text-shadow:
    0 0 20px rgba(218, 165, 32, 0.4),
    0 0 40px rgba(218, 165, 32, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.6);
  margin-bottom: var(--spacing-xs);
  line-height: 1.3;
}

.auth-subtitle {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  letter-spacing: 4px;
  opacity: 0.7;
}

/* 注册页标题 */
.auth-title--sub {
  font-family: var(--font-display);
  font-size: 1.625rem;
  color: var(--color-gold);
  letter-spacing: 4px;
  text-shadow:
    0 0 15px rgba(218, 165, 32, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: var(--spacing-xs);
}

/* ============================================
   分隔线装饰
   ============================================ */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: var(--spacing-lg) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 0.0625rem;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border-light),
    transparent
  );
}

.auth-divider-diamond {
  color: var(--color-gold-dark);
  font-size: 0.5rem;
  opacity: 0.6;
}

/* ============================================
   表单样式
   ============================================ */
.auth-form {
  animation: authFormEnter 0.6s ease-out both;
  animation-delay: 0.3s;
}

.auth-field {
  margin-bottom: var(--spacing-md);
  position: relative;
}

.auth-field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-dim);
  margin-bottom: 0.375rem;
  letter-spacing: 1px;
}

.auth-input {
  width: 100%;
  padding: 0.75rem var(--spacing-md);
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
  outline: none;
}

.auth-input:focus {
  border-color: var(--color-gold);
  box-shadow:
    0 0 0 3px rgba(218, 165, 32, 0.12),
    0 0 12px rgba(218, 165, 32, 0.08);
  background: rgba(37, 24, 24, 0.9);
}

.auth-input::placeholder {
  color: var(--color-text-dim);
  opacity: 0.5;
  font-size: 0.875rem;
}

.auth-select {
  appearance: none;
  cursor: pointer;
  padding-right: 2.5rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--color-gold) 50%),
    linear-gradient(135deg, var(--color-gold) 50%, transparent 50%);
  background-position:
    calc(100% - 1.1rem) 50%,
    calc(100% - 0.75rem) 50%;
  background-size: 0.375rem 0.375rem, 0.375rem 0.375rem;
  background-repeat: no-repeat;
}

.auth-server-field {
  margin-bottom: var(--spacing-lg);
}

.auth-server-desc {
  min-height: 1rem;
  margin-top: 0.375rem;
  color: var(--color-text-dim);
  font-size: 0.6875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 输入框验证状态 */
.auth-input--error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
}

.auth-field-error {
  font-size: 0.6875rem;
  color: var(--color-danger);
  margin-top: 0.25rem;
  min-height: 1rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.auth-field-error.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   提交按钮
   ============================================ */
.auth-submit {
  width: 100%;
  padding: 0.875rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 6px;
  color: var(--color-gold-light);
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-primary-light) 50%,
    var(--color-primary) 100%
  );
  background-size: 200% 100%;
  border: 1px solid var(--color-gold-dark);
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow:
    0 4px 12px rgba(139, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-submit:hover {
  background-position: 100% 0;
  border-color: var(--color-gold);
  box-shadow:
    0 6px 20px rgba(139, 0, 0, 0.4),
    var(--shadow-glow-gold),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 2px 8px rgba(139, 0, 0, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 按钮流光效果 */
.auth-submit::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 215, 0, 0.08),
    transparent
  );
  transition: left 0.6s ease;
}

.auth-submit:hover::after {
  left: 120%;
}

/* ============================================
   底部链接
   ============================================ */
.auth-footer {
  text-align: center;
  margin-top: var(--spacing-lg);
  animation: authFormEnter 0.6s ease-out both;
  animation-delay: 0.45s;
}

.auth-footer-text {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}

.auth-footer-link {
  color: var(--color-gold);
  cursor: pointer;
  font-weight: 600;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: none;
}

.auth-footer-link:hover {
  color: var(--color-gold-light);
  text-shadow: 0 0 8px rgba(218, 165, 32, 0.4);
}

/* ============================================
   动画关键帧
   ============================================ */
@keyframes authCardEnter {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes authHeaderEnter {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authFormEnter {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sealStamp {
  0% {
    opacity: 0;
    transform: rotate(-3deg) scale(1.8);
  }
  60% {
    opacity: 1;
    transform: rotate(-3deg) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: rotate(-3deg) scale(1);
  }
}

/* ============================================
   印章入场动画
   ============================================ */
.auth-seal {
  animation: sealStamp 0.5s ease-out both;
  animation-delay: 0.3s;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 420px) {
  .auth-card {
    padding: var(--spacing-lg) var(--spacing-md);
    border-radius: var(--radius-lg);
  }

  .auth-title {
    font-size: 1.875rem;
    letter-spacing: 4px;
  }

  .auth-title--sub {
    font-size: 1.375rem;
  }

  .auth-submit {
    font-size: 1rem;
    letter-spacing: 4px;
  }
}

/* ============================================
   减少动画 (无障碍)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-header,
  .auth-form,
  .auth-footer,
  .auth-seal {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .auth-seal {
    transform: rotate(-3deg);
  }
}
