/* ══════════════════════════════════════════════════════
   auth-modal.css — 知萃 Auth Modal (白卡纸感弹窗)
   版本: 2.0
   规范: distillaI UI System 9.5 · §4 Modal
   依赖: tokens.css (全局设计 Token)
   注意: 暗色遮罩 + 白色纸感卡片，文本色值作用在白卡上
   ══════════════════════════════════════════════════════ */

/* ─── Auth Bar (top-right 登录/头像栏) ──────────────── */
.auth-bar {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: var(--zd-space-1, 8px);
}

.auth-bar .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--zd-line);
  object-fit: cover;
  cursor: pointer;
  transition: border-color var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1));
}

.auth-bar .user-avatar:hover {
  border-color: var(--zd-mint-400);
}

.auth-bar .user-name {
  font-size: 0.82rem;
  color: var(--zd-dim);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-btn {
  background: transparent;
  border: 1px solid var(--zd-line);
  color: var(--zd-dim);
  padding: 6px 16px;
  border-radius: var(--zd-radius-sm, 10px);
  font-size: 0.82rem;
  font-family: var(--zd-font-sans, Inter, sans-serif);
  cursor: pointer;
  background-color: rgba(7, 17, 31, 0.6);
  transition:
    background var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1)),
    border-color var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1)),
    color var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1));
}

.auth-btn:hover {
  background: rgba(98, 227, 167, 0.08);
  border-color: var(--zd-mint-400);
  color: var(--zd-paper);
}

/* ─── Modal Overlay ─────────────────────────────────── */
.modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s 0.25s;
}

.modal-overlay.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

/* ─── Modal Card — 白卡纸感 ────────────────────────── */
.modal-card {
  /* ── 白卡上的文本色 (作用在 --zd-paper 背景上) ──── */
  --card-text-primary:   var(--zd-ink);
  --card-text-secondary: var(--zd-text);
  --card-text-dim:       var(--zd-muted);
  --card-text-muted:     var(--zd-dim);
  --card-border:         var(--zd-line);
  --card-border-hover:   var(--zd-line2);
  --card-border-focus:   var(--zd-mint-500);
  --card-bg-input:       var(--zd-cloud);

  /* ── 卡片本体 ──────────────────────────────────── */
  background: var(--zd-paper);
  border-radius: 28px;
  padding: var(--zd-space-4xl, 48px) var(--zd-space-3xl, 32px) var(--zd-space-3xl, 32px);
  width: 380px;
  max-width: 90vw;
  text-align: center;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: cardSlideUp 0.35s var(--zd-ease-out, cubic-bezier(0.2,0,0,1));
  font-family: var(--zd-font-sans, Inter, sans-serif);
}

@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─── Card: Icon ───────────────────────────────────── */
.modal-card .modal-icon {
  font-size: 2.6rem;
  margin-bottom: var(--zd-space-md, 12px);
  display: block;
}

/* ─── Card: Title ──────────────────────────────────── */
.modal-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--card-text-primary);
  margin: 0 0 var(--zd-space-1, 8px);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* ─── Card: Subtitle ───────────────────────────────── */
.modal-card .modal-sub {
  font-size: 0.85rem;
  color: var(--card-text-secondary);
  margin: 0 0 var(--zd-space-3xl, 32px);
  line-height: 1.5;
}

/* ─── Google Login Button ──────────────────────────── */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--zd-radius-md, 16px);
  border: 1px solid var(--card-border);
  background: var(--zd-paper);
  color: var(--card-text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition:
    background var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1)),
    border-color var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1)),
    box-shadow var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1)),
    transform var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1));
  margin-bottom: var(--zd-space-1, 8px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.google-btn:hover {
  background: var(--card-bg-input);
  border-color: var(--card-border-hover);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.google-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.google-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ─── Divider ──────────────────────────────────────── */
.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: var(--zd-space-1, 8px) 0 var(--zd-space-md, 12px);
  color: var(--card-text-muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

/* ─── Email Input Group ────────────────────────────── */
.email-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--zd-space-1, 8px);
  margin-bottom: var(--zd-space-md, 12px);
}

.email-input-group input {
  background: var(--card-bg-input);
  border: 1px solid var(--card-border);
  padding: 12px 14px;
  border-radius: var(--zd-radius-md, 16px);
  color: var(--card-text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition:
    border-color var(--zd-duration-normal, 300ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1)),
    box-shadow var(--zd-duration-normal, 300ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1));
}

.email-input-group input:focus {
  border-color: var(--card-border-focus);
  box-shadow: 0 0 0 3px rgba(98, 227, 167, 0.18);
}

.email-input-group input::placeholder {
  color: var(--card-text-muted);
  opacity: 0.8;
}

.email-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--zd-radius-md, 16px);
  border: none;
  background: var(--zd-mint-500);
  color: var(--zd-navy-900);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    background var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1)),
    transform var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1)),
    box-shadow var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1));
}

.email-btn:hover {
  background: var(--zd-mint-400);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(98, 227, 167, 0.30);
}

.email-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ─── Comfort Text ─────────────────────────────────── */
.modal-comfort {
  font-size: 0.78rem;
  color: var(--card-text-dim);
  margin: 0 0 var(--zd-space-lg, 16px);
  line-height: 1.5;
}

/* ─── Skip Button (non-destructive exit) ───────────── */
.modal-skip {
  display: inline-block;
  background: none;
  border: none;
  color: var(--card-text-muted);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--zd-radius-sm, 10px);
  transition:
    color var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1)),
    background var(--zd-duration-fast, 160ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1));
}

.modal-skip:hover {
  color: var(--card-text-secondary);
  background: var(--card-bg-input);
}

/* ─── Login Hint ───────────────────────────────────── */
.login-hint {
  position: fixed;
  top: 1.2rem;
  left: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--zd-muted);
  opacity: 0;
  transition: opacity var(--zd-duration-normal, 300ms) var(--zd-ease-out, cubic-bezier(0.2,0,0,1));
  pointer-events: none;
}

.login-hint.visible {
  opacity: 1;
}

.login-hint .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--zd-mint-600);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ─── Register Link ─────────────────────────────────── */
.modal-register-link {
  font-size: 0.82rem;
  color: var(--card-text-muted);
  margin: var(--zd-space-1, 8px) 0 0;
}

.modal-register-link a {
  color: var(--zd-mint-500);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.modal-register-link a:hover {
  text-decoration: underline;
}

/* ─── Register Error ────────────────────────────────── */

.reg-error {
  font-size: 0.82rem;
  color: var(--zd-rose-500);
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--zd-radius-sm, 10px);
  padding: 8px 12px;
  margin-bottom: var(--zd-space-1, 8px);
  text-align: left;
  display: none;
}

/* ─── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  .auth-bar {
    top: 0.8rem;
    right: 1rem;
  }

  .modal-card {
    padding: var(--zd-space-3xl, 32px) var(--zd-space-xl, 20px) var(--zd-space-2xl, 24px);
    border-radius: 24px;
  }

  .login-hint {
    top: 0.8rem;
    left: 1rem;
  }
}
