/* ===== 性能优化的透明表单样式 ===== */
body {
  background: 
    url('../images/mygo X avemujica.jpg') center/cover no-repeat fixed,
    linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3));
  min-height: 100vh;
  margin: 0;
  font-family: 'Arial', 'Microsoft YaHei', sans-serif;
  /* 优化渲染性能 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--font-size-base);
  /* 优化背景渲染 */
  background-attachment: fixed;
  backface-visibility: hidden;
}

/* 页面样式 */
.page {
  width: min(92%, 700px);
  max-width: 650px;
  animation: fadeIn 0.4s ease-out;
  margin: clamp(2rem, 6vw, 3.5rem) auto;
  /* 启用硬件加速 */
  transform: translateZ(0);
  padding: 0 var(--element-spacing);
  will-change: opacity;
}

/* 性能优化的表单容器 */
.form-container {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: clamp(0.75rem, 2vw, 1.25rem);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
  position: relative;
  transition: box-shadow 0.2s ease;
  /* 启用硬件加速 */
  transform: translateZ(0);
  will-change: transform, box-shadow;
  /* 优化合成层 */
  isolation: isolate;
}

.form-container:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* 标题样式 */
h2 {
  color: #fff;
  text-align: center;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.5vw, 1.875rem);
  position: relative;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  line-height: 1.3;
  will-change: transform;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(3rem, 6vw, 4rem);
  height: 0.25rem;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
  border-radius: 0.125rem;
  will-change: transform;
}

/* 表单组样式 */
.form-group {
  margin-bottom: clamp(1rem, 2vw, 1.25rem);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

/* 性能优化的输入框 */
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: clamp(0.75rem, 1.8vw, 0.9rem) clamp(0.875rem, 1.8vw, 1rem);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--border-radius);
  font-size: clamp(0.875rem, 1.8vw, 1rem);
  transition: all 0.15s ease;
  color: #fff;
  /* 优化渲染 */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transform: translateZ(0);
  will-change: transform, background, border;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
  outline: none;
}

/* 自定义复选框样式 */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.95);
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: clamp(1rem, 2vw, 1.125rem);
  height: clamp(1rem, 2vw, 1.125rem);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.25rem;
  margin-right: clamp(0.5rem, 1vw, 0.75rem);
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
  margin-top: 0.125rem;
  will-change: background, border;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: rgba(106, 17, 203, 0.8);
  border-color: rgba(106, 17, 203, 0.9);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 30%;
  top: 10%;
  width: 0.35rem;
  height: 0.6rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 链接样式 */
.form-container a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  transition: color 0.15s ease;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

.form-container a:hover {
  color: white;
}

/* 表单操作区域 */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.5vw, 1rem);
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
}

/* 性能优化的按钮 */
.btn {
  padding: clamp(0.75rem, 1.8vw, 0.9rem);
  border: none;
  border-radius: var(--border-radius);
  font-size: clamp(0.875rem, 1.8vw, 1rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  /* 启用硬件加速 */
  transform: translateZ(0);
  will-change: transform, box-shadow;
}

.btn-login {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  box-shadow: 0 3px 12px rgba(106, 17, 203, 0.3);
}

.btn-login:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

.btn-register {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-register:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-0.125rem);
}

.forgot-password {
  text-align: center;
  margin-top: clamp(1rem, 2vw, 1.25rem);
}

.forgot-password a {
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
}

/* 表单验证样式 */
input.valid {
  border-color: rgba(39, 174, 96, 0.6) !important;
}

input.invalid {
  border-color: rgba(231, 76, 60, 0.6) !important;
}

.error-message {
  color: #ff6b6b;
  font-size: clamp(0.7rem, 1.2vw, 0.75rem);
  margin-top: 0.25rem;
  display: none;
}

.error-message.show {
  display: block;
}

/* 密码强度检测样式 */
.password-strength {
  margin-top: 0.5rem;
}

.strength-bar {
  height: 0.25rem;
  border-radius: 0.125rem;
  transition: width 0.3s ease;
  width: 0%;
  will-change: width;
}

.strength-bar.weak {
  background-color: #e74c3c;
  width: 33%;
}

.strength-bar.medium {
  background-color: #f39c12;
  width: 66%;
}

.strength-bar.strong {
  background-color: #27ae60;
  width: 100%;
}

.strength-text {
  font-size: clamp(0.7rem, 1.2vw, 0.75rem);
  margin-top: 0.25rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: clamp(0.6rem, 1.2vw, 0.75rem);
  height: clamp(0.6rem, 1.2vw, 0.75rem);
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
  will-change: transform;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 忘记密码页面样式 */
.verification-code-group {
  display: flex;
  gap: clamp(0.5rem, 1vw, 0.75rem);
}

.verification-code-group input {
  flex: 1;
}

.btn-send-code {
  padding: clamp(0.75rem, 1.8vw, 0.9rem) clamp(1rem, 2vw, 1.25rem);
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-width: clamp(5rem, 10vw, 7rem);
  transform: translateZ(0);
  will-change: transform;
}

.btn-send-code:hover:not(:disabled) {
  transform: translateY(-0.125rem);
  box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
}

.btn-send-code:disabled {
  background: rgba(204, 204, 204, 0.6);
  cursor: not-allowed;
  transform: none;
}

.btn-reset {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  box-shadow: 0 3px 12px rgba(106, 17, 203, 0.3);
}

.btn-reset:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

.btn-back {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-0.125rem);
}

/* 倒计时样式 */
.countdown {
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.7rem, 1.2vw, 0.8rem);
}

/* 成功消息样式 */
.success-message {
  text-align: center;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: rgba(39, 174, 96, 0.2);
  border: 1px solid rgba(39, 174, 96, 0.3);
  border-radius: var(--border-radius);
  margin-bottom: clamp(1rem, 2vw, 1.25rem);
  color: white;
}

.success-icon {
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: rgba(39, 174, 96, 0.9);
  margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
}

.success-message h3 {
  color: rgba(39, 174, 96, 0.95);
  margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
}

.success-message p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
  font-size: clamp(0.85rem, 1.7vw, 1rem);
}

/* 社交登录样式 */
.social-login {
  margin: clamp(1rem, 2vw, 1.25rem) 0;
  text-align: center;
}

.social-login p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
  position: relative;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

.social-login p::before,
.social-login p::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 25%;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.social-login p::before {
  left: 0;
}

.social-login p::after {
  right: 0;
}

.social-buttons {
  display: flex;
  gap: clamp(0.5rem, 1vw, 0.75rem);
  justify-content: center;
}

.social-btn {
  flex: 1;
  padding: clamp(0.6rem, 1.5vw, 0.8rem);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.375rem, 0.8vw, 0.5rem);
  color: white;
  transform: translateZ(0);
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  will-change: transform, background;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-0.125rem);
}

/* 响应式设计优化 */
@media (max-width: 1024px) {
  .page {
    margin: clamp(1.5rem, 4vw, 2.5rem) auto;
    padding: 0 clamp(0.75rem, 2vw, 1rem);
  }
  
  .form-container {
    padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1rem, 2.5vw, 1.5rem);
  }
  
  .social-buttons,
  .verification-code-group {
    flex-direction: column;
  }
  
  .btn-send-code {
    min-width: auto;
  }
}

@media (max-width: 768px) {
  .page {
    margin: clamp(1rem, 3vw, 2rem) auto;
  }
  
  .form-container {
    padding: clamp(1rem, 2.5vw, 1.5rem) clamp(0.875rem, 2vw, 1.25rem);
  }
  
  h2 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
  }
  
  .form-actions {
    gap: 0.75rem;
  }
}

/* 高分辨率优化 */
@media (min-width: 1920px) {
  .page {
    max-width: 700px;
  }
  
  .form-container {
    padding: 3rem 2.5rem;
  }
  
  h2 {
    font-size: 2.25rem;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"] {
    padding: 1rem 1.125rem;
    font-size: 1.125rem;
  }
  
  .btn {
    padding: 1rem;
    font-size: 1.125rem;
  }
}

/* 缩放优化 */
@media (max-width: 1200px) and (min-width: 769px) {
  .page {
    max-width: min(85%, 600px);
  }
  
  .form-container {
    padding: 2rem 1.75rem;
  }
}

/* 极窄窗口优化 */
@media (max-width: 400px) {
  .page {
    padding: 0 0.75rem;
  }
  
  .form-container {
    padding: 1.25rem 1rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"] {
    padding: 0.675rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* 禁用动画的用户偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .page {
    animation: none;
  }
}