/* ========== 헤더 로그인/가입 버튼 ========== */
.auth-buttons {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.auth-buttons.ready {
  display: flex;
}

.auth-buttons.ready.logged-in {
  display: none;
}

.auth-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  white-space: nowrap;
}

.auth-btn-primary {
  background: linear-gradient(135deg, #DC2626 0%, #b91c1c 100%);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.auth-btn-primary:hover {
  background: linear-gradient(135deg, #ef4444 0%, #DC2626 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* ========== 로그인 후 사용자 메뉴 ========== */
.user-menu {
  display: none;
  align-items: center;
  gap: 12px;
  margin-left: 12px;
}

.user-menu.ready.logged-in {
  display: flex;
}

.user-nickname {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  padding: 6px 12px;
  background: #DC2626;
  border-radius: 20px;
}

.user-logout-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-logout-btn:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}

/* ========== 모달 오버레이 ========== */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal.active {
  display: flex !important;
  visibility: visible;
  opacity: 1;
}

/* ========== 모달 컨텐츠 ========== */
.auth-modal-content {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  position: relative;
  padding: 0;
  animation: modalSlideUp 0.3s ease;
}

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

/* X 닫기 버튼 */
.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.auth-modal-close:hover {
  background: #fee2e2;
  color: #DC2626;
  transform: rotate(90deg);
}

/* ========== 탭 ========== */
.auth-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 20px 20px 0 0;
  border-bottom: 2px solid #e5e7eb;
}

.auth-tab {
  flex: 1;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-right: 1px solid #d1d5db;
  font-size: 15px;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.auth-tab:last-child {
  border-right: none;
}

.auth-tab.active {
  background: #ffffff;
  color: #DC2626;
}

/* 활성 탭 하단 강조선 */
.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: #DC2626;
}

.auth-tab:hover:not(.active) {
  color: #6b7280;
  background: #e5e7eb;
}

/* ========== 폼 컨테이너 ========== */
.auth-form-container {
  padding: 28px 28px 32px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

/* ========== 소셜 로그인 버튼 ========== */
.auth-social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.auth-google-btn {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  color: #374151;
}

.auth-google-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========== 구분선 ========== */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.auth-divider span {
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
}

.auth-form-group {
  margin-bottom: 20px;
}

.auth-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

/* ========== 입력 필드 ========== */
.auth-form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  background: #f9fafb;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-form-input:hover {
  border-color: #d1d5db;
  background: #ffffff;
}

.auth-form-input:focus {
  outline: none;
  border-color: #DC2626;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.auth-form-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

/* ========== 제출 버튼 ========== */
.auth-form-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #DC2626 0%, #b91c1c 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  letter-spacing: -0.01em;
}

.auth-form-submit:hover {
  background: linear-gradient(135deg, #ef4444 0%, #DC2626 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.auth-form-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* ========== ID/PW 찾기 링크 ========== */
.auth-helper-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

.auth-helper-link {
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-helper-link:hover {
  color: #DC2626;
}

.auth-helper-divider {
  color: #e5e7eb;
  font-size: 12px;
}

/* ========== 메시지 ========== */
.auth-message {
  display: none;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  text-align: center;
}

.auth-message.error {
  display: block;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #dc2626;
  border: 1px solid #fecaca;
}

.auth-message.success {
  display: block;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* ========== 모바일 대응 ========== */
@media (max-width: 768px) {
  .auth-buttons {
    margin-left: 8px;
  }
  
  .auth-btn {
    padding: 7px 14px;
    font-size: 13px;
  }
  
  .auth-modal {
    padding: 16px;
    align-items: flex-end;
  }
  
  .auth-modal-content {
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    animation: modalSlideUpMobile 0.3s ease;
  }
  
  @keyframes modalSlideUpMobile {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .auth-tabs {
    border-radius: 24px 24px 0 0;
  }
  
  .auth-form-container {
    padding: 24px 20px 32px;
  }
  
  .auth-form-input {
    padding: 16px;
    font-size: 16px; /* iOS 줌 방지 */
  }
}

/* ========== 다크모드 대응 (선택) ========== */
@media (prefers-color-scheme: dark) {
  .user-nickname {
    color: #ffffff;
    background: #DC2626;
  }
}

/* ========== 이메일 인증 대기 화면 ========== */
.email-pending-view {
  display: none;
  padding: 40px 28px;
  text-align: center;
}

.pending-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: pendingBounce 2s ease-in-out infinite;
}

@keyframes pendingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.pending-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 16px 0;
}

.pending-email {
  font-size: 15px;
  color: #4b5563;
  margin: 0 0 8px 0;
  word-break: break-all;
}

.pending-email strong {
  color: #DC2626;
  font-weight: 600;
}

.pending-instruction {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 28px 0;
  line-height: 1.5;
}

.pending-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-done {
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(135deg, #DC2626 0%, #b91c1c 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-done:hover {
  background: linear-gradient(135deg, #ef4444 0%, #DC2626 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-resend-secondary {
  width: 100%;
  padding: 12px 16px;
  background: #f3f4f6;
  border: none;
  border-radius: 12px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-resend-secondary:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.btn-cancel {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

.resend-message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.resend-message:empty {
  display: none;
}

.resend-message.success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.resend-message.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
