/* ===== Login Modal ===== */
.login-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; transition: opacity 0.25s;
}
.login-overlay.show { display: flex; opacity: 1; }

.login-modal {
  background: white; border-radius: 20px; width: 100%; max-width: 420px;
  padding: 40px 36px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.login-modal .close-btn {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border: none; background: var(--s100); border-radius: 50%; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--s500); transition: all 0.2s;
}
.login-modal .close-btn:hover { background: var(--s200); color: var(--s700); }

.login-modal h2 { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 4px; color: var(--s900); }
.login-modal .subtitle { font-size: 13px; color: var(--s400); text-align: center; margin-bottom: 28px; }

/* WeChat Login Button */
.wechat-login-btn {
  width: 100%; padding: 14px; border: none; border-radius: 12px; font-size: 15px;
  font-weight: 600; cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 10px; transition: all 0.2s; margin-bottom: 16px;
  background: #07c160; color: white;
}
.wechat-login-btn:hover { background: #06ad56; transform: translateY(-1px); }
.wechat-login-btn .wechat-icon { font-size: 20px; }

/* Divider */
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--s400); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--s200); }

/* Form Fields */
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 13px; font-weight: 500; color: var(--s700); margin-bottom: 6px; }
.login-field input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--s200); border-radius: 10px;
  font-size: 15px; transition: border 0.2s; outline: none; font-family: inherit;
}
.login-field input:focus { border-color: var(--g500); box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }
.login-field .error-msg { font-size: 12px; color: var(--r500); margin-top: 4px; display: none; }
.login-field .error-msg.show { display: block; }

.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.send-code-btn {
  padding: 12px 16px; background: var(--g50); color: var(--g600);
  border: 1.5px solid var(--g200); border-radius: 10px; font-size: 13px;
  font-weight: 500; white-space: nowrap; cursor: pointer; transition: all 0.2s;
  min-width: 120px; font-family: inherit;
}
.send-code-btn:hover { background: var(--g100); }
.send-code-btn:disabled { color: var(--s400); background: var(--s100); border-color: var(--s200); cursor: not-allowed; }

.submit-login-btn {
  width: 100%; padding: 14px; background: var(--g500); color: white;
  border: none; border-radius: 12px; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; margin-top: 8px; font-family: inherit;
}
.submit-login-btn:hover { background: var(--g600); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(34,197,94,0.25); }
.submit-login-btn:disabled { background: var(--s300); cursor: not-allowed; transform: none; box-shadow: none; }

.login-error { font-size: 12px; color: var(--r500); text-align: center; margin-top: 12px; display: none; }
.login-error.show { display: block; }

.login-tos { font-size: 11px; color: var(--s400); text-align: center; margin-top: 20px; line-height: 1.6; }
.login-tos a { color: var(--g600); text-decoration: none; }
.login-tos a:hover { text-decoration: underline; }

/* Logged in state */
.login-modal .logged-in { text-align: center; padding: 20px 0; }
.login-modal .logged-in .avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--g100);
  display: inline-flex; align-items: center; justify-content: center; font-size: 32px;
  margin-bottom: 12px;
}
.login-modal .logged-in .username { font-size: 18px; font-weight: 600; color: var(--s900); margin-bottom: 4px; }
.login-modal .logged-in .phone { font-size: 13px; color: var(--s400); margin-bottom: 20px; }
.login-modal .logged-in .logout-btn {
  padding: 10px 24px; background: var(--s100); color: var(--s600);
  border: none; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.login-modal .logged-in .logout-btn:hover { background: var(--s200); }

/* Responsive */
@media (max-width: 480px) {
  .login-modal { padding: 32px 24px; margin: 16px; border-radius: 16px; }
}
