/* ===============================================================
   공통 헤더 · 푸터
   ---------------------------------------------------------------
   일반 화면은 Bootstrap, 랜딩 화면은 Tailwind 로 본문을 그린다.
   둘을 한 페이지에 같이 올리면 서로 초기화 규칙이 충돌하므로,
   헤더와 푸터만 프레임워크 없는 CSS 로 따로 만들어 양쪽에서 같이 쓴다.
   두 스타일시트보다 뒤에 실려야 하므로 항상 마지막에 로드한다.
   =============================================================== */

:root {
  --ch-bg:      #060b16;
  --ch-bar:     rgba(8, 14, 28, .88);
  --ch-line:    rgba(255, 255, 255, .08);
  --ch-gold:    #fbbf24;
  --ch-gold-d:  #d97706;
  --ch-text:    #cbd5e1;
  --ch-dim:     #64748b;
  --ch-dimmer:  #475569;
}

/* ── 헤더 ─────────────────────────────────────────────── */
.ch-head {
  position: sticky; top: 0; z-index: 1030;
  background: var(--ch-bar);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ch-line);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Malgun Gothic', sans-serif;
}
.ch-inner {
  max-width: 80rem; margin: 0 auto; padding: 0 1.5rem;
  height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.ch-brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; flex: none; }
.ch-mark {
  width: 2rem; height: 2rem; border-radius: .5rem;
  background: linear-gradient(135deg, #fbbf24, var(--ch-gold-d));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 15px -3px rgba(245, 158, 11, .2);
  color: #020617; flex: none;
}
.ch-name {
  font-size: 1.5rem; font-weight: 700; font-style: italic;
  letter-spacing: -.025em; color: #fff; white-space: nowrap;
}
.ch-name b { color: var(--ch-gold); font-weight: 700; }
.ch-badge {
  margin-left: .4rem; padding: .15rem .45rem; border-radius: .3rem;
  background: #dc2626; color: #fff;
  font-size: .625rem; font-weight: 700; font-style: normal; letter-spacing: .04em;
  vertical-align: middle;
}

/* 메뉴 묶음 */
.ch-nav {
  display: flex; align-items: center; gap: 1.6rem;
  font-size: .875rem; font-weight: 500;
}
.ch-nav a { color: var(--ch-text); text-decoration: none; transition: color .15s ease; white-space: nowrap; }
.ch-nav a:hover { color: var(--ch-gold); }
.ch-nav a.is-on { color: var(--ch-gold); }
.ch-nav a:focus-visible,
.ch-head button:focus-visible { outline: 2px solid var(--ch-gold); outline-offset: 3px; border-radius: 3px; }

.ch-right { display: flex; align-items: center; gap: .75rem; }
.ch-who { font-size: .8rem; color: #94a3b8; white-space: nowrap; }

/* 버튼 세 종류 */
.ch-btn {
  display: inline-block; padding: .5rem 1.1rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent; background: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ch-btn-gold {
  background: linear-gradient(135deg, rgba(212, 175, 55, .1), rgba(212, 175, 55, .05));
  border-color: rgba(251, 191, 36, .3); color: var(--ch-gold);
}
.ch-btn-gold:hover { background: rgba(251, 191, 36, .12); }
.ch-btn-ghost { border-color: rgba(255, 255, 255, .18); color: #e2e8f0; }
.ch-btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .35); }
.ch-btn-solid {
  background: linear-gradient(135deg, #fbbf24, var(--ch-gold-d));
  color: #1f2937; border-color: transparent;
}
.ch-btn-solid:hover { filter: brightness(1.06); }

/* 「설정」 드롭다운 */
.ch-drop { position: relative; }
.ch-drop > button {
  display: inline-flex; align-items: center; gap: .3rem;
  background: none; border: 0; padding: 0;
  font: inherit; color: var(--ch-text); cursor: pointer;
}
.ch-drop > button:hover,
.ch-drop.is-open > button,
.ch-drop.is-active > button { color: var(--ch-gold); }
.ch-drop > button::after {
  content: ''; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
}
.ch-menu {
  position: absolute; right: 0; top: calc(100% + .9rem);
  min-width: 10rem; padding: .4rem; margin: 0;
  list-style: none; border-radius: .6rem;
  background: #0f172a; border: 1px solid var(--ch-line);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .7);
  display: none;
}
.ch-drop.is-open .ch-menu { display: block; }
.ch-menu a {
  display: block; padding: .5rem .7rem; border-radius: .4rem;
  font-size: .82rem; color: var(--ch-text);
}
.ch-menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.ch-menu a.is-on { background: rgba(251, 191, 36, .14); color: var(--ch-gold); }

/* 햄버거 — 체크박스로 여닫아 자바스크립트 없이 동작한다 */
.ch-toggle { display: none; }
.ch-burger {
  display: none; width: 2.6rem; height: 2.2rem;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: .4rem;
  background: none; cursor: pointer; padding: 0;
  align-items: center; justify-content: center; flex: none;
}
.ch-burger span {
  display: block; width: 1.1rem; height: 2px; background: #e2e8f0;
  position: relative;
}
.ch-burger span::before,
.ch-burger span::after {
  content: ''; position: absolute; left: 0; width: 100%; height: 2px; background: inherit;
}
.ch-burger span::before { top: -6px; }
.ch-burger span::after  { top: 6px; }

@media (max-width: 991.98px) {
  .ch-burger { display: flex; }
  .ch-panel {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: #0b1120; border-bottom: 1px solid var(--ch-line);
    padding: .5rem 1.5rem 1.25rem;
    max-height: calc(100vh - 5rem); overflow-y: auto;
  }
  .ch-toggle:checked ~ .ch-panel { display: block; }

  .ch-nav, .ch-right { display: block; }
  .ch-nav a {
    display: block; padding: .7rem .15rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
  }
  .ch-right { margin-top: 1rem; }
  .ch-who { display: block; padding: 0 .15rem .6rem; }
  .ch-btn { display: block; width: 100%; text-align: center; padding: .65rem 1rem; margin-top: .5rem; }
  .ch-form { display: block; width: 100%; }

  .ch-drop > button {
    display: flex; width: 100%; justify-content: space-between;
    padding: .7rem .15rem; border-bottom: 1px solid rgba(255, 255, 255, .06);
  }
  .ch-menu {
    position: static; display: block; min-width: 0;
    margin: .35rem 0 .5rem; background: rgba(255, 255, 255, .04);
    box-shadow: none;
  }
}
@media (min-width: 992px) {
  .ch-panel { display: flex !important; align-items: center; gap: 1.6rem; }
}

/* ── 푸터 ─────────────────────────────────────────────── */
.ch-foot {
  background: var(--ch-bg);
  border-top: 1px solid var(--ch-line);
  color: var(--ch-dim);
  font-size: .8rem; line-height: 1.7;
  padding: 3.5rem 0 2rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Malgun Gothic', sans-serif;
}
.ch-foot a { color: var(--ch-dim); text-decoration: none; transition: color .15s ease; }
.ch-foot a:hover { color: #94a3b8; }
.ch-foot a:focus-visible { outline: 2px solid var(--ch-gold); outline-offset: 3px; border-radius: 2px; }
.ch-foot-inner { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }

.ch-biz {
  display: flex; flex-wrap: wrap; gap: .25rem 1.5rem;
  padding-bottom: 2rem; color: var(--ch-dimmer); font-size: .75rem;
}

.ch-foot-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--ch-line); padding-top: 2.5rem;
  font-size: .75rem;
}
.ch-foot-brand { display: flex; align-items: center; gap: .5rem; }
.ch-foot-mark {
  width: 1.5rem; height: 1.5rem; border-radius: .3rem;
  background: #1e293b; color: #94a3b8;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.ch-foot-brand span { font-weight: 700; letter-spacing: -.01em; color: #94a3b8; }
.ch-foot-links { display: flex; flex-wrap: wrap; gap: 2rem; }

.ch-note {
  margin-top: 2rem; max-width: 74ch;
  font-size: .72rem; line-height: 1.75; color: var(--ch-dimmer);
}

@media (max-width: 767.98px) {
  .ch-foot { padding-top: 2.5rem; }
  .ch-foot-row { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .ch-foot-links { gap: 1.25rem; }
}

/* 본문이 짧아도 푸터가 화면 바닥에 붙어 있게 한다 */
html { height: 100%; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main,
body > .ch-body { flex: 1 0 auto; }
body > .ch-foot { flex-shrink: 0; }

/* ------------------------------------------------------------------
   대화상자 (SweetAlert2)

   바탕은 라이브러리의 theme: 'dark' 를 쓴다. 새 옵션이 생겨도 따라간다.
   다만 기본 다크는 순수 검정에 회색 버튼이라 사이트의 남색·금색과 겉돈다.
   그래서 배색만 헤더·카드와 같은 값으로 덮는다.
   ------------------------------------------------------------------ */
.swal2-popup {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, .1) !important;
  border-radius: 1rem !important;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, .8) !important;
}
.swal2-title { color: #ffffff !important; font-size: 1.2rem !important; font-weight: 700 !important; }
.swal2-html-container { color: #94a3b8 !important; font-size: .9rem !important; line-height: 1.75 !important; }
.swal2-backdrop-show { background: rgba(2, 6, 16, .72) !important; }

/* 확인 — 헤더의 금색 버튼과 같은 색 */
.swal2-styled.swal2-confirm {
  background: linear-gradient(135deg, #fbbf24, #d97706) !important;
  color: #1f2937 !important; font-weight: 700 !important;
  border-radius: .6rem !important; box-shadow: none !important;
}
.swal2-styled.swal2-confirm:hover { filter: brightness(1.07); }

/* 환불처럼 되돌릴 수 없는 동작은 색으로도 구별한다 */
.swal2-styled.swal2-confirm.dl-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c) !important; color: #ffffff !important;
}

/* 취소 — 기본 다크의 회색 덩어리 대신 고스트 버튼 */
.swal2-styled.swal2-cancel {
  background: rgba(255, 255, 255, .06) !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  color: #cbd5e1 !important; font-weight: 600 !important;
  border-radius: .6rem !important; box-shadow: none !important;
}
.swal2-styled.swal2-cancel:hover { background: rgba(255, 255, 255, .12) !important; }
.swal2-styled:focus { box-shadow: 0 0 0 3px rgba(251, 191, 36, .35) !important; }

/* 입력칸 (출금 TXID · 반려 사유) */
.swal2-input, .swal2-textarea {
  background: rgba(255, 255, 255, .05) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  border-radius: .55rem !important;
  color: #f1f5f9 !important; box-shadow: none !important;
}
.swal2-input::placeholder { color: #475569 !important; }
.swal2-input:focus, .swal2-textarea:focus {
  border-color: rgba(251, 191, 36, .6) !important;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .2) !important;
}
.swal2-validation-message {
  background: rgba(239, 68, 68, .12) !important; color: #fca5a5 !important; border-radius: .5rem;
}
.swal2-validation-message::before { background: #ef4444 !important; color: #fff !important; }

/* ===============================================================
   대리 보기 띠 — 관리자가 회원 화면을 보고 있을 때만 나온다
   화면 맨 위에 계속 붙어 있어야 조작 전에 눈에 들어온다.
   =============================================================== */
.imp-bar {
  position: sticky; top: 0; z-index: 2000;
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
  padding: .5rem .9rem;
  background: #7f1d1d; color: #fee2e2;
  font: 600 .82rem/1.4 system-ui, -apple-system, "Malgun Gothic", sans-serif;
  border-bottom: 2px solid #dc2626;
}
.imp-tag {
  background: #fef2f2; color: #7f1d1d; border-radius: .25rem;
  padding: .1rem .45rem; font-size: .72rem; font-weight: 800; letter-spacing: .02em;
}
.imp-who { color: #fff; font-weight: 500; }
.imp-who b { font-weight: 800; }
.imp-by   { color: #fca5a5; font-weight: 500; font-size: .76rem; }
.imp-form { margin: 0 0 0 auto; }
.imp-btn {
  background: #fff; color: #7f1d1d; border: 0; border-radius: .3rem;
  padding: .25rem .7rem; font-size: .78rem; font-weight: 800; cursor: pointer;
}
.imp-btn:hover { background: #fee2e2; }
/* 띠가 늘 보이도록 본문 상단 여백을 조금 준다 */
.imp-on { scroll-padding-top: 3rem; }

@media (max-width: 575.98px) {
  .imp-bar { font-size: .76rem; padding: .45rem .6rem; }
  .imp-by  { display: none; }
}
