/* 认证弹窗：登录、注册、找回、改密。视觉对齐原站，暗色主题同步。 */

.auth-mask {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-mask.auth-open {
  display: flex;
}

.auth-dialog {
  background: var(--card);
  border-radius: 20px;
  max-width: 880px;
  width: 100%;
  display: flex;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.login-modal-illustration {
  flex: 1;
  min-width: 280px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.auth-illustration-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(180deg, transparent, #bfdbfe);
}

.auth-illustration-svg {
  position: relative;
  z-index: 1;
}

.login-modal-form {
  flex: 1;
  min-width: 300px;
  padding: 32px 36px;
  position: relative;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
}

.auth-brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.auth-tab {
  flex: 1;
  min-width: 70px;
  padding: 8px 6px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--border);
  color: var(--text-secondary);
}

.auth-tab.auth-tab-active {
  background: var(--gradient);
  color: #fff;
}

.auth-msg {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 14px;
}

.auth-msg.auth-msg-show {
  display: block;
}

.auth-msg.auth-msg-error {
  background: #fef2f2;
  color: #dc2626;
}

.auth-msg.auth-msg-success {
  background: #ecfdf5;
  color: #059669;
}

.auth-pane-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
}

.auth-pane-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.6;
}

.auth-field {
  margin-bottom: 14px;
}

.auth-field-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.auth-field-row .auth-field {
  flex: 1;
  margin-bottom: 0;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.auth-input {
  width: 100%;
  padding: 11px 13px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  background: var(--card);
  color: var(--text);
}

.auth-input:focus {
  border-color: var(--primary);
}

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.auth-remember input {
  accent-color: var(--primary);
}

.auth-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.auth-code-row {
  display: flex;
  gap: 8px;
}

.auth-code-input {
  flex: 1;
}

.auth-code-btn {
  white-space: nowrap;
  padding: 10px 14px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.auth-code-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.auth-pwchk {
  font-size: 12px;
  margin-top: 5px;
  font-weight: 600;
  display: none;
  line-height: 1.4;
}

.auth-pwchk.auth-pwchk-show {
  display: block;
}

.auth-pwchk.pw-ok {
  color: #059669;
}

.auth-pwchk.pw-bad {
  color: #dc2626;
}

.auth-switch {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* 暗色主题：插画与输入框单独处理，避免发灰。 */
html.dark-theme .login-modal-illustration {
  background: linear-gradient(135deg, #1e293b, #172554);
}

html.dark-theme .auth-illustration-bg {
  background: linear-gradient(180deg, transparent, #1e3a8a);
}

html.dark-theme .auth-input {
  border-color: #334155;
}

html.dark-theme .auth-msg.auth-msg-error {
  background: rgba(220, 38, 38, .15);
}

html.dark-theme .auth-msg.auth-msg-success {
  background: rgba(5, 150, 105, .15);
}

/* 窄屏隐藏插画，表单单列。 */
@media (max-width: 720px) {
  .login-modal-illustration {
    display: none;
  }
  .login-modal-form {
    padding: 26px 22px;
  }
  .auth-field-row {
    flex-direction: column;
    gap: 12px;
  }
}
