/* ===== 會員系統樣式 ===== */

/* 導航欄登入按鈕 */
.nav-auth-btn {
  background: var(--wheat-gold, #c8a45a);
  color: #fff;
  border: none;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s, transform 0.15s;
  white-space: nowrap;
}
.nav-auth-btn:hover { background: var(--brown-dark, #5a3e28); transform: scale(1.04); }

/* 導航欄用戶狀態 */
.nav-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--brown-dark, #5a3e28);
}
.nav-user-info .user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--wheat-gold, #c8a45a);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.8rem;
}
.nav-user-info .logout-btn {
  background: none; border: 1px solid var(--oat, #e8ddd0);
  padding: 0.2rem 0.6rem; border-radius: 4px;
  font-size: 0.78rem; cursor: pointer;
  color: var(--brown-dark, #5a3e28);
  transition: background 0.2s;
}
.nav-user-info .logout-btn:hover { background: var(--cream, #faf5ee); }

/* 模態框遮罩 */
.auth-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  justify-content: center; align-items: center;
  backdrop-filter: blur(2px);
}
.auth-modal-overlay.active { display: flex; }

/* 模態框容器 */
.auth-modal {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  width: 90%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
  animation: authSlideIn 0.3s ease;
}
@keyframes authSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-modal h2 {
  font-size: 1.4rem;
  color: var(--brown-dark, #5a3e28);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* 關閉按鈕 */
.auth-modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: #999; line-height: 1;
  transition: color 0.2s;
}
.auth-modal-close:hover { color: #333; }

/* 表單 */
.auth-form { display: flex; flex-direction: column; gap: 0.9rem; }
.auth-form label {
  font-size: 0.85rem; font-weight: 600;
  color: var(--brown-dark, #5a3e28);
  margin-bottom: 0.25rem; display: block;
}
.auth-form input {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--oat, #e8ddd0);
  border-radius: 8px; font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--wheat-gold, #c8a45a);
  box-shadow: 0 0 0 3px rgba(200,164,90,0.15);
}
.auth-form .auth-submit {
  background: var(--wheat-gold, #c8a45a);
  color: #fff; border: none;
  padding: 0.75rem; border-radius: 8px;
  font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background 0.3s;
  margin-top: 0.5rem;
}
.auth-form .auth-submit:hover { background: var(--brown-dark, #5a3e28); }
.auth-form .auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* 切換登入/註冊 */
.auth-switch {
  text-align: center; margin-top: 1rem;
  font-size: 0.85rem; color: #888;
}
.auth-switch a {
  color: var(--wheat-gold, #c8a45a);
  text-decoration: underline; cursor: pointer;
  font-weight: 500;
}
.auth-switch a:hover { color: var(--brown-dark, #5a3e28); }

/* 錯誤/成功訊息 */
.auth-message {
  padding: 0.6rem 0.9rem; border-radius: 6px;
  font-size: 0.85rem; display: none;
}
.auth-message.error {
  display: block;
  background: #fff0f0; color: #c00; border: 1px solid #fcc;
}
.auth-message.success {
  display: block;
  background: #f0fff0; color: #080; border: 1px solid #cfc;
}

/* 行動版適配 */
@media (max-width: 768px) {
  .nav-auth-btn { padding: 0.35rem 0.8rem; font-size: 0.82rem; }
  .auth-modal { padding: 1.5rem; width: 94%; }
}
