/* ═══════════════════════════════════════════════════════════
   zakip.css  —  방패(Zakip) 공유 스타일시트  v1.0  2026-07-14
   모든 페이지: <link rel="stylesheet" href="/css/zakip.css">
   ═══════════════════════════════════════════════════════════ */

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


/* ── 1. Design Tokens ────────────────────────────────────── */
:root {
  /* Brand */
  --navy:    #1B2A4A;   /* primary — GNB, headings */
  --teal:    #0D7377;   /* action color */
  --teal-lt: #14BDBD;   /* accent, highlights */
  --mint:    #E8F8F8;   /* teal tinted surface */
  --sky:     #F0FAFA;   /* faintest teal surface */
  --white:   #FFFFFF;

  /* Neutrals */
  --gray1:   #F1F5F9;   /* table head, subtle fill */
  --gray2:   #E2E8F0;   /* borders, dividers */
  --gray3:   #94A3B8;   /* muted text, placeholders */
  --gray4:   #64748B;   /* secondary text, labels */
  --text:    #1E293B;   /* body text */
  --canvas:  #F8FAFC;   /* page background */
  --canvas-admin: #F0F4F8; /* admin page background */

  /* Status */
  --red:     #DC2626;
  --green:   #16A34A;
  --amber:   #D97706;
  --blue:    #2563EB;
  --red-bg:    #FEF2F2;
  --green-bg:  #F0FDF4;
  --amber-bg:  #FFFBEB;
  --blue-bg:   #EFF6FF;
  --gray-bg:   #F1F5F9;

  /* Risk report (계약서 위험도) */
  --risk-safe-bg: #ECFDF5; --risk-safe-bd: #6EE7B7; --risk-safe-fg: #065F46;
  --risk-warn-bg: #FFFBEB; --risk-warn-bd: #FCD34D; --risk-warn-fg: #92400E;
  --risk-high-bg: #FEF2F2; --risk-high-bd: #FCA5A5; --risk-high-fg: #991B1B;

  /* Elevation */
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-pop: 0 4px 20px rgba(0,0,0,.25);
  --shadow-gnb: 0 2px 8px rgba(0,0,0,.25);
  --shadow-fab: 0 4px 20px rgba(13,115,119,.4);

  /* Shape */
  --radius:     10px;
  --radius-sm:  6px;
  --radius-pill:999px;

  /* Typography */
  --font: 'Noto Sans KR', 'Apple SD Gothic Neo', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --gnb-h:     56px;
  --sidebar-w: 220px;
}


/* ── 2. Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.6;
}


/* ── 3. GNB (Global Navigation Bar) ─────────────────────── */
.gnb {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  display: flex; align-items: center; padding: 0 20px; height: var(--gnb-h);
  box-shadow: var(--shadow-gnb);
}
.gnb-logo {
  font-size: 20px; font-weight: 900; color: #fff;
  text-decoration: none; margin-right: auto;
  display: flex; align-items: center; gap: 8px;
}
.gnb-logo span { font-size: 22px }
.gnb-nav { display: flex; gap: 2px }
.gnb-nav a {
  color: rgba(255,255,255,.65); font-size: 13px; font-weight: 600;
  text-decoration: none; padding: 6px 12px; border-radius: 6px;
  transition: all .18s; white-space: nowrap;
}
.gnb-nav a:hover  { color: #fff; background: rgba(255,255,255,.1) }
.gnb-nav a.active { color: #fff; background: var(--teal) }
.gnb-hamburger {
  display: none; background: none; border: none;
  color: #fff; font-size: 22px; cursor: pointer; padding: 4px;
}


/* ── 4. Mobile Drawer ────────────────────────────────────── */
.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
}
.mobile-menu.open { display: flex }
.mobile-drawer {
  background: var(--navy); width: 220px; padding: 24px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.mobile-drawer a {
  color: rgba(255,255,255,.8); font-size: 15px; font-weight: 600;
  text-decoration: none; padding: 10px 14px; border-radius: 8px; transition: all .15s;
}
.mobile-drawer a:hover,
.mobile-drawer a.active { color: #fff; background: var(--teal) }
.mobile-close {
  align-self: flex-end; background: none; border: none;
  color: #fff; font-size: 22px; cursor: pointer; margin-bottom: 8px;
}


/* ── 5. Page Hero ────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #243655 100%);
  color: #fff; padding: 32px 24px 28px; text-align: center;
}
.page-hero h1 {
  font-size: clamp(20px, 4vw, 32px); font-weight: 900; letter-spacing: -.02em;
}
.page-hero p { font-size: 14px; color: rgba(255,255,255,.65); margin-top: 6px }


/* ── 6. Layout Containers ────────────────────────────────── */
.container      { max-width: 600px;  margin: 0 auto; padding: 28px 16px 60px }
.container-sm   { max-width: 520px;  margin: 0 auto; padding: 32px 16px 60px }
.container-wide { max-width: 960px;  margin: 0 auto; padding: 24px 16px 60px }
.col2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }


/* ── 7. Card ─────────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.card-title {
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 18px; display: flex; align-items: center; gap: 8px;
}
.card-title::after { content: ''; flex: 1; height: 1px; background: var(--gray2) }
.card-subtitle {
  font-size: 11px; font-weight: 400;
  letter-spacing: 0; text-transform: none; color: var(--gray3);
}


/* ── 8. Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 16px }
label { display: block; font-size: 13px; font-weight: 600; color: var(--gray4); margin-bottom: 5px }
label .req { color: var(--red); margin-left: 2px }
input, select, textarea {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--gray2); border-radius: 8px;
  font-size: 14px; font-family: var(--font); color: var(--text);
  background: #fff; transition: border-color .18s, box-shadow .18s; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,115,119,.12);
}
input.error { border-color: var(--red) }
textarea { resize: vertical; min-height: 80px }
.field-hint  { font-size: 12px; color: var(--gray3); margin-top: 4px }
.field-error { font-size: 12px; color: var(--red);   margin-top: 4px; display: none }
.field-ok    { font-size: 12px; color: var(--green);  margin-top: 4px; display: none }
.input-row { display: flex; gap: 8px }
.input-row input { flex: 1 }
.btn-sub {
  padding: 10px 14px; background: var(--teal); color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background .18s; font-family: var(--font);
}
.btn-sub:hover { background: var(--navy) }


/* ── 9. Buttons ──────────────────────────────────────────── */

/* Primary — teal fill */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px;
  background: var(--teal); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: background .18s, transform .1s; letter-spacing: .01em;
}
.btn-primary:hover  { background: var(--navy) }
.btn-primary:active { transform: scale(.98) }
.btn-primary:disabled { background: var(--gray2); color: var(--gray4); cursor: not-allowed }

/* Ghost — outline teal (계약서 액션 등) */
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 16px;
  background: var(--white); color: var(--teal);
  border: 1.5px solid var(--teal); border-radius: 8px;
  font-size: 13px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: all .18s; text-align: center;
}
.btn-ghost:hover { background: var(--mint) }
.btn-ghost.filled { background: var(--teal); color: #fff }
.btn-ghost.filled:hover { background: var(--navy); border-color: var(--navy) }

/* Neutral — gray (뒤로가기, 취소) */
.btn-neutral,
.btn-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 12px;
  background: var(--gray2); color: var(--gray4);
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 700; font-family: var(--font); cursor: pointer;
  transition: background .18s; margin-top: 10px;
}
.btn-neutral:hover,
.btn-back:hover { background: var(--gray3); color: #fff }

/* Small — admin 테이블 액션 */
.btn-sm {
  padding: 6px 14px; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: all .18s; white-space: nowrap;
}
.btn-sm.teal  { background: var(--teal);    color: #fff }
.btn-sm.teal:hover { background: var(--navy) }
.btn-sm.gray  { background: var(--gray2);   color: var(--gray4) }
.btn-sm.red   { background: var(--red-bg);  color: var(--red) }
.btn-sm.red:hover  { background: #fbd5d5 }
.btn-sm:disabled { opacity: .5; cursor: not-allowed }

/* Mini — 마이페이지 아이템 액션 */
.btn-mini {
  padding: 5px 11px; font-size: 11px; font-weight: 700;
  border-radius: 6px; border: 1.5px solid var(--gray2);
  background: #fff; color: var(--gray4);
  cursor: pointer; transition: all .18s; font-family: var(--font);
}
.btn-mini:hover { border-color: var(--teal); color: var(--teal) }
.btn-mini.danger:hover { border-color: var(--red); color: var(--red) }

/* Logout */
.btn-logout {
  margin-left: auto; padding: 8px 14px;
  background: var(--gray1); color: var(--gray4);
  border: none; border-radius: 8px;
  font-size: 12px; font-weight: 700; font-family: var(--font);
  cursor: pointer; white-space: nowrap;
}
.btn-logout:hover { background: var(--gray2) }


/* ── 10. Badges ──────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 4px;
  font-size: 11px; font-weight: 700;
}
/* 표준 색상 */
.badge-green  { background: var(--green-bg); color: #065F46 }
.badge-red    { background: var(--red-bg);   color: #991B1B }
.badge-amber  { background: var(--amber-bg); color: #92400E }
.badge-blue   { background: var(--blue-bg);  color: var(--blue) }
.badge-gray   { background: var(--gray-bg);  color: var(--gray4) }
.badge-pill   { border-radius: var(--radius-pill) }

/* admin.html 레거시 별칭 */
.badge-g { background: var(--green-bg); color: var(--green) }
.badge-r { background: var(--red-bg);   color: var(--red) }
.badge-y { background: var(--amber-bg); color: var(--amber) }
.badge-b { background: var(--blue-bg);  color: var(--blue) }

/* mypage.html 레거시 별칭 */
.badge-active,
.badge-approved  { background: var(--green-bg); color: #065F46 }
.badge-pending   { background: var(--amber-bg); color: #92400E }
.badge-canceled  { background: var(--gray-bg);  color: var(--gray4) }
.badge-rejected  { background: var(--red-bg);   color: #991B1B }
.badge-nonmember { background: var(--gray-bg);  color: var(--gray4) }


/* ── 11. Modal ───────────────────────────────────────────── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 500;
  align-items: center; justify-content: center;
}
.modal-bg.open { display: flex }

/* 중앙 모달 */
.modal-box {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 480px; padding: 24px 20px;
  max-height: 90vh; overflow-y: auto; margin: 16px;
}
.modal-box h2 {
  font-size: 17px; font-weight: 900; color: var(--navy); margin-bottom: 16px;
}
.modal-box .form-group { margin-bottom: 13px }
.modal-box label { font-size: 12px; font-weight: 700; color: var(--gray4); margin-bottom: 4px }
.modal-box input,
.modal-box textarea { background: var(--gray1) }
.modal-close-btn {
  width: 100%; padding: 12px;
  background: var(--gray2); color: var(--gray4);
  border: none; border-radius: 8px; font-size: 14px; font-weight: 700;
  cursor: pointer; margin-top: 6px; font-family: var(--font);
}
.modal-close-btn:hover { background: var(--gray3); color: #fff }

/* 하단 시트 변형 (qna.html) */
.modal-bg.bottom { align-items: flex-end; justify-content: center }
.modal-bg.bottom .modal-box {
  border-radius: 14px 14px 0 0; max-width: 600px; margin: 0; width: 100%;
}


/* ── 12. Toast ───────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff;
  padding: 12px 24px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-pop);
  opacity: 0; transition: opacity .3s; pointer-events: none;
  white-space: nowrap; z-index: 999;
}
.toast.show { opacity: 1 }


/* ── 13. Stepper (계약서 진행단계) ───────────────────────── */
.steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 24px;
}
.step {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; flex: 1; position: relative;
}
.step::after {
  content: ''; position: absolute; top: 14px; left: 50%; width: 100%;
  height: 2px; background: var(--gray2); z-index: 0;
}
.step:last-child::after { display: none }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray2); color: var(--gray3);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; transition: all .3s;
}
.step.done .step-dot   { background: var(--teal); color: #fff }
.step.active .step-dot { background: var(--navy); color: #fff; box-shadow: 0 0 0 4px rgba(27,42,74,.15) }
.step-label { font-size: 10px; color: var(--gray3); white-space: nowrap }
.step.done .step-label,
.step.active .step-label { color: var(--navy); font-weight: 600 }


/* ── 14. Notice Boxes ────────────────────────────────────── */

/* 비로그인 배너 (히어로 내부) */
.guest-banner {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 10px 16px; margin-top: 14px;
  font-size: 13px; color: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.guest-banner a { color: var(--teal-lt); text-decoration: underline; font-weight: 600; white-space: nowrap }

/* 로그인 필요 배너 (콘텐츠 내부) */
.login-notice {
  background: var(--mint); border: 1.5px solid var(--teal-lt);
  border-radius: 8px; padding: 12px 16px; font-size: 13px; color: var(--teal);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
}
.login-notice a { color: var(--navy); font-weight: 700; text-decoration: underline; white-space: nowrap }

/* 정보 박스 */
.info-box {
  background: var(--blue-bg); border: 1px solid #BFDBFE;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 16px;
  font-size: 13px; color: #1E40AF;
}


/* ── 15. Empty State ─────────────────────────────────────── */
.empty-state { text-align: center; padding: 24px 12px; color: var(--gray3); font-size: 13px }
.link-add {
  display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 700;
  color: var(--teal); text-decoration: none; cursor: pointer;
  background: none; border: none; font-family: var(--font);
}
.link-add:hover { text-decoration: underline }


/* ── 16. Avatar ──────────────────────────────────────────── */
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff; font-size: 20px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}


/* ── 17. Profile Type Badge ──────────────────────────────── */
.profile-type {
  display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 4px; background: var(--mint); color: var(--teal);
}


/* ── 18. Responsive Base ─────────────────────────────────── */
@media (max-width: 600px) {
  .gnb-nav      { display: none }
  .gnb-hamburger{ display: block }
  .card         { padding: 16px 14px }
  .col2         { grid-template-columns: 1fr }
  .container, .container-sm, .container-wide { padding-left: 12px; padding-right: 12px }
}
