/* =====================================================
   Basic Theme — 공통 CSS (변수·리셋·레이아웃·공용 컴포넌트)
   각 스킨 전용 CSS 는 /theme/basic/css/{skin}.css 에 위치
   ===================================================== */

/* ── CSS 변수 ──────────────────────────────────────── */
:root {
  --primary:     #2563eb;
  --primary-d:   #1d4ed8;
  --secondary:   #7c3aed;
  --accent:      #06b6d4;
  --text:        #1f2937;
  --text-muted:  #6b7280;
  --bg:          #f9fafb;
  --white:       #ffffff;
  --border:      #e5e7eb;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(0,0,0,.07);
  --shadow-lg:   0 8px 30px rgba(0,0,0,.12);
  --header-h:    70px;
  --content-w:   1200px;
}

/* ── 리셋 ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-d); }
img { max-width: 100%; height: auto; display: block; }

/* ── 컨테이너 ──────────────────────────────────────── */
.container        { max-width: var(--content-w); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ── 버튼 ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border: none; border-radius: 8px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: .2s; text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); opacity: .9; text-decoration: none; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline   { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-light     { background: #f3f4f6; color: var(--text); }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-sm        { padding: 6px 14px; font-size: .82rem; }
.btn-lg        { padding: 13px 28px; font-size: 1rem; }

/* ── 카드 ──────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden;
}
.card-body { padding: 24px; }

/* ── 그리드 ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── 섹션 공통 ─────────────────────────────────────── */
.section    { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; color: var(--text); margin-bottom: 12px; }
.section-title p  { color: var(--text-muted); font-size: 1rem; max-width: 500px; margin: 0 auto; }

/* ── 폼 ────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.form-label .req { color: #ef4444; margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .93rem; color: var(--text);
  background: #fff; transition: .2s; outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea.form-control { min-height: 140px; resize: vertical; }

/* ── 페이지네이션 ──────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 24px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; font-size: .88rem;
  border: 1px solid var(--border); color: var(--text); transition: .15s; text-decoration: none;
}
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

/* ── 플래시 메시지 ─────────────────────────────────── */
.flash         { padding: 14px 20px; border-radius: 8px; margin-bottom: 20px; font-size: .9rem; display: flex; align-items: center; gap: 10px; }
.flash-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.flash-error   { background: #fff5f5; border: 1px solid #fecaca; color: #dc2626; }
.flash-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.flash-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── 배지 ──────────────────────────────────────────── */
.badge         { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-danger  { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-gray    { background: #f3f4f6; color: #6b7280; }

/* ── 회원 폼 ───────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
}
.auth-card   { width: 100%; max-width: 440px; background: var(--white); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.auth-header { background: linear-gradient(135deg, var(--primary), var(--secondary)); padding: 32px; text-align: center; color: #fff; }
.auth-header h1 { font-size: 1.4rem; font-weight: 700; }
.auth-body   { padding: 32px; }

/* ── 유틸리티 ──────────────────────────────────────── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.fw-bold      { font-weight: 700; }
.mt-16 { margin-top: 16px; }   .mb-16 { margin-bottom: 16px; }
.mt-24 { margin-top: 24px; }   .mb-24 { margin-bottom: 24px; }
.mt-40 { margin-top: 40px; }   .py-40 { padding: 40px 0; }
.flex         { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-100  { width: 100%; }

/* ── 스크롤바 ──────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ── 로딩 스켈레톤 ─────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── 앵커 오프셋 ───────────────────────────────────── */
:target { scroll-margin-top: calc(var(--header-h) + 20px); }

/* ── 반응형 (공통) ─────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4          { grid-template-columns: 1fr 1fr; }
  .section         { padding: 50px 0; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
}
