/* ========================================= */
/* Buttons - All Button Variants            */
/* ========================================= */

/* Base button */
.btn {
  font-weight: 600;   /* 버튼 600 (10-18, 전 700 — 10-19 빨강 복귀 뒤에도 유지) */
  font-size: 16px;    /* 명시 — 없으면 <button> 이 UA 기본 13.3px 로 렌더 (26-08-27) */
  line-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;           /* 아이콘 + 글자 붙음 방지 (10-18 Copy keywords) */
  min-height: 44px;   /* 다국어: height → min-height + 위아래 8 (10-20). 한 줄일 땐 크기 같고, 길면 두 줄로 늘어난다 */
  padding-top: 8px;
  padding-bottom: 8px;
  text-align: center;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}
.btn[hidden] { display: none; }   /* hidden 속성이 inline-flex 에 지지 않게 (10-20, 1-4-6 Cancel 이 보이던 문제) */
.btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }   /* 포커스 = 검정 (26-08-27, 빨강은 오류 전용) */
/* 라지 56 — 하단 고정(스티키) CTA 전용. 인라인 버튼은 44/40/36 유지 (26-08-27) */
.btn-lg { min-height: 52px; }   /* 라지 52 (10-18 사용자 "56 너무 큼" → 56→52) */
/* 사이즈 티어 (26-08-27 확정, 10-18 L 52) — L 52 하단 고정 CTA · M 44 기본 · S 36 카드/행 안 액션 · XS 32 배너·띠 CTA
   라운드: L·M 12, S·XS 8 (26-10-18, 전 8/4). 글자: L·M 16, S 14, XS 12 (전부 700) */
.btn-sm { min-height: 36px; padding-top: 7px; padding-bottom: 7px; padding-left: 12px; padding-right: 12px; border-radius: 8px; font-size: 14px; line-height: 20px; }
.btn-xs { min-height: 32px; padding-top: 4px; padding-bottom: 4px; padding-left: 12px; padding-right: 12px; border-radius: 8px; font-size: 12px; line-height: 16px; }
.btn-sm .icon, .btn-xs .icon { width: 20px; height: 20px; }
.bottom-action-bar .btn { min-height: 52px; }   /* 하단 바 안은 자동 L. 문서상 L 은 .btn-lg 명시가 정본 (26-08-30) */
/* 히트 영역 — S36·XS32 는 시각 높이. 터치 44 는 주변 여백(행 높이·배너 패딩)으로 확보, 인접 버튼 간격 8+ */

/* Button variants */
.btn-primary { background: var(--bg-cta); color: var(--fg-inverse); }
.btn-primary:active { background: var(--bg-cta-pressed); }
.btn-primary.active { background-color: var(--bg-cta); color: white; }
/* Disabled — 단일 스펙 (26-08-27): bg-sunken + fg-secondary(#6B6B6F, 대비 5.3:1 — #999 는 2.2:1 로 안 읽힘), 투명도 안 씀(빨강 50%는 '눌리는 중'과 헷갈림). 모든 변형 공통 */
/* 제출 버튼(.submit-btn) — 칸을 다 채우기 전엔 비활성 모양, 채우면 스크립트가 .active 를 붙여 빨강 (10-22, 전 forms.css 따로 정의) */
.btn.submit-btn:not(.active) { background: var(--bg-sunken); color: var(--fg-secondary); }
.btn[disabled], .btn.disabled, .btn.is-disabled { background: var(--bg-sunken); color: var(--fg-secondary); border-color: transparent; opacity: 1; pointer-events: none; cursor: not-allowed; box-shadow: none; }

.btn-secondary { background: var(--bg-default); color: var(--fg-primary); border-color: var(--border-subtle); }
.btn-secondary:active { background: var(--bg-muted); }

.btn-ghost { background: transparent; color: var(--fg-primary); border-color: transparent; }
.btn-ghost:active { background: var(--state-pressed); }
.btn-ghost[disabled], .btn-ghost.is-disabled { background: transparent; color: var(--fg-tertiary); }   /* 글자 버튼은 비활성도 면 없이 흐린 글자만 (10-23) */

/* Inverse — 검정 면 보조 강조 (26-09-07 피치링크에서 승격: "상점 꾸미기" 같은 빨강 아닌 2차 CTA). 눌림 bg-inverse-pressed */
.btn-inverse { background: var(--bg-inverse); color: var(--fg-inverse); border-color: var(--bg-inverse); }
.btn-inverse:active { background: var(--bg-inverse-pressed); }
.btn-inverse .icon { color: var(--fg-inverse); }


/* Icon button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
}
.icon-btn:active { opacity: 1; }

/* Flag button */
.flag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
}
/* 국기 — v2 와 동일한 원형 24 (26-08-26). 흰 국기(JP)가 묻히지 않게 안쪽 1px */
.flag {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  border: 1px solid rgba(0, 0, 0, .10);   /* 원 테두리. <img> 는 inset box-shadow 가 안 그려져 border 사용 (26-08-26).
                                            .18 은 색 있는 국기(중국·베트남) 위에서 검은 테처럼 보였다 → .10, 흰 바탕에선 구분선(--border-subtle)과 같은 무게 (26-09-02 사용자) */
  box-sizing: border-box;
  object-fit: cover;
  flex-shrink: 0;
}

/* Close button */
.close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 8px; /* 소형 = 4 (26-08-27) */
  cursor: pointer;
  color: var(--fg-secondary);
  position: relative;
}
.close-btn:hover { background: var(--bg-muted); color: var(--fg-primary); }
.close-btn:active { background: var(--bg-sunken); }
/* 누르는 영역만 사방 8 넓힘 — 28 → 44 (26-10-18, 모양 그대로) */
.close-btn::after { content: ''; position: absolute; inset: -8px; }

/* Expand button */
.expand-button {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-subtle);   /* 보조 버튼과 같은 연한 선 — #111 선은 화면에서 가장 센 선이었다 (10-19) */
  display: flex; align-items: center; justify-content: center; gap: 6px;   /* 아이콘·글자 세로 중앙 (10-19, 전엔 1.3 어긋남) */
  border-radius: 8px;
  height: 36px;         /* S 티어 36·700 14/20 로 맞춤 — 전엔 35·500 이었다 (26-09-12) */
  padding: 0 16px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--fg-primary);
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  width: calc(100% - 24px);
}
.expand-button:hover { background: var(--bg-default); border-color: var(--border-control); }
.expand-button.hidden { display: none; }

/* Floating Action Button - Chat */
.fab-chat {
  position: fixed;
  right: 16px;
  bottom: 72px;   /* 꽉 찬 탭바 56 위 16 (26-08-31) */
  width: 44px;   /* 48 → 44 (26-08-30) */
  height: 44px;
  border-radius: 50%;
  background: var(--bg-fab);   /* 핑크 #FF3478 → 검정 (26-08-30 확정: 빨강은 CTA 전용이라 과함, 채팅 Send·토스트와 같은 톤) */
  color: var(--fg-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .24);
  text-decoration: none;
  z-index: 999;
  transition: transform 0.2s ease, box-shadow 0.2s ease, bottom .28s cubic-bezier(.2,.8,.2,1);   /* 하단 탭바 숨김 시 같이 내려감 (26-08-31) */
}
.fab-chat:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .32);
}
.fab-chat .icon { color: var(--fg-inverse); width: 24px; height: 24px; }   /* 원 44 · 아이콘 24 */
/* 하단 바 위 한 줄 안내 — 버튼을 왜 못 누르는지/누르면 어디로 가는지 (10-25 상세 신청 상태) */
.bottom-action-bar:has(.bar-hint) { flex-wrap: wrap; row-gap: 8px; }
.bottom-action-bar .bar-hint { flex: 0 0 100%; margin: 0; font: var(--t-caption); color: var(--fg-secondary); text-align: center; }
.bottom-action-bar[hidden] { display: none; }   /* 끝 화면으로 바뀔 때 바를 숨김 (10-25 공용화 — schedule-change 에만 있던 규칙) */
