/* ================================================
   선교꿈틀방 – auth.css
   로그인 화면 & 인증 관련 스타일
   ================================================ */

/* ── body 잠금 상태 ── */
body.locked {
  overflow: hidden;
}

/* ── 메인 콘텐츠 숨김 ── */
.main-content.hidden {
  display: none !important;
}
.main-content {
  display: block;
}

/* ════════════════════════════════════════════════
   로그인 오버레이 (전체 화면)
════════════════════════════════════════════════ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: linear-gradient(145deg, #1A6B8A 0%, #2E86AB 40%, #5BA3C9 75%, #87CEEB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* 배경 패턴 */
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.06) 0%, transparent 50%),
    linear-gradient(145deg, #1A6B8A 0%, #2E86AB 40%, #5BA3C9 75%, #87CEEB 100%);
}

/* 숨겨진 상태 */
.login-overlay.hidden {
  display: none;
}

/* ── 로그인 카드 ── */
.login-card {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.18),
    0 4px 16px rgba(0, 0, 0, 0.08);
  animation: cardIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ── 로고 영역 ── */
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--sky-500), var(--sky-700));
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(46, 134, 171, 0.35);
}
.login-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-800);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--gray-400);
}

/* ── 자물쇠 아이콘 ── */
.login-lock-icon {
  text-align: center;
  margin-bottom: 28px;
}
.login-lock-icon i {
  font-size: 36px;
  color: var(--sky-500);
  transition: all 0.3s ease;
}
.login-lock-icon i.unlocked {
  color: var(--success);
  transform: rotate(-15deg) scale(1.1);
}

/* ── 입력 필드 래퍼 ── */
.login-input-wrap {
  position: relative;
}
.login-input {
  padding-right: 48px !important;
  font-size: 15px !important;
  height: 50px;
  border-width: 2px !important;
}
.login-input:focus {
  border-color: var(--sky-500) !important;
  box-shadow: 0 0 0 4px rgba(91, 163, 201, 0.18) !important;
}
.login-input.error {
  border-color: var(--danger) !important;
  animation: shake 0.4s ease;
}

/* ── 비밀번호 보기 토글 ── */
.login-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.login-eye:hover { color: var(--sky-600); }

/* ── 에러 메시지 ── */
.login-error {
  min-height: 20px;
  font-size: 13px;
  color: var(--danger);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.login-error:not(:empty)::before {
  content: '\f071';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 11px;
}

/* ── 로그인 버튼 ── */
.login-btn {
  width: 100%;
  height: 50px;
  font-size: 15px !important;
  border-radius: 12px !important;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--sky-600), var(--sky-700)) !important;
  transition: all 0.25s ease !important;
  letter-spacing: 0.3px;
}
.login-btn:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(46, 134, 171, 0.4) !important;
}
.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.login-btn.success-state {
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
}

/* ── 홈 돌아가기 ── */
.login-back {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--gray-400);
  transition: color 0.2s;
}
.login-back:hover { color: var(--sky-600); }
.login-back i { margin-right: 5px; }

/* ── 흔들기 애니메이션 ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

/* ════════════════════════════════════════════════
   내비바 인증 영역
════════════════════════════════════════════════ */
.nav-auth-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}

/* 로그인 상태 뱃지 */
.nav-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-user-badge i { font-size: 11px; color: var(--success); }

/* 로그아웃 버튼 */
.logout-btn {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #b91c1c !important;
  border: 1.5px solid rgba(239, 68, 68, 0.25) !important;
  font-size: 12px !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  white-space: nowrap;
  transition: all 0.2s ease !important;
}
.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  transform: none !important;
}

/* 모바일 auth 행 */
.mobile-auth-row {
  padding: 8px 16px 4px;
  border-top: 1px solid var(--sky-100);
  margin-top: 4px;
}
.mobile-auth-row .logout-btn {
  width: 100%;
  justify-content: center;
}

/* index.html 내비바 – 로그인 중 뱃지 (JS로 삽입) */
.nav-login-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--sky-100);
  color: var(--sky-700);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-login-link:hover {
  background: var(--sky-200);
}

/* ════════════════════════════════════════════════
   반응형
════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .login-card {
    padding: 36px 24px 28px;
  }
  .nav-auth-group {
    display: none; /* 모바일에선 mobile-nav에 표시 */
  }
}

/* ════════════════════════════════════════════════
   공지 비번 확인 모달 전용
════════════════════════════════════════════════ */
#noticeAuthModal .modal {
  animation: cardIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#noticeAuthDesc {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: var(--sky-100);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--sky-400);
  color: var(--sky-700) !important;
  font-size: 13px !important;
  line-height: 1.6;
  margin-bottom: 20px !important;
}
#noticeAuthDesc::before {
  content: '\f05a';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 글쓰기 버튼 – 잠금/열림 아이콘 */
#btnAddNotice .fa-lock   { opacity: 0.85; }
#btnAddNotice .fa-pen    { opacity: 1; }
