/* ============================================================
   File: www/public/static/css/auth-module.css v3
   Design: 大厂风格 — 短信登录为主、密码/找回为次要文字链
   ============================================================ */

/* ---- Top Bar ---- */
.top-bar {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: rgba(9,9,11,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  max-width: var(--content-max-width);
  margin: 0 auto;
  height: 48px;
}
.top-bar__brand {
  font-size: var(--text-lg); font-weight: var(--font-bold);
  background: var(--brand-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 0.1em; cursor: pointer;
}
.top-bar__user {
  display: flex; align-items: center; gap: var(--space-2);
  cursor: pointer; padding: 4px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--border-default); background: transparent;
  color: var(--text-secondary); font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-out);
  font-family: var(--font-sans);
}
.top-bar__user:hover { border-color: var(--border-strong); color: var(--text-primary); }
.top-bar__user--login { border-color: var(--brand-mid); color: var(--brand-mid); font-weight: var(--font-medium); }
.top-bar__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: var(--font-bold); color: #fff;
  background: var(--brand-mid);
}

/* ---- Auth Modal Backdrop ---- */
.auth-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 200; display: flex; align-items: flex-end; justify-content: center;
  animation: authFadeIn 0.2s var(--ease-out);
}
@keyframes authFadeIn { from{opacity:0} to{opacity:1} }

.auth-sheet {
  background: var(--surface-card);
  width: 100%; max-width: var(--content-max-width);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-6) var(--space-5) calc(var(--space-8) + var(--safe-bottom));
  animation: authSlideUp 0.35s var(--ease-spring);
  max-height: 90vh; overflow-y: auto;
  position: relative;
}
@keyframes authSlideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }

.auth-sheet__close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--surface-elevated);
  color: var(--text-secondary); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s var(--ease-out);
}
.auth-sheet__close:active { transform: scale(0.9); background: var(--border-strong); }

/* ---- Sheet inner ---- */
.auth-heading {
  font-size: 22px; font-weight: var(--font-bold); text-align: center;
  margin-bottom: var(--space-5);
}
.auth-desc {
  font-size: var(--text-sm); color: var(--text-tertiary); text-align: center;
  margin: -12px 0 var(--space-5); line-height: 1.6;
}

/* Phone row */
.auth-phone-row {
  display: flex; align-items: center;
  background: var(--surface-base); border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: var(--space-3);
  transition: border-color 0.2s var(--ease-out);
}
.auth-phone-row:focus-within { border-color: var(--brand-mid); }
.auth-phone-row .prefix {
  color: var(--text-secondary); padding: 12px 8px 12px 14px;
  font-size: var(--text-md); font-weight: var(--font-semibold);
  border-right: 1px solid var(--border-default);
}
.auth-phone-row input {
  flex: 1; padding: 12px; border: none; background: transparent;
  color: var(--text-primary); font-size: 16px; font-family: var(--font-sans); outline: none;
}
.auth-phone-row input::placeholder { color: var(--text-tertiary); }

/* SMS code row */
.auth-code-row {
  display: flex; gap: 10px; margin-bottom: var(--space-3);
}
.auth-code-row input {
  flex: 1; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default); background: var(--surface-base);
  color: var(--text-primary); font-size: 16px; outline: none;
  transition: border-color 0.2s var(--ease-out);
}
.auth-code-row input:focus { border-color: var(--brand-mid); }
.auth-code-row input::placeholder { color: var(--text-tertiary); }

.auth-send-btn {
  padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; background: rgba(139,92,246,0.1);
  color: var(--brand-mid); font-size: var(--text-sm); white-space: nowrap;
  cursor: pointer; font-weight: var(--font-medium); font-family: var(--font-sans);
  transition: all 0.15s var(--ease-out); min-width: 100px; text-align: center;
}
.auth-send-btn:active { transform: scale(0.96); }
.auth-send-btn:disabled { opacity: 0.35; background: transparent; border-color: var(--border-default); color: var(--text-tertiary); cursor: not-allowed; }
.auth-send-btn--ready { border-color: var(--brand-mid); }

/* Password input */
.auth-pwd-row { margin-bottom: var(--space-3); }
.auth-pwd-row input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default); background: var(--surface-base);
  color: var(--text-primary); font-size: 16px; outline: none;
  transition: border-color 0.2s var(--ease-out); font-family: var(--font-sans);
}
.auth-pwd-row input:focus { border-color: var(--brand-mid); }
.auth-pwd-row input::placeholder { color: var(--text-tertiary); }

/* Primary button */
.auth-submit-btn {
  display: block; width: 100%; padding: 14px; border: none;
  border-radius: var(--radius-sm); font-size: 16px; font-weight: var(--font-semibold);
  cursor: pointer; font-family: var(--font-sans);
  background: var(--brand-gradient); color: #fff;
  box-shadow: 0 2px 12px rgba(139,92,246,0.25);
  transition: all 0.15s var(--ease-out);
}
.auth-submit-btn:active { transform: scale(0.97); }
.auth-submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Error */
.auth-error {
  color: var(--color-danger); font-size: var(--text-xs);
  margin-bottom: var(--space-3); text-align: center;
}

/* Secondary links row */
.auth-links {
  display: flex; align-items: center; justify-content: center; gap: var(--space-4);
  margin-top: var(--space-4); font-size: var(--text-sm);
}
.auth-link {
  color: var(--text-tertiary); cursor: pointer; text-decoration: none;
  transition: color 0.15s; background: none; border: none; font-family: var(--font-sans);
  font-size: var(--text-sm);
}
.auth-link:hover { color: var(--text-secondary); }
.auth-link--brand { color: var(--brand-mid); }
.auth-link--brand:hover { color: var(--brand-end); }

/* Privacy checkbox */
.auth-privacy {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: var(--space-4); font-size: var(--text-xs); color: var(--text-tertiary);
}
.auth-privacy input[type=checkbox] {
  accent-color: var(--brand-mid); width: 16px; height: 16px; cursor: pointer;
}
.auth-privacy a {
  color: var(--brand-mid); text-decoration: underline; cursor: pointer;
}

/* ---- Profile popup ---- */
.profile-popup {
  position: absolute; top: 52px; right: var(--space-4);
  background: var(--surface-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-4);
  min-width: 200px; z-index: 95;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: authFadeIn 0.15s var(--ease-out);
}
.profile-popup__name { font-weight: var(--font-semibold); font-size: var(--text-md); margin-bottom: 2px; }
.profile-popup__meta { font-size: var(--text-xs); color: var(--text-tertiary); margin-bottom: var(--space-4); }
.profile-popup__link {
  display: block; padding: 10px 0; font-size: var(--text-sm);
  color: var(--text-secondary); text-decoration: none;
  border-bottom: 1px solid var(--border-subtle); transition: color 0.1s;
}
.profile-popup__link:last-child { border-bottom: none; }
.profile-popup__link:active { color: var(--text-primary); }
.profile-popup__link--danger { color: var(--color-danger); }
