/* ============================================
   auth.css - 注册/登录页面样式
   ============================================ */

.auth-body {
  background: var(--color-bg);
}

.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* 左侧品牌区 */
.auth-brand {
  background: linear-gradient(135deg, #7C3AED 0%, #2563EB 50%, #F59E0B 100%);
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: white;
  text-decoration: none;
  position: relative;
  z-index: 2;
}

.brand-link .logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.brand-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  position: relative;
  z-index: 2;
}

.brand-content h1 {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.brand-content > p {
  font-size: var(--font-size-lg);
  opacity: 0.9;
  margin-bottom: var(--space-2xl);
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-base);
  font-weight: 500;
}

.brand-feature i {
  font-size: 18px;
  opacity: 0.9;
}

/* 品牌数据 */
.brand-stats {
  display: flex;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.brand-stat {
  text-align: center;
}

.brand-stat-num {
  font-size: var(--font-size-3xl);
  font-weight: 800;
}

.brand-stat-label {
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

.brand-quote {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
}

.brand-quote i {
  font-size: 24px;
  opacity: 0.3;
  margin-bottom: var(--space-sm);
}

.brand-quote p {
  font-size: var(--font-size-base);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: var(--space-sm);
  opacity: 1;
}

.quote-author {
  font-size: var(--font-size-sm);
  opacity: 0.7;
}

/* 装饰圆 */
.brand-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dec-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
}

.dec-1 {
  width: 400px;
  height: 400px;
  background: white;
  top: -100px;
  right: -100px;
}

.dec-2 {
  width: 300px;
  height: 300px;
  background: white;
  bottom: -50px;
  left: -100px;
}

.dec-3 {
  width: 150px;
  height: 150px;
  background: white;
  bottom: 200px;
  right: 100px;
}

/* 右侧表单区 */
.auth-form-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  overflow-y: auto;
}

.auth-form-container {
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header h2 {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--color-dark);
  margin-bottom: var(--space-sm);
}

.auth-header p {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
}

.auth-header a {
  color: var(--color-primary);
  font-weight: 600;
}

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

/* 登录Tab */
.login-tabs {
  display: flex;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-xl);
}

.login-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.login-tab:hover {
  color: var(--color-primary);
}

.login-tab.active {
  background: var(--color-white);
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.auth-form,
.login-form {
  display: none;
}

.auth-form.login-form.active,
.auth-form:not(.login-form) {
  display: block;
}

.login-form[data-login="account"].active,
.login-form[data-login="sms"].active,
.login-form[data-login="qrcode"].active {
  display: block;
}

/* 输入框 */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > i {
  position: absolute;
  left: 14px;
  color: var(--color-text-lighter);
  font-size: 14px;
  z-index: 1;
}

.input-wrap .form-input {
  padding-left: 42px;
  padding-right: 90px;
}

.input-wrap .form-input:not([class*="code-btn"]):not([class*="toggle"]) {
  padding-right: 16px;
}

.code-btn {
  position: absolute;
  right: 8px;
  padding: 6px 12px;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.code-btn:hover {
  opacity: 0.9;
}

.toggle-pwd {
  position: absolute;
  right: 12px;
  color: var(--color-text-lighter);
  cursor: pointer;
  font-size: 14px;
  transition: color var(--transition-fast);
}

.toggle-pwd:hover {
  color: var(--color-primary);
}

/* 密码强度 */
.pwd-strength {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.strength-bars {
  display: flex;
  gap: 4px;
}

.strength-bars .bar {
  width: 60px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  transition: background var(--transition-fast);
}

.strength-bars .bar.active:nth-child(1) { background: var(--color-danger); }
.strength-bars .bar.active:nth-child(2) { background: var(--color-warning); }
.strength-bars .bar.active:nth-child(3) { background: var(--color-success); }

.strength-text {
  font-size: var(--font-size-xs);
  color: var(--color-text-lighter);
}

/* 记住我/忘记密码 */
.form-row-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.forget-link {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  font-weight: 500;
}

/* 分隔符 */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-divider span {
  font-size: var(--font-size-sm);
  color: var(--color-text-lighter);
  white-space: nowrap;
}

/* 第三方登录 */
.social-login {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-white);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.social-btn:hover {
  border-color: var(--color-primary-light);
  background: rgba(124, 58, 237, 0.03);
}

.social-btn.wechat:hover { border-color: #07C160; color: #07C160; }
.social-btn.qq:hover { border-color: #12B7F5; color: #12B7F5; }
.social-btn.weibo:hover { border-color: #E6162D; color: #E6162D; }
.social-btn.alipay:hover { border-color: #1677FF; color: #1677FF; }

/* 验证码框 */
.auth-form:not(.login-form) .input-wrap .form-input {
  padding-right: 16px;
}

/* 扫码登录 */
.qrcode-login {
  text-align: center;
  padding: var(--space-lg) 0;
}

.qrcode-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qrcode-box {
  width: 200px;
  height: 200px;
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.qrcode-pattern {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-cells {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: 100%;
  height: 100%;
}

.qr-cells span {
  background: var(--color-dark);
  border-radius: 2px;
}

.qr-cells span:nth-child(odd) {
  opacity: 0.3;
}

.qr-logo {
  position: absolute;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.qr-tip {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.qr-tip i {
  margin-right: 4px;
}

.qr-refresh a {
  color: var(--color-primary);
  font-size: var(--font-size-sm);
}

.qr-refresh a:hover {
  text-decoration: underline;
}

/* Footer */
.auth-footer {
  margin-top: var(--space-2xl);
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-lighter);
}

.auth-footer a {
  color: var(--color-text-light);
  margin: 0 4px;
}

.auth-footer a:hover {
  color: var(--color-primary);
}

/* 响应式 */
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-form-wrap {
    min-height: 100vh;
    padding: var(--space-lg);
  }
}

@media (max-width: 480px) {
  .social-login {
    grid-template-columns: repeat(2, 1fr);
  }
}
