@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;800&display=swap');

:root {
  --cw-blue: #1069a8;
  --cw-purple: #672074;
  --cw-btn: #6050a7;          /* 메인 버튼 보라 */
  --cw-btn-d: #514593;
  --cw-req: #2e4dd9;          /* (필수) 파랑 */
  --cw-opt: #8750af;          /* (선택) 보라 */
  --cw-ink: #20242e;
  --cw-grey: #8a8f9c;
  --cw-line: #d9dbe3;
  --cw-field: #ffffff;
  --cw-bg: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  color: var(--cw-ink);
  background: #eef1f6;
  -webkit-text-size-adjust: 100%;
}

/* ---------------- 사전등록 페이지 ---------------- */
.cw-page { min-height: 100vh; display: flex; justify-content: center; }
.cw-wrap {
  width: 100%; max-width: 760px; background: var(--cw-bg);
  box-shadow: 0 0 40px rgba(0,0,0,.06); min-height: 100vh;
  display: flex; flex-direction: column;
}

/* 하단 그라데이션 바 (시안) */
.cw-footbar {
  margin-top: auto;
  height: 16px;
  background: linear-gradient(110deg, var(--cw-blue) 0%, var(--cw-purple) 100%);
}

/* 배너 (이미지 full-bleed) */
.cw-banner { display: block; }
.cw-banner img { display: block; width: 100%; height: auto; }

/* 본문 */
.cw-body { padding: 34px 40px 60px; }
.cw-formhead { margin-bottom: 22px; }
.cw-title { font-size: 26px; font-weight: 800; margin: 0 0 14px; color: #111; }
.cw-lead { font-size: 15px; font-weight: 700; color: #2b2f3a; margin: 0; word-break: keep-all; }

/* 입력 필드 */
.cw-form { margin-top: 6px; }
.cw-field {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--cw-line); border-radius: 8px;
  padding: 0 16px; margin-bottom: 12px; background: var(--cw-field);
}
.cw-label {
  flex: 0 0 64px; font-size: 14px; font-weight: 700; color: #2b2f3a;
  position: relative; padding-left: 12px; letter-spacing: .02em;
}
.cw-label::before { content: '*'; position: absolute; left: 0; color: #e0392b; font-weight: 700; }
.cw-input {
  flex: 1 1 auto; border: none; background: transparent;
  padding: 15px 2px; font-size: 15px; font-family: inherit; color: var(--cw-ink); min-width: 0;
}
.cw-input:focus { outline: none; }
.cw-field:focus-within { border-color: var(--cw-btn); box-shadow: 0 0 0 2px rgba(96,80,167,.12); }

/* 개인정보 안내문 */
.cw-privacy { font-size: 12px; line-height: 1.7; color: #6a6f7c; margin: 22px 0 16px; word-break: keep-all; }

/* 동의 체크박스 */
.cw-agrees { display: flex; flex-direction: column; gap: 12px; }
.cw-agree { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.cw-agree__txt { color: #2b2f3a; }
.cw-agree--all .cw-agree__txt { font-weight: 700; }
.cw-tag { font-weight: 700; }
.cw-tag--req { color: var(--cw-req); }
.cw-tag--opt { color: var(--cw-opt); }

/* 사각형 체크 마커 */
.cw-agree input {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto; width: 20px; height: 20px; margin: 0;
  border: 1.5px solid #b9bdc9; border-radius: 4px; background: #fff;
  position: relative; cursor: pointer;
}
.cw-agree input:checked { background: var(--cw-btn); border-color: var(--cw-btn); }
.cw-agree input:checked::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* "보기" 링크 — 오른쪽 끝 */
.cw-view {
  margin-left: auto; border: none; background: none;
  color: #6a6f7c; font-size: 13px; font-family: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; padding: 4px;
}
.cw-view:hover { color: var(--cw-btn); }

/* 버튼 */
.cw-actions { display: flex; justify-content: center; margin-top: 30px; }
.cw-btn {
  display: inline-block; border: none; border-radius: 26px;
  background: var(--cw-btn); color: #fff;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; text-align: center; text-decoration: none; transition: background .15s;
}
.cw-btn:hover { background: var(--cw-btn-d); }
.cw-btn:active { transform: translateY(1px); }
.cw-btn:disabled { opacity: .55; cursor: default; }
.cw-btn--submit { width: 100%; max-width: 220px; padding: 15px 30px; box-shadow: 0 6px 16px rgba(96,80,167,.32); }

/* ---------------- 약관 팝업 (모달) ---------------- */
.cw-noscroll { overflow: hidden; }
.cw-modal, .cw-alert {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(20,24,40,.55);
  align-items: center; justify-content: center; padding: 20px;
}
.cw-modal.on, .cw-alert.on { display: flex; }

/* 시안 PNG 팝업 이미지 + 클릭 핫스팟 오버레이 */
.cw-pop {
  position: relative;
  display: inline-block;
  line-height: 0;
  width: min(520px, 92vw);
}
.cw-popimg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
/* 이미지 위 투명 클릭 영역 (확인 / X) — % 좌표는 이미지 비율 기준 자동 정렬 */
.cw-pop__hot {
  position: absolute;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cw-pop__hot--x   { top: 0.5%;  right: 1%;  width: 14%; height: 8.5%; }
.cw-pop__hot--okt { left: 36%;  top: 85%;   width: 28%; height: 8%;   }  /* 약관 팝업 확인 */
.cw-pop__hot--oka { left: 36%;  top: 74.6%; width: 28%; height: 8.6%; }  /* 알림 팝업 확인 */

.cw-modal__panel {
  width: 100%; max-width: 640px; max-height: 90vh; overflow: hidden;
  background: #fff; border-radius: 14px; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.cw-modal__head {
  position: relative; padding: 30px 32px;
  background: linear-gradient(110deg, var(--cw-blue) 0%, var(--cw-purple) 100%);
  color: #fff;
}
.cw-modal__brand { margin: 0; font-size: 30px; font-weight: 400; line-height: 1.1; text-shadow: 0 1px 10px rgba(255,255,255,.25); }
.cw-modal__brand b { font-weight: 800; }
.cw-modal__x {
  position: absolute; top: 18px; right: 18px; width: 38px; height: 38px;
  border: none; border-radius: 8px; background: rgba(255,255,255,.22);
  color: #fff; font-size: 18px; cursor: pointer;
}
.cw-modal__x:hover { background: rgba(255,255,255,.34); }

.cw-modal__body { padding: 30px 32px; overflow-y: auto; }
.cw-modal__title { font-size: 21px; font-weight: 800; margin: 0 0 20px; color: #111; }
.cw-modal__title span { margin-left: 2px; }

.cw-terms { width: 100%; border-collapse: collapse; font-size: 14px; }
.cw-terms th, .cw-terms td {
  border: 1px solid #dfe1e8; padding: 14px 16px; text-align: left; vertical-align: middle; line-height: 1.55;
}
.cw-terms th { width: 34%; background: #f1f2f5; font-weight: 700; color: #2b2f3a; white-space: nowrap; }
.cw-terms td { color: #33373f; word-break: break-word; }
.cw-terms__note {
  border: 1px solid #dfe1e8; border-top: none; margin: 0;
  padding: 18px 16px; font-size: 14px; line-height: 1.6; color: #33373f;
}

.cw-modal__foot { padding: 10px 32px 34px; text-align: center; }
.cw-btn--confirm { min-width: 300px; padding: 16px 30px; font-size: 17px; letter-spacing: .25em; border-radius: 30px; }

/* ---------------- 알림 팝업 (미동의 / 완료) ---------------- */
.cw-alert__panel {
  position: relative; width: 100%; max-width: 340px;
  border-radius: 16px; padding: 26px 24px 30px; text-align: center;
  background: linear-gradient(150deg, var(--cw-blue) 0%, var(--cw-purple) 100%);
  color: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.cw-alert__x {
  position: absolute; top: 14px; right: 16px; width: 28px; height: 28px;
  border: none; background: none; color: #fff; font-size: 18px; cursor: pointer; opacity: .85;
}
.cw-alert__brand { margin: 6px 0 18px; font-size: 26px; font-weight: 400; line-height: 1.15; }
.cw-alert__brand b { font-weight: 800; }
.cw-alert__box {
  background: #fff; border-radius: 12px; padding: 26px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 20px;
}
.cw-alert__icon {
  width: 44px; height: 44px; border-radius: 50%; line-height: 44px;
  font-size: 26px; font-weight: 800; color: #fff;
}
.cw-alert__icon--warn { background: #7b5fc0; }
.cw-alert__icon--ok { background: #6f4fb3; }
.cw-alert__msg { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.45; color: var(--cw-purple); }
.cw-btn--alert {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.6);
  min-width: 120px; padding: 11px 28px; border-radius: 24px;
}
.cw-btn--alert:hover { background: rgba(255,255,255,.28); }
.cw-alert__logos {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 20px; font-size: 13px; font-weight: 700; opacity: .92;
}
.cw-alert__logos i { width: 1px; height: 13px; background: rgba(255,255,255,.5); display: inline-block; }

/* ---------------- 관리자 로그인 ---------------- */
.cw-page--admin { align-items: center; background: #eef1f6; }
.cw-login {
  width: 100%; max-width: 360px; margin: auto; padding: 36px 30px;
  background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.08); text-align: center;
}
.cw-login__brand { margin: 0 0 4px; font-size: 22px; font-weight: 400; color: var(--cw-purple); }
.cw-login__brand b { font-weight: 800; }
.cw-login__sub { font-size: 14px; color: var(--cw-grey); margin: 0 0 20px; }
.cw-login__error { color: #c0392b; font-size: 13px; margin: -8px 0 12px; }
.cw-login .cw-input {
  width: 100%; border: 1px solid var(--cw-line); border-radius: 10px;
  padding: 13px 14px; margin-bottom: 14px; font-size: 15px;
}
.cw-login .cw-btn--submit { max-width: none; }

/* ---------------- 관리자 대시보드 ---------------- */
.cw-admin { background: #eef1f6; min-height: 100vh; }
.cw-newbanner {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: #6a3f9e; color: #fff; text-align: center; padding: 11px 14px;
  font-size: 14px; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.22);
}
.cw-newbanner.on { display: block; }
.cw-newbanner .cw-btn { margin-left: 12px; background: #fff; color: #6a3f9e; padding: 6px 16px; }
.cw-newbanner .cw-btn:hover { background: #f0e9f7; }

.cw-admin__head {
  display: flex; align-items: center; gap: 14px; background: #fff;
  padding: 14px 24px; border-bottom: 3px solid var(--cw-purple);
  position: sticky; top: 0; z-index: 10;
}
.cw-admin__head h1 { font-size: 17px; margin: 0; flex: 1; color: var(--cw-purple); }
.cw-admin__logout { font-size: 13px; color: var(--cw-grey); text-decoration: none; }
.cw-admin__logout:hover { color: var(--cw-purple); }

.cw-admin__wrap { max-width: 1100px; margin: 0 auto; padding: 22px 18px 60px; }
.cw-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.cw-stat { background: #fff; border-radius: 12px; padding: 14px 24px; min-width: 130px; box-shadow: 0 2px 10px rgba(40,30,80,.06); text-align: center; }
.cw-stat b { display: block; font-size: 26px; color: var(--cw-purple); }
.cw-stat span { font-size: 12px; color: var(--cw-grey); }

.cw-sec { background: #fff; border-radius: 12px; padding: 18px 20px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(40,30,80,.06); }
.cw-sec h2 { font-size: 16px; margin: 0 0 14px; color: var(--cw-purple); }
.cw-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cw-btn--sm { padding: 9px 18px; font-size: 14px; border-radius: 8px; }
.cw-empty { color: var(--cw-grey); font-size: 14px; margin: 4px 0; }

.cw-table-wrap { overflow-x: auto; }
.cw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cw-table th, .cw-table td { border: 1px solid var(--cw-line); padding: 8px 10px; text-align: left; vertical-align: top; white-space: nowrap; }
.cw-table th { background: #f4f2f8; color: var(--cw-ink); font-weight: 700; }
.cw-td-email { font-size: 12px; color: #4a4f5c; }
.cw-table tr.is-new { background: #f6effc; }
.cw-table tr.is-new td:first-child::after { content: ' ● NEW'; color: #6a3f9e; font-weight: 800; font-size: 11px; }

/* ---------------- 반응형 ---------------- */
@media (max-width: 640px) {
  .cw-wrap { max-width: 100%; box-shadow: none; }
  .cw-body { padding: 26px 20px 56px; }
  .cw-title { font-size: 22px; }
  .cw-lead { font-size: 14px; }
  .cw-label { flex-basis: 56px; font-size: 13px; }
  .cw-input { padding: 14px 2px; font-size: 14px; }
  .cw-agree { font-size: 13px; }
  .cw-modal__head { padding: 24px 22px; }
  .cw-modal__brand { font-size: 23px; }
  .cw-modal__body { padding: 22px; }
  .cw-modal__title { font-size: 18px; }
  .cw-terms th, .cw-terms td { padding: 11px 12px; font-size: 13px; }
  .cw-terms th { width: 38%; white-space: normal; }
  .cw-btn--confirm { min-width: 0; width: 100%; }
  .cw-modal__foot { padding: 8px 22px 26px; }
}
