/**
 * V2 Login Styles
 * 大背景 + 左侧信息直接写背景上 + 右侧白卡登录
 * Tab: 下划线式  |  按钮: 方正扁平
 */

/* ===== 容器 ===== */

.v2-login-container {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F0F2F8;
  padding: 40px 48px;
}

/* ===== 居中内容组 ===== */

.v2-login-center-group {
  display: flex;
  align-items: center;
  gap: 120px;
}

/* ===== 左侧信息（直接写在背景上） ===== */

.v2-login-info {
  width: 340px;
  flex-shrink: 0;
}

.v2-login-info-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.v2-login-info-logo .v2-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.v2-login-info-logo .v2-logo-name {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.3px;
}

.v2-login-info-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  color: #111827;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
}

.v2-login-info-tagline {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: #4F46E5;
  margin-bottom: 12px;
}

.v2-login-info-desc {
  font-size: 14px;
  line-height: 1.7;
  color: #6B7280;
  margin-bottom: 28px;
}

.v2-login-info-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v2-login-info-opt {
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  font-weight: 500;
}

.v2-login-info-trust {
  font-size: 12px;
  color: #6B7280;
  margin-top: 18px;
}

/* ===== 右侧白卡 ===== */

.v2-login-card {
  width: 380px;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 36px 32px 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
  flex-shrink: 0;
  transition: height 0.25s ease;
}

/* Tab 使用 segment-control 风格（index.html 内联样式），此处不覆盖 */

/* 卡片头部 */
.v2-card-header {
  margin-bottom: 20px;
}

.v2-card-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.v2-card-header p {
  font-size: 14px;
  color: #6B7280;
}

/* 表单组 */
.v2-form-group {
  margin-bottom: 18px;
}

.v2-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

/* 输入框 */
.v2-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: #FFFFFF;
  color: #111827;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.v2-input::placeholder {
  color: #9CA3AF;
}

.v2-input:focus {
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* 记住设备 */
.v2-remember-row {
  margin-bottom: 20px;
}

.v2-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #6B7280;
  user-select: none;
}

.v2-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #4F46E5;
  cursor: pointer;
}

/* ===== 验证码 ===== */

.v2-captcha-row {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.v2-captcha-image-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.v2-captcha-svg {
  flex-shrink: 0;
  line-height: 0;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: #f0f2f8;
  overflow: hidden;
}

.v2-captcha-svg svg {
  display: block;
}

.v2-captcha-refresh {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: #6B7280;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.v2-captcha-refresh:hover {
  border-color: #4F46E5;
  color: #4F46E5;
  background: #EEF2FF;
}

.v2-captcha-refresh:active {
  transform: rotate(45deg);
}

/* 登录按钮 — 方正扁平 */
.v2-btn-primary {
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  background: #4F46E5;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
  letter-spacing: 0.5px;
}

.v2-btn-primary:hover {
  background: #4338CA;
}

.v2-btn-primary:active {
  background: #3730A3;
  transform: none;
}

.v2-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 错误提示 */
.v2-form-error {
  margin-top: 12px;
  font-size: 13px;
  color: #EF4444;
  display: none;
}

.v2-form-error.show {
  display: block;
}

/* 卡片底部版权 */

/* ===== 手机端 ===== */

.v2-login-mobile-top {
  display: none;
}

@media (max-width: 767px) {
  .v2-login-container {
    min-height: auto;
    flex-direction: column;
    padding: 0;
    background: #FFFFFF;
  }

  /* 手机顶部横幅 */
  .v2-login-mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 20px 20px 16px;
    background: #F0F2F8;
  }

  .v2-login-mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .v2-login-mobile-logo .v2-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .v2-login-mobile-logo .v2-logo-icon svg {
    width: 20px;
    height: 20px;
  }

  .v2-login-mobile-logo .v2-logo-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
  }

  .v2-login-mobile-text {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    text-align: right;
    flex: 1;
  }

  /* 桌面端信息区隐藏 */
  .v2-login-info {
    display: none;
  }

  /* 白卡全宽 */
  .v2-login-center-group {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .v2-login-card {
    width: 100%;
    max-width: 440px;
    border-radius: 0;
    box-shadow: none;
    padding: 28px 20px 32px;
    background: #FFFFFF;
    margin: 0 auto;
  }
}

@media (max-width: 380px) {
  .v2-login-mobile-top {
    padding: 16px 16px 12px;
  }

  .v2-login-mobile-logo .v2-logo-name {
    font-size: 14px;
  }

  .v2-login-mobile-text {
    font-size: 11px;
  }

  .v2-login-card {
    padding: 24px 16px 28px;
  }
}

/* ===== 二维码区域（左侧信息区底部） ===== */

.v2-login-social-divider {
  width: 100%;
  height: 1px;
  background: #E5E7EB;
  margin: 28px 0 20px;
}

.v2-login-social-row {
  display: flex;
  gap: 12px;
}

.v2-login-social-item {
  position: relative;
}

.v2-login-social-link {
  font-size: 12px;
  color: #6B7280;
  cursor: pointer;
  transition: color 0.15s;
}

.v2-login-social-link.wechat:hover { color: #07C160; }
.v2-login-social-link.taobao:hover { color: #FF6A00; }
.v2-login-social-link.qq:hover { color: #12B7F5; }

.v2-login-social-sep {
  font-size: 12px;
  color: #D1D5DB;
  user-select: none;
}

/* 二维码弹出卡片（动画 + 移动端兼容） */
.v2-login-social-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #FFFFFF;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* 桌面端 hover + 公共 open 状态 */
@media (hover: hover) {
  .v2-login-social-item:hover .v2-login-social-popup {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
  }
}

/* 移动端：JS 切换 .open */
.v2-login-social-item.open .v2-login-social-popup {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.v2-login-social-popup img {
  display: block;
  border-radius: 4px;
}

.v2-login-social-popup-label {
  font-size: 11px;
  color: #6B7280;
  white-space: nowrap;
}

/* ===== 页面底部版权 ===== */

.v2-login-page-footer {
  text-align: center;
  padding: 20px 20px 28px;
  font-size: 12px;
  color: #6B7280;
  background: #F0F2F8;
}

/* ===== 手机端隐藏二维码和分割线 ===== */

@media (max-width: 767px) {
  .v2-login-social-divider,
  .v2-login-social-row {
    display: none;
  }

  .v2-login-page-footer {
    background: #FFFFFF;
    padding: 16px 20px 24px;
  }
}
