/* ==========================================================================
   SAMG 헬프센터 스타일시트 — 엔터프라이즈 리디자인
   브랜드: 딥네이비 단일 컬러(#1E3A8A) / 배경: #F8F9FB / 카드: #FFFFFF
   폰트: Pretendard / 카드 radius 12px, 버튼 radius 8px / 트랜지션 150~200ms
   ========================================================================== */

:root {
  /* 브랜드 */
  --brand: #1e3a8a;
  --brand-hover: #182f73;
  --brand-50: #eff6ff;

  /* 뉴트럴 */
  --bg: #f8f9fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --heading: #111827;
  --text: #374151;
  --muted: #6b7280;

  /* 그림자 */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.08);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.12);

  /* 형태 */
  --radius-card: 12px;
  --radius-btn: 8px;

  --header-h: 64px;
  --container: 1080px;

  /* 히어로/서브 히어로 배너 공통 높이 (index·faq·contact 통일) */
  --hero-min-h: 320px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans KR", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow { max-width: 720px; }

.section { padding: 64px 0; }

.section-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin-bottom: 28px;
}

/* ==========================================================================
   버튼 공통
   ========================================================================== */

.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-hover); }

.btn--outline {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--border);
}
.btn--outline:hover {
  border-color: var(--brand);
  background: var(--brand-50);
}

.btn--sm { padding: 8px 18px; font-size: 14px; }
.btn--lg { padding: 15px 44px; font-size: 16px; }
.btn--block { display: block; width: 100%; }

/* ==========================================================================
   1. 헤더
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.logo-text {
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.global-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.15s ease;
}
.nav-link:hover { color: var(--brand); }

.nav-link--accent {
  color: var(--brand);
  font-weight: 600;
}
.nav-link--accent:hover { color: var(--brand-hover); }

/* 헤더 우측 언어 선택 (푸터에서 이동) */
.global-nav .lang-select-wrap {
  display: inline-flex;
  align-items: center;
}

/* 햄버거 버튼 */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 10px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--heading);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   2. 히어로
   ========================================================================== */

.hero {
  min-height: var(--hero-min-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(180deg, #1b3070 0%, #14245a 100%);
  text-align: center;
}

.hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  color: #fff;
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 36px;
}

/* 검색바 */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 4px 20px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.15s ease;
}

.search-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  color: var(--muted);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  padding: 14px 0;
  background: transparent;
  color: var(--heading);
  min-width: 0;
}
.search-bar input::placeholder { color: #9ca3af; }
.search-bar:focus-within {
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(30, 58, 138, 0.25);
}

/* ==========================================================================
   2-1. 서브 페이지 히어로 (faq.html / contact.html)
   ========================================================================== */

.page-hero {
  min-height: var(--hero-min-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
  background: #14245a;
  color: #fff;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.75);
}
.breadcrumb a {
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.15s ease;
}
.breadcrumb a:hover { color: #fff; }
.breadcrumb-sep { color: rgba(255, 255, 255, 0.5); }

.page-title {
  font-size: clamp(24px, 3.5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0;
}

.page-hero .search-bar--compact { margin-top: 28px; }

.search-bar--compact {
  max-width: 520px;
  min-height: 48px;
  padding: 2px 18px;
}
.search-bar--compact input { font-size: 15px; padding: 11px 0; }

/* ==========================================================================
   3. FAQ 목록/상세 공통 레이아웃
   ========================================================================== */

.faq-detail-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 36px;
  align-items: start;
}

.faq-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
  padding: 20px 16px;
}

.faq-sidebar-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  padding: 0 12px;
}

.faq-sidebar-list { list-style: none; }

.faq-sidebar-list a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.faq-sidebar-list a:hover {
  background: var(--bg);
  color: var(--brand);
}
.faq-sidebar-list a.is-active {
  background: var(--brand-50);
  color: var(--brand);
  font-weight: 600;
}

.faq-list-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin-bottom: 18px;
}

.faq-count {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   4. FAQ 카드 (아코디언)
   ========================================================================== */

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  align-items: start;
}

.faq-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.faq-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.faq-card.is-open {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 18px;
  background: none;
  border: none;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--heading);
}

.faq-q-mark {
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}

.faq-q-text { flex: 1; }

.faq-arrow {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq-card.is-open .faq-arrow { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.faq-answer p {
  padding: 2px 18px 18px 44px;
  font-size: 14px;
  color: var(--text);
}
.faq-answer a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 상세 페이지 답변(HTML 본문) */
.faq-answer-inner {
  padding: 2px 20px 20px 44px;
  font-size: 14px;
  color: var(--text);
}
.faq-answer-inner p {
  padding: 0;
  margin: 0 0 12px;
}
.faq-answer-inner p:last-child { margin-bottom: 0; }
.faq-answer-inner ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.faq-answer-inner li { margin-bottom: 4px; }
.faq-answer-inner strong { color: var(--heading); }
.faq-answer-inner a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.faq-cta-link {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 20px;
  background: var(--brand);
  color: #fff !important;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none !important;
  transition: background-color 0.15s ease;
}
.faq-cta-link:hover { background: var(--brand-hover); }

.faq-empty {
  margin-top: 24px;
  padding: 32px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
}
.faq-empty a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   5. 카테고리 카드 (1x3)
   ========================================================================== */

.category-section { padding-top: 8px; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--brand);
}

.category-icon {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand);
  margin-bottom: 12px;
}
.category-icon svg {
  width: 24px; height: 24px;
}

.category-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--heading);
}

.category-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.category-more {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  transition: color 0.15s ease;
}
.category-card:hover .category-more { color: var(--brand-hover); }

/* ==========================================================================
   6. 하단 CTA
   ========================================================================== */

.cta-section {
  text-align: center;
  padding-top: 8px;
}

.cta-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 56px;
}

.cta-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin-bottom: 24px;
}

/* ==========================================================================
   8. 1:1 문의 폼
   ========================================================================== */

.contact-desc {
  font-size: 14px;
  color: var(--muted);
  margin: -12px 0 28px;
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  box-shadow: var(--shadow-xs);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field { margin-bottom: 18px; }

.form-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 6px;
}

.req { color: #dc2626; }

.opt {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="url"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  color: var(--heading);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field textarea { resize: vertical; }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

/* 다중 선택(체크박스)·라디오 그룹 */
.form-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 4px 2px;
}

.form-field label.form-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 0;
}
.form-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

/* 첨부 파일 */
.form-file {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.form-file:hover { border-color: var(--brand); }
.form-file::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.form-file::file-selector-button:hover { background: var(--brand-hover); }

/* 필드 아래 작은 안내 문구 (허용 형식/용량 등) */
.form-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.form-field--checkbox { margin-bottom: 22px; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--muted);
  cursor: pointer;
}
.checkbox-label input {
  margin-top: 3px;
  width: 16px; height: 16px;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.form-error {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 500;
}

/* 접수 완료 */
.form-success {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 56px 28px;
  box-shadow: var(--shadow-xs);
}

.form-success-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
  font-size: 24px;
  font-weight: 700;
}

.form-success h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin-bottom: 10px;
}

.form-success p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}

.form-success .btn { padding: 11px 28px; }

/* ==========================================================================
   9. 푸터
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
}

.footer-copy {
  margin-left: 10px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.lang-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.lang-select:focus {
  outline: none;
  border-color: var(--brand);
}

/* ==========================================================================
   반응형
   ========================================================================== */

@media (max-width: 720px) {
  .section { padding: 44px 0; }

  /* 좁은 화면 히어로 배너 높이 축소 (index·faq·contact 동일 유지) */
  :root { --hero-min-h: 240px; }

  /* 헤더 → 햄버거 메뉴 */
  .hamburger { display: flex; }

  .global-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 8px 24px 16px;
    display: none;
  }
  .global-nav.is-open { display: flex; }

  .global-nav .nav-link {
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
  }

  /* 언어 선택도 모바일 메뉴 안에 자연스럽게 배치 */
  .global-nav .lang-select-wrap {
    display: flex;
    padding: 14px 4px 4px;
  }
  .global-nav .lang-select { width: 100%; }

  /* 히어로 */
  .hero { padding: 32px 24px; }
  .page-hero { padding: 32px 0; }

  /* FAQ / 카테고리 1열 */
  .faq-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }

  /* FAQ 상세: 사이드바를 위로 쌓기 */
  .faq-detail-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .faq-sidebar { position: static; }

  /* 폼 */
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .contact-form { padding: 24px 18px; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
