/**
 * 통계지니 인증 시스템 통합 스타일
 */

/* 인증 헤더 */
.auth-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#auth-header-container {
  margin-left: auto;
}

/* 토큰 디스플레이 */
.token-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  height: 42px;
}

.token-display:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.token-icon {
  font-size: 1.2rem;
}

.token-count {
  font-weight: 700;
  color: white;
  font-size: 1rem;
}

/* 사용자 메뉴 */
.user-menu {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.95rem;
  font-weight: 600;
  height: 42px;
}

.user-button:hover {
  background: #f5f5f5;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  color: #212121;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
}

.user-dropdown a:last-child {
  border-bottom: none;
}

.user-dropdown a:hover {
  background: #f8f9fa;
  padding-left: 1.5rem;
}

/* 인증 버튼 컨테이너 */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* 로그인 버튼 */
.login-button {
  padding: 0.625rem 1.25rem;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.95rem;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.login-button:hover {
  background: #45a049;
}

/* 관리자 버튼 */
.admin-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.admin-button:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.admin-icon {
  font-size: 1.1rem;
}

.admin-text {
  font-weight: 600;
}

/* 모달 오버레이 */
.auth-modal-overlay,
.credit-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s;
}

/* 인증 모달 */
.auth-modal {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 440px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  animation: slideUp 0.3s;
}

.auth-modal h2 {
  margin: 0 0 1rem 0;
  text-align: center;
  font-size: 1.75rem;
  color: #333;
}

.auth-message {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  color: #856404;
  text-align: center;
}

.signup-benefit {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  color: #155724;
  text-align: center;
}

/* 크레딧 부족 모달 */
.credit-modal {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  width: 90%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.3s;
}

.credit-modal-icon {
  text-align: center;
  margin-bottom: 1.5rem;
}

.credit-icon {
  font-size: 3rem;
  animation: bounce 1s infinite;
}

.credit-modal h2 {
  margin: 0 0 1.5rem 0;
  text-align: center;
  font-size: 1.875rem;
  color: #333;
}

.credit-status {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.credit-status p {
  margin: 0.5rem 0;
  font-size: 1rem;
  color: #666;
}

.credit-status strong {
  color: #333;
  font-weight: 600;
}

.credit-needed {
  color: #dc3545 !important;
}

.credit-message {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 2rem;
}

.credit-message p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* 가격표 */
.credit-options h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333;
}

.price-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.price-item {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  position: relative;
  transition: all 0.3s;
  cursor: pointer;
}

.price-item:hover {
  border-color: #4CAF50;
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.price-item.popular {
  border-color: #4CAF50;
  background: #f8fff8;
}

.price-item.best {
  border-color: #ff9800;
  background: #fff8f0;
}

.badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #4CAF50;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.price-item.best .badge {
  background: #ff9800;
}

.credit-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
}

.credit-price {
  font-size: 1.5rem;
  font-weight: 600;
  color: #4CAF50;
  margin-bottom: 0.25rem;
}

.credit-per {
  font-size: 0.875rem;
  color: #666;
}

.charge-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.charge-btn:hover {
  transform: translateY(-2px);
}

/* 폼 스타일 */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76,175,80,0.1);
}

.form-group.checkbox label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
}

.form-group.checkbox input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* 제출 버튼 */
.submit-btn {
  width: 100%;
  padding: 0.875rem;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 0.75rem;
}

.submit-btn:hover {
  background: #45a049;
}

/* 관리자 접속 버튼 (모달 내부) */
.admin-access-btn {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.admin-access-btn:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.admin-access-btn .admin-icon {
  font-size: 1.1rem;
}

/* 닫기 버튼 */
.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #f5f5f5;
  color: #333;
}

/* 모달 푸터 */
.modal-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.modal-footer p {
  color: #666;
  font-size: 0.95rem;
}

.modal-footer a {
  color: #4CAF50;
  font-weight: 600;
  text-decoration: none;
}

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

.help-text {
  font-size: 0.875rem;
  color: #666;
  margin: 0;
}

/* 토스트 메시지 */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 100000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  max-width: 320px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: #4CAF50;
}

.toast-error {
  background: #f44336;
}

.toast-info {
  background: #2196F3;
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 반응형 */
@media (max-width: 768px) {
  .price-list {
    grid-template-columns: 1fr;
  }

  .credit-modal {
    padding: 1.5rem;
  }

  /* 모바일에서 토스트 컨테이너 위치 조정 */
  #toast-container {
    top: auto !important;
    bottom: 10px !important;
    left: 10px !important;
    right: 10px !important;
    max-width: 100% !important;
  }

  .toast {
    font-size: 0.85rem !important;
    padding: 0.875rem 1.25rem !important;
  }
}

/* 토스트 프로그레스 바 애니메이션 */
@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* 비밀번호 찾기 링크 */
.forgot-password-link {
  text-align: right;
  margin-top: -0.5rem;
  margin-bottom: 1.25rem;
}

.forgot-password-link a {
  color: #888;
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 400;
}

.forgot-password-link a:hover {
  text-decoration: underline;
  color: #666;
}

/* 비밀번호 찾기 헤더 */
.forgot-password-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.forgot-password-header .forgot-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2rem;
}

.forgot-password-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: #212121;
}

.forgot-password-header p {
  color: #616161;
  font-size: 0.95rem;
  margin: 0;
}

/* 비밀번호 찾기 성공 화면 */
.forgot-password-success {
  text-align: center;
  padding: 1rem 0;
}

.forgot-password-success .success-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #4CAF50 0%, #81C784 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2rem;
  color: white;
}

.forgot-password-success h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  color: #212121;
}

.forgot-password-success p {
  color: #424242;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.forgot-password-success p strong {
  color: #FFC107;
}

.forgot-password-success .help-text {
  color: #9e9e9e;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

/* 소셜 로그인 */
.social-login-section {
  margin-top: 1.25rem;
}

.social-divider {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

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

.social-divider span {
  padding: 0 0.75rem;
  color: #999;
  font-size: 0.875rem;
}

.naver-login-btn {
  width: 100%;
  padding: 0.75rem;
  background: #03C75A;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.naver-login-btn:hover {
  background: #02b351;
}

.naver-login-btn svg {
  flex-shrink: 0;
}