/**
 * Authentication Pages Styles
 * 认证页面统一样式表
 * 
 * 适用页面：
 * - public/login.php    (用户登录)
 * - public/register.php (用户注册)
 * - public/logout.php   (安全退出)
 * 
 * 配套 JS：
 * - static/app/js/auth-alpine.js (Alpine.js 组件)
 */

/* 1. Alpine.js 辅助 */
[x-cloak] {
  display: none !important;
}

/* 2. 页面基础 */
.login-page-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* 3. 卡片容器 */
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(28, 40, 57, 0.08);
  overflow: hidden;
  border: 1px solid rgba(39, 57, 80, 0.04);
}

.login-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, #6ab1e8 0%, #2c6bc9 100%);
  color: #fff;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.login-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.login-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.login-body {
  padding: 20px 22px 26px;
}

.login-card-footer {
  padding: 0 22px 22px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* 4. 表单元素 */
.form-group {
  margin-bottom: 14px;
}

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

.form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid #d7e0ee;
  background: #fff;
  font-size: 14px;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.form-control:focus {
  outline: none;
  border-color: #6aa0ff;
  box-shadow: 0 0 0 3px rgba(106, 160, 255, 0.12);
}

.form-control:disabled {
  background: #f5f7fa;
  cursor: not-allowed;
}

.btn-login {
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 6px;
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-back-link {
  color: #6b7fa3;
  text-decoration: none;
}

.login-back-link:hover {
  text-decoration: underline;
}

.login-attempts-warning {
  background: #fff8e6;
  border-left: 4px solid #ffd47a;
  padding: 10px 12px;
  border-radius: 4px;
  color: #6a4e00;
  margin-bottom: 12px;
}

.fingerprint-status {
  margin-top: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #6b7fa3;
}

/* 5. 验证码区域 */
#captcha-container {
  margin-top: 8px;
  margin-bottom: 8px;
}

#captcha-container img {
  max-height: 80px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: block;
  cursor: pointer;
}

#captcha-error {
  color: #b45309;
  background: #fff7ed;
  padding: 8px 10px;
  border-radius: 4px;
}

/* 6. 密码强度指示器 */
.password-strength {
  margin-top: 8px;
  margin-bottom: 15px;
}

.strength-meter {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-bar.weak {
  background: #d9534f;
}

.strength-bar.medium {
  background: #f0ad4e;
}

.strength-bar.strong {
  background: #5cb85c;
}

.strength-text {
  font-size: 12px;
  margin-top: 4px;
  color: #5a6b7c;
}

.strength-text.weak {
  color: #d9534f;
}

.strength-text.medium {
  color: #f0ad4e;
}

.strength-text.strong {
  color: #5cb85c;
}

/* 7. 加载遮罩层 */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 30, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.show {
  display: flex;
}

.loading-content {
  background: rgba(255, 255, 255, 0.98);
  padding: 18px 22px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(12, 26, 44, 0.22);
  display: flex;
  gap: 12px;
  align-items: center;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: #2b6ef6;
  animation: auth-spin 0.9s linear infinite;
}

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

/* 8. 成功/结果提示框 */
.success-box {
  text-align: center;
  padding: 16px 18px;
}

.success-box i {
  font-size: 48px;
  display: block;
  margin-bottom: 10px;
}

.success-box i.icon-ok-circle,
.success-box i.icon-check-circle {
  color: #5cb85c;
}

.success-box i.text-primary {
  color: #2c6bc9;
}

.success-box h3 {
  margin: 6px 0;
  font-size: 18px;
  color: #1f2d3d;
}

.success-box p {
  color: #4b5b6b;
  margin: 6px 0 0;
  line-height: 1.5;
}

/* 9. 响应式适配 */
@media (max-width: 480px) {
  .login-card {
    max-width: 96%;
    border-radius: 10px;
  }

  .login-header h2 {
    font-size: 18px;
  }

  .login-body {
    padding: 16px;
  }

  .login-card-footer {
    flex-direction: column;
    padding: 0 16px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .strength-bar,
  .form-control,
  .btn-login {
    transition: none !important;
  }

  .loading-spinner {
    animation: none !important;
  }
}

/* 10. 无障碍辅助 & 工具类 */
:focus-visible {
  outline: 3px solid rgba(39, 110, 255, 0.18);
  outline-offset: 2px;
}
