/* ===== Auth Modal (BC.GAME 登录/注册) ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.auth-overlay.open {
  opacity: 1;
  visibility: visible;
}
body.auth-modal-open { overflow: hidden; }

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 432px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #292d2e;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 0 24px 28px;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-overlay.open .auth-modal {
  transform: scale(1) translateY(0);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #8b949e;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.auth-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Tabs */
.auth-tabs {
  display: flex;
  margin: 0 -24px 20px;
  padding: 0 24px;
  border-bottom: 1px solid #3a3e3f;
}
.auth-tab {
  flex: 1;
  padding: 18px 8px 14px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #8b949e;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.auth-tab:hover { color: #b3b8c1; }
.auth-tab.active { color: #fff; }
.auth-tab.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent-green);
}

/* Panels */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* Login method toggle */
.auth-method-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: #1e2121;
  border-radius: 10px;
}
.auth-method {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #8b949e;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.auth-method svg { flex-shrink: 0; opacity: 0.75; }
.auth-method.active {
  background: #3a3e3f;
  color: #fff;
}
.auth-method.active svg { opacity: 1; }

/* Form */
.auth-form { display: block; }
.auth-form.is-hidden { display: none; }

.auth-field { margin-bottom: 14px; }
.auth-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #b3b8c1;
}
.auth-req { color: #ff6b6b; margin-left: 2px; }

.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #3a3e3f;
  border-radius: 10px;
  background: #1e2121;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input::placeholder { color: #6b7280; }
.auth-input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 1px var(--accent-green);
}
.auth-input-wrap .auth-input { padding-right: 44px; }

.auth-eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #8b949e;
  cursor: pointer;
  transition: color 0.2s;
}
.auth-eye:hover { color: #fff; }

.auth-forgot {
  display: block;
  margin: -4px 0 18px;
  text-align: right;
  font-size: 13px;
  color: #8b949e;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-forgot:hover { color: var(--accent-green); }

.auth-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent-green);
  color: #000;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.auth-submit:hover {
  background: var(--accent-green-hover);
  transform: translateY(-1px);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: #6b7280;
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #3a3e3f;
}

/* Login alt buttons */
.auth-alt-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.auth-alt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: #323738;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.auth-alt-btn:hover { background: #3a3e3f; }
.auth-alt-btn img,
.auth-alt-btn svg { flex-shrink: 0; }

/* Social row (login) */
.auth-social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.auth-social-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #323738;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.auth-social-btn:hover {
  background: #3a3e3f;
  transform: translateY(-2px);
}
.auth-social-btn img { width: 22px; height: 22px; object-fit: contain; }

/* Register: referral code */
.auth-refcode { margin-bottom: 14px; }
.auth-refcode-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #3a3e3f;
  border-radius: 10px;
  background: #1e2121;
  color: #8b949e;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s;
}
.auth-refcode-toggle:hover { border-color: #4a4e4f; }
.auth-refcode-toggle svg {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.auth-refcode.open .auth-refcode-toggle svg { transform: rotate(180deg); }
.auth-refcode-input {
  display: none;
  margin-top: 10px;
}
.auth-refcode.open .auth-refcode-input { display: block; }

/* Register: checkbox */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.45;
  color: #b3b8c1;
  cursor: pointer;
}
.auth-terms input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.auth-check-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 2px solid #3a3e3f;
  border-radius: 4px;
  background: #1e2121;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.auth-terms input:checked + .auth-check-box {
  background: var(--accent-green);
  border-color: var(--accent-green);
}
.auth-check-box svg { opacity: 0; }
.auth-terms input:checked + .auth-check-box svg { opacity: 1; }
.auth-terms a {
  color: var(--accent-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-terms a:hover { color: var(--accent-green-hover); }

/* Register oauth row */
.auth-oauth-row {
  display: flex;
  gap: 10px;
}
.auth-oauth-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 12px 8px;
  border: none;
  border-radius: 10px;
  background: #323738;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.auth-oauth-btn:hover { background: #3a3e3f; }
.auth-oauth-btn img { width: 20px; height: 20px; object-fit: contain; }

@media (max-width: 480px) {
  .auth-modal { padding: 0 18px 24px; border-radius: 14px; }
  .auth-tabs { margin: 0 -18px 18px; padding: 0 18px; }
  .auth-oauth-btn { font-size: 12px; padding: 11px 6px; }
}
