/* ==========================================================================
   오솔킹 (OSOLKING) 인증 시스템 & 모달 & 약관 & Auth Gate 스타일
   ========================================================================== */

/* 1. 상단 우측 헤더 인증 바 */
.auth-header-bar {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 5px 12px 5px 6px;
  border-radius: 30px;
  border: 1px solid #d8e5f8;
  box-shadow: 0 2px 8px rgba(39, 104, 200, 0.08);
}

.auth-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2768c8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  object-fit: cover;
}

.auth-user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #172b4d;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 7px 14px;
  text-decoration: none;
}

.auth-btn-primary {
  background: #2768c8;
  color: #fff;
  box-shadow: 0 2px 8px rgba(39, 104, 200, 0.25);
}

.auth-btn-primary:hover {
  background: #1b53a3;
  transform: translateY(-1px);
}

.auth-btn-outline {
  background: #fff;
  color: #486581;
  border: 1px solid #d8e2ec;
}

.auth-btn-outline:hover {
  background: #f0f4f8;
  color: #102a43;
}

.auth-btn-logout {
  background: transparent;
  color: #829ab1;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.auth-btn-logout:hover {
  color: #e12d39;
  text-decoration: underline;
}

/* 2. 드로어 메뉴 내 인증 영역 */
.drawer-auth-card {
  background: #f4f8ff;
  border: 1px solid #d9e6fa;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.drawer-auth-logged-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-user-details {
  display: flex;
  flex-direction: column;
}

.drawer-user-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #172b4d;
}

.drawer-user-email {
  font-size: 0.75rem;
  color: #627d98;
}

.drawer-auth-logged-out {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.drawer-auth-msg {
  font-size: 0.8rem;
  color: #486581;
  line-height: 1.4;
  margin: 0;
}

/* 3. 인증 모달 (로그인 / 회원가입) */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 42, 67, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.auth-modal {
  background: #fff;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(16, 42, 67, 0.24);
  padding: 28px 24px;
  position: relative;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s ease;
}

.auth-modal-overlay.is-active .auth-modal {
  transform: translateY(0) scale(1);
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f4f8;
  color: #627d98;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.auth-modal-close:hover {
  background: #d9e2ec;
  color: #102a43;
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-modal-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.auth-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #102a43;
  margin: 0 0 6px;
}

.auth-modal-subtitle {
  font-size: 0.85rem;
  color: #627d98;
  margin: 0;
}

/* 모달 탭 */
.auth-tabs {
  display: flex;
  background: #f0f4f8;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: #627d98;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.is-active {
  background: #fff;
  color: #2768c8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* 소셜 로그인 버튼 */
.social-login-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.google-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334e68;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.google-login-btn:hover {
  background: #f8fafc;
  border-color: #bcccdc;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.google-icon-svg {
  width: 20px;
  height: 20px;
}

/* 구분선 */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: #9fb3c8;
  font-size: 0.78rem;
}

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

.auth-divider span {
  padding: 0 12px;
}

/* 폼 필드 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.auth-form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334e68;
}

.auth-form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d8e2ec;
  border-radius: 9px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8fafc;
}

.auth-form-input:focus {
  border-color: #2768c8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(39, 104, 200, 0.15);
}

.auth-form-helper {
  font-size: 0.74rem;
  color: #829ab1;
  margin: 2px 0 0;
}

/* 법적 동의 체크박스 영역 (약관) */
.terms-agreement-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}

.terms-all-check {
  font-weight: 700;
  color: #102a43;
  padding-bottom: 8px;
  border-bottom: 1px dashed #d8e2ec;
}

.terms-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #486581;
}

.terms-item label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 500;
}

.terms-badge-required {
  color: #e12d39;
  font-weight: 700;
}

.terms-badge-optional {
  color: #829ab1;
  font-weight: 600;
}

.terms-view-btn {
  background: none;
  border: none;
  color: #2768c8;
  font-size: 0.76rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.terms-view-btn:hover {
  color: #1b53a3;
}

/* 에러 / 메시지 박스 */
.auth-message {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  display: none;
}

.auth-message.is-error {
  display: block;
  background: #ffe3e3;
  color: #c92a2a;
  border: 1px solid #ffa8a8;
}

.auth-message.is-success {
  display: block;
  background: #e6fcf5;
  color: #0ca678;
  border: 1px solid #96f2d7;
}

/* 모달 하단 보조 액션 */
.auth-sub-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 0.8rem;
}

.auth-link {
  color: #2768c8;
  text-decoration: none;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

/* 4. 약관 전문 팝업 모달 */
.terms-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 42, 67, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.terms-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.terms-modal {
  background: #fff;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(16, 42, 67, 0.3);
  overflow: hidden;
}

.terms-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terms-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #102a43;
  margin: 0;
}

.terms-modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #334e68;
}

.terms-modal-body h4 {
  margin: 16px 0 6px;
  color: #102a43;
  font-size: 0.95rem;
}

.terms-modal-body p,
.terms-modal-body ul {
  margin: 0 0 10px;
}

.terms-modal-body ul {
  padding-left: 20px;
}

.terms-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  background: #f8fafc;
}

/* 5. 페이지 잠금 게이트 (Auth Gate - packing.html, gear.html) */
.auth-gate-container {
  display: block;
  max-width: 560px;
  margin: 50px auto 60px;
  background: #fff;
  border-radius: 20px;
  padding: 44px 30px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(39, 104, 200, 0.14);
  border: 1.5px solid #d0e2fa;
}

.auth-gate-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: inline-block;
  animation: floatIcon 3s ease-in-out infinite;
}

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

.auth-gate-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #102a43;
  margin: 0 0 10px;
}

.auth-gate-desc {
  font-size: 0.95rem;
  color: #486581;
  line-height: 1.6;
  margin: 0 0 26px;
  word-break: keep-all;
}

.auth-gate-features {
  background: #f4f8ff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 26px;
  text-align: left;
}

.auth-gate-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #243b53;
  margin-bottom: 8px;
}

.auth-gate-feature-item:last-child {
  margin-bottom: 0;
}

.auth-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}

.auth-gate-actions .google-login-btn {
  padding: 12px 18px;
  font-size: 0.96rem;
}

.auth-gate-actions .auth-btn-primary {
  padding: 12px 18px;
  font-size: 0.96rem;
}

.auth-gate-back-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.84rem;
  color: #829ab1;
  text-decoration: none;
}

.auth-gate-back-link:hover {
  color: #2768c8;
  text-decoration: underline;
}

/* 6. 관리자 배지 및 관리자 게이트 스타일 */
.auth-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fff1f0;
  color: #cf1322;
  border: 1px solid #ffa39e;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  letter-spacing: -0.2px;
}

.drawer-admin-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fff1f0;
  color: #cf1322;
  border: 1px solid #ffa39e;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.nav-item-badge.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #fff1f0;
  color: #cf1322;
  border: 1px solid #ffa39e;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

.admin-gate-container {
  border-color: #ffccc7 !important;
  box-shadow: 0 16px 40px rgba(207, 19, 34, 0.1) !important;
}

/* 미디어 쿼리 (모바일 대응) */
@media (max-width: 600px) {
  .auth-header-bar {
    top: 12px;
    right: 12px;
  }
  .auth-user-name {
    display: none;
  }
  .auth-modal {
    padding: 24px 18px;
  }
  .auth-gate-container {
    padding: 30px 18px;
    margin: 20px 12px;
  }
}

