/* 错题小管家 - 登录页样式 (基于 Pencil 设计) */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2BB6A3;
  --primary-light: #E8F7F5;
  --surface: #FFFFFF;
  --background: #FAFAFA;
  --text-primary: #1D1D1F;
  --text-secondary: #86868B;
  --text-tertiary: #AEAEB2;
  --border: #E5E5EA;
  --border-light: #F2F2F7;
  --error: #FF3B30;
  --success: #34C759;
  --wechat: #07C160;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.login-container {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 40px 32px 40px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: fadeInUp 0.4s ease-out;
}

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

/* Header */
.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo i {
  width: 28px;
  height: 28px;
  color: white;
}

.login-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.error-message {
  background: #FEE2E2;
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: none;
  animation: shake 0.3s ease;
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color 0.2s;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 48px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input:hover {
  border-color: #C7C7CC;
}

.form-input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(43, 182, 163, 0.1);
}

.form-input:focus ~ .input-icon {
  color: var(--primary);
}

.password-toggle {
  position: absolute;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: color 0.2s;
}

.password-toggle:hover {
  color: var(--text-secondary);
}

.password-toggle i {
  width: 20px;
  height: 20px;
}

/* Form Options */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrapper input {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  position: relative;
  transition: all 0.2s;
}

.checkbox-custom::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s;
}

.checkbox-wrapper input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
  transform: rotate(45deg) scale(1);
}

.checkbox-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.forgot-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.forgot-link:hover {
  opacity: 0.8;
}

/* Login Button */
.btn-login {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-login:hover {
  background: #25a393;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43, 182, 163, 0.3);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-login i {
  width: 20px;
  height: 20px;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.divider-text {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Social Login */
.social-login {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.social-btn {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.social-btn:hover {
  transform: scale(1.05);
}

.social-btn.wechat {
  background: var(--wechat);
  color: white;
  font-size: 18px;
  font-weight: 600;
}

.social-btn.apple {
  background: var(--text-primary);
  color: white;
}

.social-btn.apple i {
  width: 24px;
  height: 24px;
}

/* Footer */
.login-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.terms-text {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

.register-link {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.register-link span {
  color: var(--text-secondary);
}

.register-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.register-link a:hover {
  opacity: 0.8;
}

/* ICP Info */
.icp-info {
  text-align: center;
}

.icp-info a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.icp-info a:hover {
  color: white;
}

/* Responsive */
@media (max-width: 480px) {
  body {
    padding: 16px;
  }

  .login-container {
    padding: 32px 24px 24px 24px;
    border-radius: 20px;
  }

  .login-title {
    font-size: 22px;
  }

  .login-subtitle {
    font-size: 14px;
  }

  .form-input {
    height: 44px;
    font-size: 14px;
  }

  .btn-login {
    height: 48px;
    font-size: 15px;
  }
}
