/* CPS 登录 / 注册共用样式 */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f2f5;
  color: #333;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* ── Page Layout ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px 60px;
}

/* ── Brand Header ── */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  color: #1a3a5c;
  font-size: 18px;
  font-weight: 700;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── Card ── */
.auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 36px 40px 32px;
}

.auth-card h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1a3a5c;
  text-align: center;
}

.auth-subtitle {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin: 6px 0 28px;
}

.auth-hint {
  background: #fefce8;
  border: 1px solid #e2d574;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #666;
  line-height: 1.7;
  margin: -12px 0 24px;
}

.auth-hint a {
  color: #2980b9;
  font-weight: 500;
  text-decoration: none;
}

.auth-hint a:hover {
  text-decoration: underline;
}

/* ── Tabs (login page) ── */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 12px 0;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: #999;
  cursor: pointer;
  text-align: center;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.auth-tab:hover {
  color: #555;
}

.auth-tab.active {
  color: #1a3a5c;
  border-bottom-color: #1a3a5c;
}

/* Tab panels */
.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

/* ── Form Group ── */
.form-group {
  margin-bottom: 18px;
}

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

.form-group label i {
  color: #8899aa;
  margin-right: 4px;
  font-size: 13px;
}

/* ── Inputs & Select ── */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder {
  color: #b0b8c4;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2980b9;
  box-shadow: 0 0 0 2px rgba(41,128,185,0.2);
}

/* ── Phone + Send Code (inline button) ── */
.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
  min-width: 0;
}

.btn-send-code {
  flex-shrink: 0;
  padding: 0 16px;
  font-size: 13px;
  border: 1px solid #1a3a5c;
  border-radius: 6px;
  background: #fff;
  color: #1a3a5c;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-send-code:hover {
  background: #1a3a5c;
  color: #fff;
}

.btn-send-code:disabled {
  border-color: #c8cfd8;
  color: #999;
  background: #f5f7fa;
  cursor: not-allowed;
}

/* ── Validation Error ── */
.field-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  min-height: 0;
}

.field-error:empty {
  display: none;
}

.input-error {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

/* ── Duplicate account warning ── */
.field-warn {
  font-size: 12px;
  color: #b45309;
  margin-top: 4px;
}

.field-warn a {
  color: #2980b9;
  font-weight: 500;
  text-decoration: none;
}

.field-warn a:hover {
  text-decoration: underline;
}

.input-error:focus {
  box-shadow: 0 0 0 2px rgba(239,68,68,0.2) !important;
}

/* ── Form locked (duplicate account) ── */
.form-locked .form-group input,
.form-locked .form-group select,
.form-locked .btn-send-code,
.form-locked .btn-submit {
  opacity: 0.45;
  pointer-events: none;
  background: #f5f7fa !important;
  cursor: not-allowed;
}

.form-locked .form-group label {
  opacity: 0.5;
}

.form-lock-notice {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  color: #991b1b;
  line-height: 1.8;
  margin-bottom: 18px;
  text-align: left;
}

.form-lock-notice a {
  color: #2980b9;
  font-weight: 600;
  text-decoration: none;
}

.form-lock-notice a:hover {
  text-decoration: underline;
}

/* ── Submit Button ── */
.btn-submit {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 28px;
  border: none;
  border-radius: 6px;
  background: #1a3a5c;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: #15304d;
}

.btn-submit:active {
  background: #0f2640;
}

/* ── Footer Link ── */
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #888;
}

.auth-footer a {
  color: #2980b9;
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ══════ Responsive: Mobile (<480px) ══════ */
@media (max-width: 480px) {
  .auth-page {
    padding: 24px 0 40px;
  }

  .auth-brand {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .auth-card {
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 20px;
  }
}
