/*!
 * faq-widget.css
 * ----------------------------------------------------------------------------
 * FAQ 위젯 + 내 문의함 스타일. 계약서 8항 디자인 토큰을
 * var(--brand, #143A6B) 형태 폴백과 함께 사용한다(토큰 미적용 사이트에서도 안 깨지게).
 * 코랄(--accent)은 화면당 핵심 CTA(문의하기/조회)에만 1~2개 사용.
 * 모바일 우선, 터치 타깃 44px 이상, 본문 line-height 1.7.
 */

.faq-widget,
.inbox-widget {
  box-sizing: border-box;
  color: var(--text, #334155);
  line-height: 1.7;
}

.faq-widget *,
.inbox-widget *,
.faq-fab {
  box-sizing: border-box;
}

.faq-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
 * 제목 / 검색
 * --------------------------------------------------------------------- */
.faq-title,
.inbox-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-strong, #0F172A);
  margin: 0 0 0.75rem;
}

.faq-search-row {
  margin-bottom: 0.75rem;
}

.faq-search {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  border: 1px solid var(--border, #E2E5EB);
  border-radius: var(--radius, 12px);
  background: #fff;
  color: var(--text-strong, #0F172A);
}

.faq-search:focus-visible {
  outline: 2px solid var(--brand-link, #2E5FD0);
  outline-offset: 1px;
}

/* ---------------------------------------------------------------------
 * 카테고리 탭
 * --------------------------------------------------------------------- */
.faq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.faq-tab {
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border, #E2E5EB);
  border-radius: 999px;
  background: #fff;
  color: var(--text, #334155);
  font-size: 0.9rem;
  cursor: pointer;
}

.faq-tab.is-active {
  background: var(--brand, #143A6B);
  border-color: var(--brand, #143A6B);
  color: #fff;
  font-weight: 600;
}

.faq-tab:focus-visible {
  outline: 2px solid var(--brand-link, #2E5FD0);
  outline-offset: 2px;
}

.faq-result-count {
  font-size: 0.85rem;
  color: var(--text, #334155);
  margin-bottom: 0.5rem;
  min-height: 1.2em;
}

/* ---------------------------------------------------------------------
 * 아코디언
 * --------------------------------------------------------------------- */
.faq-list {
  border-top: 1px solid var(--border, #E2E5EB);
}

.faq-item {
  border-bottom: 1px solid var(--border, #E2E5EB);
}

.faq-q-wrap {
  margin: 0;
}

.faq-q {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 0.25rem;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong, #0F172A);
  cursor: pointer;
}

.faq-q:focus-visible {
  outline: 2px solid var(--brand-link, #2E5FD0);
  outline-offset: -2px;
  border-radius: 4px;
}

.faq-q-icon {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface, #F7F8FA);
  color: var(--brand, #143A6B);
  font-weight: 700;
}

.faq-a {
  padding: 0 0.25rem 1rem;
  font-size: 0.95rem;
  color: var(--text, #334155);
}

.faq-a-body a {
  color: var(--brand-link, #2E5FD0);
}

.faq-selfservice-btn {
  display: inline-block;
  margin-top: 0.5rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--brand, #143A6B);
  border-radius: var(--radius, 12px);
  background: #fff;
  color: var(--brand, #143A6B);
  font-weight: 600;
  cursor: pointer;
}

.faq-selfservice-fallback {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--warning, #8A5A00);
}

.faq-permalink {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text, #334155);
  opacity: 0.7;
}

.faq-empty {
  padding: 1.5rem 0.25rem;
  text-align: center;
  color: var(--text, #334155);
}

/* ---------------------------------------------------------------------
 * 문의 안내 블록 · 전화번호
 * --------------------------------------------------------------------- */
.faq-contact-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--border, #E2E5EB);
  text-align: center;
}

.faq-btn {
  min-height: 44px;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius, 12px);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

.faq-btn-primary {
  background: var(--accent, #E2431F);
  color: #fff;
  border-color: var(--accent, #E2431F);
}

.faq-btn-outline {
  background: #fff;
  color: var(--brand, #143A6B);
  border-color: var(--brand, #143A6B);
}

.faq-precheck-hint {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text, #334155);
}

/* "먼저 아래를 확인해 주세요" 문구 바로 아래 전화번호 블록 배치 */
.faq-phone-block {
  margin-top: 0.25rem;
  padding: 0.9rem;
  border: 1px solid var(--border, #E2E5EB);
  border-radius: var(--radius, 12px);
  background: var(--surface, #F7F8FA);
}

.faq-phone-label {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  color: var(--text, #334155);
}

.faq-phone-number {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand, #143A6B);
  text-decoration: none;
}

.faq-phone-hours {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text, #334155);
}

/* ---------------------------------------------------------------------
 * 문의 전 FAQ 게이트 모달
 * --------------------------------------------------------------------- */
.faq-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.faq-gate-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius, 12px) var(--radius, 12px) 0 0;
  padding: 1.25rem 1.25rem 1.5rem;
}

@media (min-width: 640px) {
  .faq-gate-overlay {
    align-items: center;
  }
  .faq-gate-modal {
    border-radius: var(--radius, 12px);
  }
}

.faq-gate-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text, #334155);
}

.faq-gate-label {
  display: block;
  margin: 0.75rem 0 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.faq-gate-input {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border, #E2E5EB);
  border-radius: var(--radius, 12px);
  font-size: 1rem;
}

.faq-gate-hint {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-strong, #0F172A);
}

.faq-gate-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.faq-gate-item {
  width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--border, #E2E5EB);
  border-radius: var(--radius, 12px);
  background: var(--surface, #F7F8FA);
  cursor: pointer;
  color: var(--text-strong, #0F172A);
}

.faq-gate-empty {
  font-size: 0.85rem;
  color: var(--text, #334155);
  margin: 0.9rem 0;
}

#faq-gate-proceed {
  width: 100%;
  margin-top: 0.75rem;
}

/* ---------------------------------------------------------------------
 * 문의 폼
 * --------------------------------------------------------------------- */
.faq-ticket-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.faq-ticket-form label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.4rem;
}

.faq-ticket-form input,
.faq-ticket-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border, #E2E5EB);
  border-radius: var(--radius, 12px);
  font-size: 1rem;
  font-family: inherit;
}

.faq-ticket-form button {
  margin-top: 0.75rem;
}

.faq-ticket-result {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--success, #0E7A50);
}

/* ---------------------------------------------------------------------
 * 하단 고정 도움말 버튼(선택)
 * --------------------------------------------------------------------- */
.faq-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9990;
  min-height: 48px;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: none;
  background: var(--brand, #143A6B);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  cursor: pointer;
}

.faq-fab:focus-visible {
  outline: 2px solid var(--accent, #E2431F);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
 * 내 문의함(support-inbox.js)
 * --------------------------------------------------------------------- */
.inbox-guest-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--border, #E2E5EB);
  border-radius: var(--radius, 12px);
  background: var(--surface, #F7F8FA);
}

.inbox-guest-form label {
  font-size: 0.85rem;
  font-weight: 600;
}

.inbox-guest-form input {
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border, #E2E5EB);
  border-radius: var(--radius, 12px);
  font-size: 1rem;
}

.inbox-guest-hint {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
}

.inbox-loading,
.inbox-empty,
.inbox-error {
  padding: 1rem 0.25rem;
  font-size: 0.9rem;
}

.inbox-error {
  color: var(--danger, #DC2626);
}

.inbox-ticket {
  border: 1px solid var(--border, #E2E5EB);
  border-radius: var(--radius, 12px);
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.inbox-ticket-head {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: #fff;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-strong, #0F172A);
}

.inbox-ticket-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 상태 뱃지 */
.inbox-badge {
  flex: none;
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-received {
  background: rgba(46, 95, 208, 0.12);
  color: var(--brand-link, #2E5FD0);
}

.badge-progress {
  background: rgba(138, 90, 0, 0.12);
  color: var(--warning, #8A5A00);
}

.badge-answered {
  background: rgba(14, 122, 80, 0.12);
  color: var(--success, #0E7A50);
}

.inbox-ticket-body {
  padding: 0 0.9rem 1rem;
  background: var(--surface, #F7F8FA);
  font-size: 0.9rem;
}

.inbox-detail {
  margin: 0.75rem 0;
}

.inbox-detail dt {
  font-weight: 700;
  color: var(--text-strong, #0F172A);
  margin-top: 0.5rem;
}

.inbox-detail dd {
  margin: 0.15rem 0 0;
  color: var(--text, #334155);
}

.inbox-answer {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius, 12px);
  background: #fff;
  border: 1px solid var(--success, #0E7A50);
}

.inbox-answer-label {
  margin: 0 0 0.3rem;
  font-weight: 700;
  color: var(--success, #0E7A50);
}

.inbox-waiting {
  margin-top: 0.75rem;
  color: var(--text, #334155);
  font-size: 0.85rem;
}

.inbox-followup-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.inbox-followup-form textarea {
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border, #E2E5EB);
  border-radius: var(--radius, 12px);
  font-family: inherit;
  font-size: 0.95rem;
}

.inbox-followup-result {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--success, #0E7A50);
}

/* ---------------------------------------------------------------------
 * 반응형: 태블릿 이상에서 여백 확대
 * --------------------------------------------------------------------- */
@media (min-width: 768px) {
  .faq-widget,
  .inbox-widget {
    max-width: 720px;
    margin: 0 auto;
  }
}
