/* =========================================================
   팀메이커 · base.css
   모든 페이지 공통: 색상 변수, 기본 스타일, 헤더, 푸터,
   버튼, 입력창, 아바타, 토스트
   색상은 전부 변수 → 야간모드는 값만 바뀜
   ========================================================= */

/* ---------- 색상 · 공통 값 ---------- */
:root {
  --bg: #f6f7f9;
  --header-bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --border: #e6e8ec;
  --divider: #eef0f3;
  --input-bg: #fbfbfc;
  --input-border: #d5d9e0;
  --input-disabled: #f1f2f5;
  --text: #1d2127;
  --text-2: #5f6672;
  --text-3: #6b7280;
  --chip: #f1f2f5;
  --chip-text: #4b5260;
  --accent: #0b7f89;
  --accent-hover: #075f67;
  --accent-soft: rgba(11, 127, 137, 0.1);
  --on-accent: #ffffff;
  --scrim: rgba(17, 20, 26, 0.45);
  --online: #2f9e5f;
  --offline: #b8bec8;
  --busy: #d08a00;
  --danger: #c0392b;
  --tooltip-bg: #1d2127;
  --tooltip-text: #f4f5f8;
  --tooltip-sub: #b8bec8;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --font: 'Pretendard', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-title: 'Paperlogy', var(--font);   /* 큰 제목 전용 (font.css) */
}

[data-theme="dark"] {
  --bg: #15171c;
  --header-bg: #1b1e24;
  --surface: #1d2027;
  --surface-2: #191c22;
  --border: #2b2f38;
  --divider: #262a32;
  --input-bg: #16181d;
  --input-border: #353a45;
  --input-disabled: #1f232a;
  --text: #e6e8ec;
  --text-2: #a3aab5;
  --text-3: #8e96a3;
  --chip: #262a33;
  --chip-text: #c3c8d1;
  --accent: #4fc1c9;
  --accent-hover: #7fd4da;
  --accent-soft: rgba(79, 193, 201, 0.14);
  --on-accent: #0f1a1c;
  --scrim: rgba(0, 0, 0, 0.6);
  --online: #4cc38a;
  --offline: #5c6370;
  --busy: #e0a43a;
  --danger: #ff8a80;
  --tooltip-bg: #2b2f38;
  --tooltip-text: #f4f5f8;
  --tooltip-sub: #a3aab5;
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img { display: block; }

/* 라이트 · 다크 이미지 바꾸기: 같은 자리에 두 장을 넣고 테마에 맞는 쪽만 보여줌 */
[data-theme="dark"] .only-light,
:root:not([data-theme="dark"]) .only-dark { display: none !important; }

/* 큰 제목 글꼴 */
.font-title { font-family: var(--font-title); font-weight: 900; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ---------- 헤더 ---------- */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--border); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 12px; padding-bottom: 12px;
}
.logo { display: flex; align-items: center; min-height: 44px; text-decoration: none; }
.logo img { width: auto; height: 36px; }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* 문의하기: 넓은 화면은 글자 포함 이미지, 좁은 화면은 말풍선만 */
.btn-ghost .inquiry-full { width: auto; height: 18px; }
.btn-ghost .inquiry-icon { width: 20px; height: 20px; }
.btn-ghost .inquiry-icon { display: none; }

/* 프로필 + 메뉴 */
.auth-area { position: relative; }
.profile-chip {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 6px;
  border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); background: var(--surface); text-align: left;
}
.profile-chip:hover { background: var(--chip); }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 170px; padding: 6px;
  display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.profile-menu button {
  min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
  text-align: left; font-size: 14px; color: var(--text);
}
.profile-menu button:hover { background: var(--chip); }
.profile-text { display: flex; flex-direction: column; line-height: 1.2; }
.profile-name { font-size: 14px; font-weight: 600; }
.profile-uid { font-size: 12px; color: var(--text-3); }

/* ---------- 푸터 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--header-bg); }
.footer-inner {
  padding-top: 20px; padding-bottom: 20px; display: flex; flex-direction: column; gap: 8px;
  font-size: 12px; color: var(--text-3); line-height: 1.6;
}
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--chip-text); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-links a.is-strong { font-weight: 600; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; text-decoration: none;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 600;
}
.btn-lg { min-height: 48px; padding: 0 22px; border-radius: var(--radius-md); font-size: 15px; }
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { color: var(--on-accent); filter: brightness(0.93); }
.btn-outline { background: var(--surface); border-color: var(--input-border); color: var(--text); }
.btn-outline:hover { color: var(--text); background: var(--chip); }
.btn-accent-outline { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.btn-done { background: var(--chip); border-color: var(--chip); color: var(--text-3); cursor: default; }

.btn-ghost {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 0; border-radius: var(--radius-md); background: transparent; color: var(--chip-text); font-size: 14px;
}
.btn-ghost:hover { background: var(--chip); }

.icon-btn {
  width: 44px; height: 44px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--chip); }
.icon-btn-sm { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.icon-btn-plain {
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 0; background: transparent;
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
}
.icon-btn-plain:hover { background: var(--chip); }

.text-link { font-size: 14px; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- 입력창 ---------- */
.input {
  width: 100%; min-width: 0; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--input-border);
  background: var(--input-bg); color: var(--text); font-size: 15px;
}
select.input { background: var(--surface); padding-right: 8px; }
.input:disabled { background: var(--input-disabled); border-color: var(--border); color: var(--text-3); cursor: not-allowed; }
.input.is-error { border-color: var(--danger); }
.input-sm { min-height: 36px; padding: 0 10px; border-radius: 8px; font-size: 14px; }
.input-md { min-height: 42px; font-size: 14px; }
.checkbox { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ---------- 글자 ---------- */
.label { font-size: 14px; font-weight: 600; }
.caption { font-size: 12px; color: var(--text-3); }
.hint { margin: 0; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.hint.is-error { color: var(--danger); }
.hint-strong { color: var(--chip-text); }
.hint-dark { font-size: 13px; color: var(--text-2); }
.hint-inline { font-weight: 400; color: var(--text-3); }
.accent-text { color: var(--accent); }
.t-center { text-align: center; }

/* ---------- 작은 부품 ---------- */
.avatar {
  position: relative; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  background: var(--chip); color: var(--chip-text);
}
.avatar.is-accent { background: var(--accent-soft); color: var(--accent); }
.avatar.is-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar .dot {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--surface); background: var(--offline);
}
.avatar .dot.is-online { background: var(--online); }

.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-text); }

/* ---------- 배치 도우미 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row-inline { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; }
.row-wrap.align-end { align-items: flex-end; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.grow-1 { flex: 1 1 200px; }
.grow-2 { flex: 2 1 260px; }
.grow-3 { flex: 3 1 260px; }
.min-140 { flex-basis: 140px; }
.min-220 { flex-basis: 220px; }
.mt-auto { margin-top: auto; }
.pb-12 { padding-bottom: 12px; }
.w-110 { width: 110px; }
.w-170 { width: 170px; }
.t-right { text-align: right; }

/* ---------- 로그인 돌아오는 페이지 ---------- */
.callback-box { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }
.callback-box img { border-radius: 16px; }
.callback-msg { margin: 0; font-size: 16px; color: var(--text-2); }
.callback-msg.is-error { color: var(--danger); }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 60;
  padding: 12px 18px; border-radius: var(--radius-md);
  background: var(--tooltip-bg); color: var(--tooltip-text); font-size: 14px;
}

/* ---------- 모바일 ---------- */
@media (max-width: 767px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .btn-ghost .inquiry-full { display: none !important; }
  .btn-ghost .inquiry-icon { display: block; }
  .btn-ghost { padding: 0 10px; }
  .profile-text { display: none; }
  .profile-chip { padding: 0 6px; }
  .logo img { height: 30px; }
}
