/* ========== AutoDetail 统一登录样式管理 ========== */
/* 文件: ad-unified-login.css */
/* 用途: 统一管理所有登录方式的样式，符合AutoDetail主题风格 */

/* ========== 基础布局 ========== */
.ad-login-bg {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  min-height: 100vh;
  margin-top: -50px;
  margin-bottom: -50px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* 突破父容器限制 */
.main-contain .container #content .ad-login-bg,
#content .ad-login-bg,
.container .ad-login-bg {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

.ad-login-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.ad-login-bg::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 105, 0, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
  z-index: 0;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


.ad-login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
  width: 450px !important;
  max-width: 450px !important;
  min-width: 450px !important;
  padding: 48px 40px;
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideUp 0.6s ease-out;
  box-sizing: border-box !important;
  margin: 0 auto !important;
  flex: none !important;
  float: none !important;
}

/* 强制覆盖所有子元素的宽度设置 */
.ad-login-card * {
  box-sizing: border-box !important;
}

.ad-login-card .col2-set,
.ad-login-card .col-1,
.ad-login-card .col-2,
.ad-login-card form,
.ad-login-card .woocommerce-form-login,
.ad-login-card .woocommerce-form-register {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 特别针对WooCommerce默认布局的覆盖 */
.woocommerce-account .ad-login-card,
.woocommerce .ad-login-card {
  display: block !important;
  width: 450px !important;
  max-width: 450px !important;
}

.ad-login-bg .woocommerce .col2-set {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.ad-login-bg .woocommerce .col2-set .col-1,
.ad-login-bg .woocommerce .col2-set .col-2 {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

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

/* ========== 登录头部 ========== */
.ad-login-header {
  text-align: center;
  margin-bottom: 32px;
}


.ad-login-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.ad-login-subtitle {
  font-size: 16px;
  color: #666;
  margin: 0;
  font-weight: 400;
}

/* ========== 选项卡样式 ========== */
.ad-login-tabs {
  display: flex;
  margin-bottom: 32px;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 4px;
  position: relative;
}

.ad-tab-btn {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  font-weight: 600;
  color: #666;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  border-radius: 8px;
  position: relative;
  z-index: 2;
}

.ad-tab-btn.active {
  color: #ff6900;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 105, 0, 0.15);
}

.ad-tab-btn:hover:not(.active) {
  color: #ff6900;
  background: rgba(255, 255, 255, 0.5);
}

/* ========== 登录方式切换 ========== */
.ad-login-methods {
  display: flex;
  margin-bottom: 24px;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.ad-login-method-btn {
  flex: 1;
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.ad-login-method-btn.active {
  background: #ffffff;
  color: #ff6900;
  box-shadow: 0 2px 8px rgba(255, 105, 0, 0.15);
}

.ad-login-method-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
  color: #333;
}

/* ========== 表单元素 ========== */
.ad-form-group {
  margin-bottom: 24px;
  position: relative;
}

.ad-form-group input {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  font-size: 15px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  font-weight: 400;
  position: relative;
}

.ad-form-group input::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 105, 0, 0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 12px;
}

.ad-form-group input:focus {
  border-color: #ff6900;
  box-shadow: 0 0 0 4px rgba(255, 105, 0, 0.1);
  transform: translateY(-1px);
}

.ad-form-group input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.ad-form-group input:hover:not(:focus) {
  border-color: #d1d5db;
}

.ad-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

/* 表单行样式 */
.ad-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
}

.ad-form-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0;
}

.ad-form-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ff6900;
}

.ad-link {
  color: #ff6900;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.ad-link:hover {
  color: #e05a00;
  text-decoration: underline;
}

/* ========== 短信登录样式 ========== */
.ad-sms-login-form {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.ad-phone-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ad-phone-group input {
  flex: 1;
}

.ad-send-code-btn {
  min-width: 120px;
  height: 52px;
  padding: 0 20px;
  background: linear-gradient(135deg, #ff671d, #e55a1a);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 103, 29, 0.3);
}

.ad-send-code-btn:hover {
  background: linear-gradient(135deg, #e55a1a, #cc4a0a);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 103, 29, 0.4);
}

.ad-send-code-btn.disabled {
  background: #e9ecef;
  cursor: not-allowed;
  color: #6c757d;
  transform: none;
  box-shadow: none;
}

/* ========== 微信登录样式 ========== */
.ad-wechat-login-section {
  margin-top: 24px;
  text-align: center;
}

.ad-wechat-qr-container {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-wechat-qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.ad-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #07c160;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ad-wechat-qr-loading p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

.ad-wechat-qr-content {
  width: 100%;
  max-width: 280px;
}

.ad-wechat-qr-code {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ad-wechat-qr-code img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}

.ad-wechat-qr-tip {
  color: #333;
  font-size: 14px;
  margin: 0 0 16px;
  font-weight: 500;
}

.ad-wechat-qr-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ad-status-text {
  color: #666;
  font-size: 13px;
}

.ad-refresh-qr-btn {
  background: #07c160;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ad-refresh-qr-btn:hover {
  background: #06ad56;
  transform: translateY(-1px);
}

.ad-wechat-qr-error {
  text-align: center;
  color: #dc3545;
}

.ad-wechat-qr-error p {
  margin: 0 0 12px;
  font-size: 14px;
}

.ad-retry-qr-btn {
  background: #dc3545;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ad-retry-qr-btn:hover {
  background: #c82333;
  transform: translateY(-1px);
}

/* 二维码扫描状态样式 */
.ad-wechat-qr-code.scanning {
  border-color: #07c160;
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.ad-wechat-qr-code.scanning::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(7, 193, 96, 0.1) 50%, transparent 70%);
  animation: scanning 2s linear infinite;
}

@keyframes scanning {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ========== 通用按钮样式 ========== */
.ad-btn-primary {
  width: 100%;
  height: 52px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #ff6900, #e05a00);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(255, 105, 0, 0.25);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ad-btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.ad-btn-primary:hover::before {
  left: 100%;
}

.ad-btn-primary:hover {
  background: linear-gradient(135deg, #e05a00, #cc4a00);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 105, 0, 0.35);
}

.ad-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(255, 105, 0, 0.3);
}

/* ========== 表单显示控制 ========== */
.ad-form {
  display: none;
  animation: fadeIn 0.3s ease;
}

.ad-form.active {
  display: block;
}

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

/* ========== 微信绑定手机号样式 ========== */
.ad-phone-binding-form {
  text-align: center;
}

.ad-phone-binding-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.ad-user-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #ff6900;
  box-shadow: 0 4px 12px rgba(255, 105, 0, 0.2);
}

.ad-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-user-info h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.ad-binding-tip {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.ad-phone-binding-content {
  margin-bottom: 24px;
}

.ad-phone-code-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ad-phone-code-group input {
  flex: 1;
}

.ad-skip-binding-btn {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  background: transparent;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ad-skip-binding-btn:hover {
  border-color: #ff6900;
  color: #ff6900;
}

.ad-security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 105, 0, 0.05);
  border-radius: 12px;
  margin-top: 24px;
}

.ad-security-icon {
  font-size: 16px;
}

.ad-security-notice p {
  margin: 0;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

/* 绑定表单显示/隐藏动画 */
.ad-phone-binding-form {
  animation: fadeInUp 0.4s ease-out;
}

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

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  .ad-login-bg {
    padding: 20px;
  }
  
  body.has-login-form .ad-login-bg {
    padding: 20px;
  }
  
  .ad-login-card {
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px;
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .ad-login-bg {
    padding: 16px;
  }
  
  body.has-login-form .ad-login-bg {
    padding: 16px;
  }
  
  .ad-login-card {
    width: 280px !important;
    max-width: 280px !important;
    min-width: 280px;
    padding: 24px 18px;
    margin: 0;
    border-radius: 16px;
  }
  
  .ad-login-methods {
    flex-direction: column;
    gap: 2px;
  }
  
  .ad-login-method-btn {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .ad-form-group input {
    height: 48px;
    padding: 0 16px;
    font-size: 14px;
  }
  
  .ad-btn-primary {
    height: 48px;
    font-size: 15px;
  }
  
  .ad-phone-group {
    flex-direction: column;
    gap: 12px;
  }
  
  .ad-send-code-btn {
    width: 100%;
    height: 48px;
  }
  
  .ad-tab-btn {
    padding: 12px 0;
    font-size: 15px;
  }
  
  .ad-phone-code-group {
    flex-direction: column;
    gap: 12px;
  }
  
  .ad-send-code-btn {
    width: 100%;
    min-width: auto;
  }
  
  .ad-user-avatar {
    width: 70px;
    height: 70px;
  }
  
  .ad-user-info h3 {
    font-size: 18px;
  }
  
  .ad-form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
  }
  
  .ad-form-row label {
    margin-bottom: 4px;
  }
  
  .ad-wechat-qr-container {
    padding: 16px;
    min-height: 250px;
  }
  
  .ad-wechat-qr-code {
    width: 160px;
    height: 160px;
  }
  
  .ad-wechat-qr-tip {
    font-size: 13px;
  }
}

/* ========== 深色模式支持 ========== */
@media (prefers-color-scheme: dark) {
  .ad-login-bg {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  }
  
  .ad-login-card {
    background: rgba(30, 30, 30, 0.95);
    border-color: #404040;
  }
  
  .ad-login-title {
    color: #ffffff;
  }
  
  .ad-login-subtitle {
    color: #cccccc;
  }
  
  .ad-form-group input {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #404040;
  }
  
  .ad-form-group input:focus {
    border-color: #ff6900;
    background: #2a2a2a;
  }
  
  .ad-form-group label {
    color: #ffffff;
  }
  
  .ad-login-methods {
    background: #2a2a2a;
  }
  
  .ad-login-method-btn.active {
    background: #404040;
  }
  
  .ad-sms-login-form {
    background: #2a2a2a;
  }
  
  .ad-wechat-qr-container {
    background: #2a2a2a;
  }
  
  .ad-wechat-qr-code {
    background: #404040;
    border-color: #555555;
  }
  
  .ad-wechat-qr-tip {
    color: #ffffff;
  }
  
  .ad-status-text {
    color: #cccccc;
  }
}
