/* ===== 공통 auth 페이지 ===== */
.auth-page { background: var(--bg); min-height: 100vh; }

.auth-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}
.auth-logo {
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 3px;
  text-decoration: none;
}
.auth-header-back {
  position: absolute;
  left: 20px;
  font-size: 13px;
  color: var(--font-gray);
  text-decoration: none;
}
.auth-header-back:hover { color: var(--accent); }

/* ===== 로그인 레이아웃 ===== */
.auth-wrap { padding: 30px 15px 60px; }

.auth-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.auth-left {
  flex: 0 0 420px;
  padding: 36px 36px 40px;
  border-right: 1px solid var(--border-color);
}
.auth-right {
  flex: 1;
  background: var(--ad-bg);
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-banner-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-banner-inner { text-align: center; }
.auth-banner-text  { font-size: 16px; color: var(--ad-text); }
.auth-banner-sub   { font-size: 12px; color: var(--font-light); margin-top: 6px; }

/* ===== 섹션 타이틀 ===== */
.auth-section-title {
  font-size: 13px;
  color: var(--font-gray);
  font-weight: normal;
  margin: 0 0 12px;
  text-align: center;
}

/* ===== 입력 필드 ===== */
.auth-field { margin-bottom: 10px; }
.auth-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg);
  color: var(--font-black);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input:disabled { color: var(--font-gray); cursor: not-allowed; }

/* ===== 버튼 ===== */
.btn-auth-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 4px;
}
.btn-auth-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-auth-outline {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--bg-white);
  color: var(--font-black);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.btn-auth-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: 12px; width: auto; display: inline-block; }

.btn-danger {
  display: block;
  width: 100%;
  padding: 13px;
  background: #f44336;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: #d32f2f; }

.btn-danger-outline {
  display: inline-block;
  padding: 6px 12px;
  background: transparent;
  color: #f44336;
  border: 1px solid #f44336;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-danger-outline:hover { background: #f44336; color: #fff; }

/* ===== 아이디/비밀번호 찾기 링크 ===== */
.auth-find-link {
  text-align: center;
  margin: 8px 0 14px;
}
.auth-find-link a { font-size: 12px; color: var(--accent); }

/* ===== 구분선 ===== */
.auth-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 20px 0;
}

/* ===== SNS 로그인 ===== */
.btn-sns {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 8px;
  gap: 10px;
  transition: opacity 0.15s;
}
.btn-sns:hover { opacity: 0.88; }

.btn-naver { background: #03c75a; color: #fff; }
.btn-kakao { background: #fee500; color: #191919; }
.btn-google { background: #fff; color: #333; border: 1px solid #ddd; }
.btn-google:hover { background: #f5f5f5; }

.sns-icon {
  width: 28px; height: 28px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; flex-shrink: 0;
}
.naver-icon { background: #fff; color: #03c75a; }
.kakao-icon { background: #3c1e1e; color: #fee500; }

/* ===== 알림 메시지 ===== */
.auth-error {
  background: #fff3f3;
  color: #f44336;
  border: 1px solid #ffcdd2;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 10px;
}
.auth-success {
  background: #f1f8f1;
  color: #388e3c;
  border: 1px solid #c8e6c9;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 10px;
}
body.dark-mode .auth-error   { background: #3b1212; border-color: #7b2020; }
body.dark-mode .auth-success { background: #122b12; border-color: #2a5c2a; }

/* ===== CSS 변수 추가 ===== */
:root {
  --error-color:   #f44336;
  --success-color: #388e3c;
}

/* ===== 회원가입 ===== */
.join-container {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 36px;
  box-shadow: var(--shadow);
}
.join-title    { font-size: 22px; font-weight: 900; margin-bottom: 4px; color: var(--font-black); }
.join-subtitle { font-size: 13px; color: var(--font-gray); margin-bottom: 28px; }

.step-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 18px;
  color: var(--font-black);
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-num {
  display: inline-flex;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  align-items: center;
  justify-content: center;
}

/* 약관 */
.terms-all-box {
  background: var(--bg);
  padding: 12px 14px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.terms-box {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}
.terms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
}
.btn-terms-toggle {
  font-size: 11px;
  color: var(--font-gray);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.terms-content {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--font-gray);
  border-top: 1px solid var(--border-color);
  background: var(--bg);
  line-height: 1.6;
  max-height: 120px;
  overflow-y: auto;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--font-black);
  cursor: pointer;
  margin: 0;
  font-weight: normal;
}
.check-label.bold { font-weight: bold; }
.check-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.required { color: var(--accent); font-size: 12px; }
.optional  { color: var(--font-gray); font-size: 12px; }

/* 가입 폼 */
.join-field { margin-bottom: 16px; }
.join-label { display: block; font-size: 13px; color: var(--font-gray); margin-bottom: 6px; }
.field-row  { display: flex; gap: 8px; }
.field-row .auth-input { flex: 1; }
.btn-check {
  padding: 0 14px;
  background: var(--btn-dark-bg);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-check:hover { background: var(--accent); }
.field-hint { display: block; font-size: 11px; margin-top: 4px; color: var(--font-gray); }
.pw-strength { font-size: 12px; margin-top: 4px; height: 16px; }
.gender-btns { display: flex; gap: 16px; }
.gender-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; margin: 0; }
.gender-label input { accent-color: var(--accent); }
.join-btns { display: flex; gap: 8px; margin-top: 4px; }
.join-btns .btn-auth-outline { flex: 0 0 100px; }
.join-btns .btn-auth-primary { flex: 1; }

/* 완료 화면 */
.join-complete { text-align: center; padding: 20px 0; }
.complete-icon  { font-size: 48px; margin-bottom: 12px; }
.complete-title { font-size: 24px; font-weight: bold; margin-bottom: 10px; }
.complete-msg   { font-size: 14px; color: var(--font-gray); margin-bottom: 20px; line-height: 1.6; }
.grade-welcome  { margin-bottom: 24px; }
.grade-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
}
.grade-desc { font-size: 12px; color: var(--font-gray); margin-top: 8px; }

/* ===== 아이디/비밀번호 찾기 ===== */
.find-container {
  max-width: 440px;
  margin: 0 auto;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 36px;
  box-shadow: var(--shadow);
}
.find-tabs { display: flex; margin-bottom: 24px; border-bottom: 2px solid var(--border-color); }
.find-tab {
  flex: 1;
  padding: 11px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: bold;
  color: var(--font-gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.find-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.find-desc { font-size: 13px; color: var(--font-gray); margin-bottom: 16px; line-height: 1.5; }

/* ===== 마이페이지 ===== */
.mypage-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* 사이드바 */
.mypage-sidebar {
  flex: 0 0 200px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.mypage-profile-box {
  padding: 20px 16px;
  background: var(--nav-bg);
  text-align: center;
}
.mypage-avatar {
  font-size: 40px;
  margin-bottom: 8px;
  line-height: 1;
}
.mypage-nickname {
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px;
}
.mypage-grade-badge { margin-bottom: 6px; }
.mypage-join-date  { font-size: 11px; color: #aaa; }

.mypage-menu { padding: 8px 0; }
.mypage-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  font-size: 13px;
  color: var(--font-black);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.mypage-menu-item i { width: 16px; text-align: center; color: var(--font-gray); }
.mypage-menu-item:hover { background: var(--bg); color: var(--accent); }
.mypage-menu-item.active { background: var(--bg); color: var(--accent); font-weight: bold; }
.mypage-menu-item.active i { color: var(--accent); }
.mypage-menu-item.withdraw-item { color: #f44336; }
.mypage-menu-item.withdraw-item i { color: #f44336; }

.btn-logout {
  width: 100%;
  padding: 11px 18px;
  font-size: 13px;
  color: var(--font-gray);
  border-top: 1px solid var(--border-color);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.12s;
}
.btn-logout:hover { color: var(--accent); }
.btn-logout i { width: 16px; text-align: center; }

/* 콘텐츠 */
.mypage-content {
  flex: 1;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 28px;
  min-height: 400px;
}
.mypage-tab-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
  color: var(--font-black);
}

/* 프로필 이미지 */
.profile-img-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
}
.profile-img-preview {
  font-size: 48px;
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  overflow: hidden;
}
.profile-img-btns { display: flex; flex-direction: column; gap: 6px; }

/* 등급 탭 */
.grade-my-box {
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}
.grade-my-current {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.grade-icon-big { font-size: 40px; }
.grade-my-name  { font-size: 20px; font-weight: bold; }
.grade-my-posts { font-size: 13px; color: var(--font-gray); margin-top: 4px; }
.grade-progress-wrap { }
.grade-progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.grade-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.grade-progress-label { font-size: 12px; color: var(--font-gray); }
.grade-list-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--font-black);
}
.grade-table { border: 1px solid var(--border-color); border-radius: 6px; overflow: hidden; }
.grade-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}
.grade-row:last-child { border-bottom: none; }
.grade-row-active { background: var(--bg); }
.grade-row-icon   { font-size: 18px; width: 24px; text-align: center; }
.grade-row-name   { font-weight: bold; width: 80px; }
.grade-row-req    { color: var(--font-gray); flex: 1; }
.grade-row-current {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
}

/* 활동 통계 */
.activity-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.stat-box {
  flex: 1;
  text-align: center;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.stat-box.clickable { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.stat-box.clickable:hover { border-color: var(--accent); background: rgba(255,107,53,0.05); }
.stat-box.clickable.selected { border-color: var(--accent); border-width: 2px; background: rgba(255,107,53,0.05); }
.stat-num   { font-size: 24px; font-weight: bold; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--font-gray); margin-top: 4px; }
.activity-empty { text-align: center; padding: 30px 0; }

/* 활동 필터 탭 */
.activity-filter { display: flex; gap: 6px; margin-bottom: 16px; }
.activity-filter-btn {
  padding: 7px 16px; border: 1px solid var(--border-color); border-radius: 4px;
  background: var(--bg-white); color: var(--font-black); font-size: 13px; cursor: pointer;
}
.activity-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 활동 목록 아이템 */
.activity-item {
  display: block; padding: 12px 14px; border-bottom: 1px solid var(--border-color);
  text-decoration: none; color: var(--font-black); transition: background 0.1s;
}
.activity-item:hover { background: var(--bg); color: var(--font-black); }
.activity-item-title {
  font-size: 14px; font-weight: 500; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.activity-item-meta { font-size: 11px; color: var(--font-gray); display: flex; gap: 10px; }
.activity-item-comment {
  font-size: 13px; color: var(--font-black); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.activity-item-post {
  font-size: 11px; color: var(--font-gray);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.activity-list-wrap {
  background: var(--bg-white); border: 1px solid var(--border-color); border-radius: 6px; overflow: hidden;
  margin-bottom: 12px;
}
.activity-pagination { display: flex; justify-content: center; gap: 4px; }
.activity-pagination a, .activity-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--border-color); border-radius: 4px;
  font-size: 12px; color: var(--font-black); background: var(--bg-white); text-decoration: none;
}
.activity-pagination a:hover { border-color: var(--accent); color: var(--accent); }
.activity-pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 탈퇴 경고 */
.withdraw-warning {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.6;
}
body.dark-mode .withdraw-warning { background: #2d2600; border-color: #665a00; }
.withdraw-warning i { color: #f57c00; margin-right: 6px; }
.withdraw-warning strong { display: block; margin-bottom: 8px; color: #f57c00; }
.withdraw-warning ul { margin: 0; padding-left: 18px; color: var(--font-gray); }
.withdraw-warning ul li { margin-bottom: 4px; }

/* ===== 반응형 ===== */
@media (max-width: 768px) {
  .auth-container { flex-direction: column; }
  .auth-left  { flex: none; padding: 24px 20px; border-right: none; border-bottom: 1px solid var(--border-color); }
  .auth-right { min-height: 160px; }
  .join-container, .find-container { padding: 24px 18px; }
  .mypage-container { flex-direction: column; gap: 12px; }
  .mypage-sidebar { flex: none; width: 100%; }
  .mypage-content { padding: 20px 16px; }
  .activity-stats { flex-wrap: wrap; }
  .stat-box { flex: 1 1 calc(50% - 6px); }
}
