/* ── 스트리머 카페 공용 토큰 시스템 (v0.1.0) ──
   색: 잉크 #232A36 / 종이 #F5F7FB / 카드 #FFF / 라인 #E3E8F2 / 브랜드 바이올렛 #6D5DF6 / 앰버 #FFAE43
   서체: Pretendard(본문) + Jua(디스플레이, 절제 사용)
   시그니처: 위젯 카드 상단 컬러 탭(폴더 인덱스) */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');
@import url('https://fonts.googleapis.com/css2?family=Jua&family=Noto+Sans+KR:wght@400;700&family=Nanum+Gothic:wght@400;700&family=Gothic+A1:wght@400;700&display=swap');

:root {
  --ink: #232A36;
  --paper: #F5F7FB;
  --card: #FFFFFF;
  --line: #E3E8F2;
  --brand: #6D5DF6;
  --brand-soft: #EEEBFE;
  --amber: #FFAE43;
  --muted: #7A8499;
  --danger: #E5484D;
  --radius: 14px;
  --font-body: 'Pretendard', 'Noto Sans KR', system-ui, sans-serif;
  --font-display: 'Jua', 'Pretendard', sans-serif;
  --shadow: 0 2px 10px rgba(35, 42, 54, .07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* sticky footer: 내용이 짧아도 풋터가 항상 화면 바닥에 */
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* 포커스 표시 유지 (제거 금지) */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #5a4ae0; border-color: #5a4ae0; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: #fdf0f0; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }

/* ── 폼 ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--muted); }
.input, .field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=date], .field input[type=datetime-local], .field input[type=number],
.field input[type=url], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); outline: none; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── 카드 ── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ── 모달 (공용 — alert/confirm 대체) ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(35, 42, 54, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: var(--card); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.2);
  width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto;
  padding: 22px;
}
.modal.modal-wide { max-width: 640px; }
.modal h3 { font-size: 17px; margin-bottom: 14px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ── 토스트 ── */
#toast-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 2000; align-items: center;
}
.toast {
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow); animation: toast-in .25s ease;
  max-width: 90vw;
}
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── 상단 바 (플랫폼 공용) ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(14px, 4vw, 32px); background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100;
}
.topbar .logo { font-family: var(--font-display); font-size: 21px; color: var(--brand); }
.topbar .actions { display: flex; gap: 8px; align-items: center; }
.topbar .who { font-size: 13px; color: var(--muted); margin-right: 4px; }

.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 14px; }

/* ── 링크형 버튼 (모달 내 보조 동작) ── */
.btn-link { border: none; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; }
.btn-link:hover { color: var(--brand); }

/* ── 약관 동의 ── */
.agree-box { background: var(--paper); border-radius: 10px; padding: 12px 14px; }
.agree-line { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; cursor: pointer; }
.agree-line a { color: var(--brand); text-decoration: underline; }

/* ── 공통 풋터 (전 페이지, bot.mangul.kr 패턴) ── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 14px clamp(14px, 4vw, 24px);
  background: var(--card);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px 0;
  font-size: 11.5px; color: var(--muted);
  margin-top: auto; /* sticky footer — 남는 공간을 위로 밀어 항상 바닥 */
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; }
.footer-links a { padding: 0 10px; border-right: 1px solid var(--line); line-height: 1; }
.footer-links a:first-child { padding-left: 0; }
.footer-links a:last-child { border-right: none; }
.footer-copy { text-align: center; flex: 1; }
.footer-contact { text-align: right; }
@media (max-width: 640px) {
  .site-footer { flex-direction: column; gap: 8px; }
  .footer-copy, .footer-contact { text-align: left; flex: none; }
}
