@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* CSS Reset & Defaults */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Light mode - 선명하고 시원한 문서/Admin 팔레트 */
  --bg-color: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --brand-primary: #4E8EED;
  --brand-primary-hover: #3f79d1;
  --border-color: #e5e7eb;
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.07);
  --shadow-md: 0 4px 12px -1px rgb(0 0 0 / 0.12), 0 2px 6px -2px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 20px 40px -5px rgb(0 0 0 / 0.15), 0 8px 16px -6px rgb(0 0 0 / 0.1);
  --radius-md: 8px;
  --radius-lg: 16px;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(0, 0, 0, 0.08);
  --page-bg: #eaf2fc;
  --page-grad: linear-gradient(135deg, #e8eef7 0%, #dce6f2 100%);
}

[data-theme='dark'] {
  --bg-color: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --brand-primary: #6366f1;
  --brand-primary-hover: #818cf8;
  --border-color: #2d3a4e;
  --input-bg: #1e293b;
  --input-border: #3d4f65;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 20px 40px -5px rgb(0 0 0 / 0.6), 0 8px 16px -6px rgb(0 0 0 / 0.5);
  --glass-bg: rgba(15, 23, 42, 0.97);
  --glass-border: rgba(255, 255, 255, 0.08);
  --page-bg: #0f172a;
  --page-grad: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

html {
  height: 100%;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  color: var(--text-primary);
  /* 100% 대신 100dvh를 써서 모바일 브라우저 상단바까지 계산하자 */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 가로 중앙 */
  justify-content: center;
  /* 세로 중앙 (핵심!) */
  background: var(--page-grad);
  background-color: var(--page-bg);
  background-attachment: fixed;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* Base Form Inputs reset that previously relied on common.css
   라디오/체크는 native 또는 legacy-forms-lists의 전용 스타일을 쓰므로 제외 */
input:not([type="radio"]):not([type="checkbox"]),
button {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  appearance: none;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  border-radius: 99px;
  cursor: pointer;
  z-index: 999;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

/* 요구사항: 다크모드 토글 버튼 비노출 */
.theme-toggle-btn {
  display: none !important;
}

.theme-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* AUTHENTICATION LAYOUT */
.auth-wrapper {
  width: 100%;
  max-width: 480px;
  padding: 0 1.25rem;
  /* margin-top: clamp(...) 제거! */
  /* margin-bottom 제거! */
  display: flex;
  flex-direction: column;
  z-index: 10;
  /* 배경보다 위에 오도록 */
}

.auth-card {
  width: 100%;
  padding: 3rem 2.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-header p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 1.25rem;
  width: 100%;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* 상단 input 리셋보다 특이도 높임 — 로그인 입력 테두리 표시 */
.form-group input.mod-input {
  width: 100%;
  height: 52px;
  padding: 0 1rem;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input.mod-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-group input.mod-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.auth-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-primary {
  width: 100%;
  height: 52px;
  background-color: var(--brand-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  width: 100%;
  height: 52px;
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--input-border);
}

/* Mobile specifically */
@media (max-width: 480px) {
  .auth-card {
    padding: 2.5rem 1.5rem;
  }

  .auth-header h1 {
    font-size: 1.5rem;
  }

  .theme-toggle-btn {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.5rem 0.8rem;
  }
}

/* 이미지 확대(#imgModal): 인라인 스타일만 쓰는 페이지 공통 — 대시보드 팝업·슬라이드 메뉴보다 위 */
#imgModal {
  z-index: 10050;
}

#imgModal .img-modal-close {
  /* flex 내부 absolute 이슈 방지: 전체 화면 오버레이와 동일 영역 기준 오른쪽 상단 고정 */
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: auto;
  bottom: auto;
  z-index: 10051;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: #f9fafb;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#imgModal .img-modal-close:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.55);
}