/* ════════════════════════════════════════════════════════════════════
   소비자상인협동조합 — common.css
   전 페이지 공통: 색상·글꼴·버튼·카드·헤더·푸터·반응형
   설계: 딥블루(신뢰) + 그린(상생) · 모바일 우선 · 넓은 연령대 가독성
   ════════════════════════════════════════════════════════════════════ */

/* ── 디자인 토큰 ── */
:root {
  --blue:        #1b4d8f;   /* 조합 중심색 (신뢰) */
  --blue-dark:   #143a6c;
  --blue-light:  #e8f0fa;
  --green:       #2e9e5b;   /* 상생·지역·성장 */
  --green-dark:  #237a45;
  --green-light: #e6f6ec;
  --bg:          #f7fafc;
  --surface:     #ffffff;
  --text:        #1e293b;
  --text-dim:    #64748b;
  --line:        #e2e8f0;
  --radius:      14px;
  --radius-sm:   10px;
  --shadow:      0 2px 12px rgba(27,77,143,.07);
  --shadow-lg:   0 8px 28px rgba(27,77,143,.12);
  --max:         600px;     /* 모바일 우선 컨테이너 */
}

/* ── 리셋 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── 컨테이너 ── */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 18px; }

/* ════════════════════════════════════════════════════════════════════
   헤더 (상단 고정)
   ════════════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--green));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: 15px; font-weight: 800; color: var(--blue); white-space: nowrap; }
.brand-text span { font-size: 10px; color: var(--text-dim); white-space: nowrap; }

.header-right { display: flex; align-items: center; gap: 8px; }
.header-login {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 13px; border-radius: 99px;
  background: var(--blue-light); color: var(--blue);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.header-login:active { background: #d8e6f7; }
.header-login .hl-icon { font-size: 14px; }

.nav-toggle { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ''; position: absolute; left: 0; width: 20px; height: 2px; background: var(--text); border-radius: 2px;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* 모바일 드로어 메뉴 */
.nav-drawer {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,.45);
  opacity: 0; visibility: hidden; transition: opacity .22s;
}
.nav-drawer.open { opacity: 1; visibility: visible; }
.nav-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 78%; max-width: 320px;
  background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; padding: 20px;
}
.nav-drawer.open .nav-panel { transform: translateX(0); }
.nav-panel .nav-close { align-self: flex-end; font-size: 24px; color: var(--text-dim); width: 36px; height: 36px; }
.nav-panel a {
  padding: 14px 8px; font-size: 16px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
}
.nav-panel a:active { color: var(--blue); }
.nav-panel .nav-cta {
  margin-top: 16px; border: none; justify-content: center;
  background: var(--blue); color: #fff; border-radius: var(--radius-sm); font-weight: 700;
}

/* ════════════════════════════════════════════════════════════════════
   버튼
   ════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 22px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; text-align: center;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:active { background: var(--green-dark); }
.btn-outline { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-ghost { background: var(--blue-light); color: var(--blue); }
.btn-lg { padding: 16px 28px; font-size: 16px; width: 100%; }
.btn-block { width: 100%; }

/* ════════════════════════════════════════════════════════════════════
   섹션 · 카드
   ════════════════════════════════════════════════════════════════════ */
.section { padding: 40px 0; }
.section-head { margin-bottom: 22px; }
.section-eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .04em;
  color: var(--green); background: var(--green-light);
  padding: 4px 11px; border-radius: 99px; margin-bottom: 10px;
}
.section-title { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.35; }
.section-desc { margin-top: 8px; font-size: 14px; color: var(--text-dim); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 아이콘 카드 (조합 소개 등) */
.icon-card { text-align: left; }
.icon-card .ic {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 12px;
  background: var(--blue-light);
}
.icon-card.g .ic { background: var(--green-light); }
.icon-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 5px; }
.icon-card p { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }

/* ── 리스트 아이템 (공지 등) ── */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 4px; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
.list-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
  background: var(--blue-light); color: var(--blue); flex-shrink: 0;
}
.list-badge.pin { background: #fef3c7; color: #92400e; }
.list-body { flex: 1; min-width: 0; }
.list-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-date { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.list-arrow { color: var(--text-dim); font-size: 18px; flex-shrink: 0; }

/* ── 폼 ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.field label .req { color: var(--green); margin-left: 3px; }
.input, .textarea, .select {
  width: 100%; padding: 13px 14px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); transition: border-color .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--blue); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.field-hint { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.field-error { font-size: 12px; color: #dc2626; margin-top: 5px; display: none; }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select { border-color: #dc2626; }
.field.invalid .field-error { display: block; }

/* 라디오 선택 (조합원 유형 등) */
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  padding: 16px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  text-align: center; font-weight: 700; font-size: 14px; color: var(--text-dim);
  background: #fff; transition: all .15s;
}
.choice .emoji { font-size: 24px; display: block; margin-bottom: 6px; }
.choice.active { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }

/* ════════════════════════════════════════════════════════════════════
   푸터
   ════════════════════════════════════════════════════════════════════ */
.site-footer {
  background: #12294a; color: #cbd5e1; padding: 32px 0 26px; margin-top: 20px;
}
.site-footer .container { display: flex; flex-direction: column; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 9px; }
.footer-brand b { color: #fff; font-size: 15px; font-weight: 800; }
.footer-info { font-size: 12.5px; line-height: 1.7; color: #94a3b8; }
.footer-info b { color: #cbd5e1; font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; }
.footer-links a { color: #94a3b8; }
.footer-links a:active { color: #fff; }
.footer-copy { font-size: 11.5px; color: #64748b; border-top: 1px solid #1e3a5f; padding-top: 14px; }

/* ── TOP 버튼 ── */
.to-top {
  position: fixed; right: 16px; bottom: 20px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 20px;
  box-shadow: var(--shadow-lg);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .22s;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ── 공통 유틸 ── */
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.muted { color: var(--text-dim); }
.empty { text-align: center; color: var(--text-dim); padding: 30px 10px; font-size: 14px; }
.loading { text-align: center; color: var(--text-dim); padding: 24px; font-size: 13px; }
.badge-soft { display:inline-block; font-size:11px; font-weight:700; padding:3px 9px; border-radius:6px; background:var(--blue-light); color:var(--blue); }

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: #12294a; color: #fff; padding: 13px 22px; border-radius: 99px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transition: all .25s; z-index: 300; max-width: 90%;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b91c1c; }

/* ── 반응형: 아주 좁은 화면 ── */
@media (max-width: 360px) {
  .card-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 20px; }
}

/* ── 접근성: 모션 최소화 ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 키보드 포커스 가시성 */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
