/* 이용약관(CO012) · 개인정보 처리방침(CO013) — Figma 기준, .legal-page__content 스코프 */

.legal-page__content {
  display: block;
  width: 100%;
  background: #ffffff;
}

.legal-page__content * {
  box-sizing: border-box;
}

.legal-doc {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px 120px;
  overflow-x: clip;
}

.legal-doc__header {
  padding: 100px 10px 0;
}

.legal-doc__title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: -0.32px;
  color: #000000;
}

.legal-doc__body {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.legal-section__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: -0.24px;
  color: #000000;
}

.legal-section__text,
.legal-section__text p {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: -0.16px;
  color: #000000;
  /* 한/중/일·영문 장문도 뷰포트 밖으로 밀지 않도록 줄바꿈 (keep-all 은 CJK 가로스크롤 유발) */
  overflow-wrap: anywhere;
  word-break: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

.legal-section__text p + p {
  margin-top: 16px;
}

.legal-section__stack {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ----------------------------------------------------------
   테이블 (블랙 헤더 / #ddd 격자선 / radius 10)
   ---------------------------------------------------------- */
.legal-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background: #ffffff;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  border: 0;
}

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

.legal-table th,
.legal-table td {
  padding: 15px 20px;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.16px;
  text-align: left;
  vertical-align: middle;
  border: 0;
  border-right: 1px solid #dddddd;
  border-bottom: 1px solid #dddddd;
  color: #000000;
  overflow-wrap: anywhere;
  word-break: break-word;
  word-wrap: break-word;
}

/* 이용약관 변상금액 표: 항목/금액 가운데 정렬 */
.legal-section__tables .legal-table th,
.legal-section__tables .legal-table td {
  text-align: center;
  vertical-align: middle;
}

/* Compensation(KRW): PC 한 줄, MO 두 줄 */
.br-mobile {
  display: none;
}

/*
  rowspan 행에서는 왼쪽 셀만 남아 :last-child 가 되므로
  border-right 가 사라짐 → 실제 마지막 열(nth-child / colspan)만 제거
*/
.legal-table--2col > thead > tr > th:nth-child(2),
.legal-table--2col > tbody > tr > td:nth-child(2),
.legal-table--2col > tbody > tr > th:nth-child(2),
.legal-table--entrust-2col > thead > tr > th:nth-child(2),
.legal-table--entrust-2col > tbody > tr > td:nth-child(2),
.legal-table--entrust-2col > tbody > tr > th:nth-child(2) {
  border-right: 0;
}

.legal-table--3col > thead > tr > th:nth-child(3),
.legal-table--3col > tbody > tr > td:nth-child(3),
.legal-table--3col > tbody > tr > th:nth-child(3) {
  border-right: 0;
}

.legal-table--entrust > thead > tr > th:nth-child(3),
.legal-table--entrust > tbody > tr > td:nth-child(3),
.legal-table--entrust > tbody > tr > th:nth-child(3),
.legal-table--entrust > tbody > tr > td[colspan] {
  border-right: 0;
}

.legal-table tbody tr:last-child > th,
.legal-table tbody tr:last-child > td {
  border-bottom: 0;
}

/* 마지막 행까지 이어지는 rowspan 셀도 하단 이중선 방지 */
.legal-table tbody td[rowspan],
.legal-table tbody th[rowspan] {
  border-bottom: 0;
}

.legal-table thead th {
  background: #000000;
  color: #ffffff;
  font-weight: 700;
  border-right-color: #333333;
  border-bottom-color: #000000;
  vertical-align: middle;
}

.legal-table tbody td {
  font-weight: 400;
  background: #ffffff;
  min-height: 64px;
}

.legal-table tbody th {
  background: #ffffff;
  font-weight: 400;
  color: #000000;
}

.legal-table--2col th:first-child,
.legal-table--2col td:first-child {
  width: 50%;
}

.legal-table--3col th,
.legal-table--3col td {
  width: 33.333%;
}

/* 위탁 테이블: 위탁 업체명 열 300/1200 = 25% (위·아래 표 정렬) */
.legal-table--entrust th:first-child,
.legal-table--entrust td:first-child,
.legal-table--entrust-2col th:first-child,
.legal-table--entrust-2col td:first-child {
  min-width: 25%;
}

.legal-table--entrust th:nth-child(2),
.legal-table--entrust td:nth-child(2),
.legal-table--entrust th:nth-child(3),
.legal-table--entrust td:nth-child(3) {
  width: 37.5%;
}

.legal-table--entrust-2col th:nth-child(2),
.legal-table--entrust-2col td:nth-child(2) {
  width: 75%;
}

.legal-table td[rowspan],
.legal-table th[rowspan] {
  vertical-align: middle;
}

.legal-table__note {
  white-space: pre-line;
}

.legal-section__tables {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ----------------------------------------------------------
   하단 CTA (개인정보 처리방침 전체 보기)
   ---------------------------------------------------------- */
.legal-doc__actions {
  display: flex;
  justify-content: center;
  margin-top: 80px;
}

.legal-doc__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 265px;
  height: 56px;
  padding: 0 32px;
  border: 0;
  border-radius: 50px;
  background: #000000;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.16px;
  text-decoration: none;
  cursor: pointer;
}

.legal-doc__btn:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 3px;
}

/* ----------------------------------------------------------
   개인정보처리방침 전체 보기 팝업 (CO014)
   ---------------------------------------------------------- */
body.policy-popup-open,
html.policy-popup-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.policy-history {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.6);
  overscroll-behavior: contain;
}

.policy-history.is-open {
  display: flex;
}

.policy-history__dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  max-height: calc(100vh - 80px);
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

.policy-history__title {
  flex-shrink: 0;
  margin: 0;
  padding: 60px 50px 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: -0.32px;
  color: #000000;
}

.policy-history__table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  margin: 40px 40px 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background: #ffffff;
}

.policy-history__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

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

.policy-history__table th,
.policy-history__table td {
  width: 33.333%;
  height: 56px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid #dddddd;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: -0.16px;
  text-align: center;
  vertical-align: middle;
  color: #000000;
}

.policy-history__table thead th {
  background: #000000;
  color: #ffffff;
  font-weight: 700;
  border-bottom-color: #000000;
}

.policy-history__table tbody tr:last-child td {
  border-bottom: 0;
}

.policy-history__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #000000;
  text-decoration: none;
  white-space: nowrap;
}

.policy-history__icon {
  display: inline-block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
}

.policy-history__icon--download {
  background-image: url("../../assets/icons/ic20_download.svg");
}

.policy-history__icon--arrow {
  background-image: url("../../assets/icons/ic20_arrow_right_black.svg");
}

.policy-history__footer {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 40px 40px 50px;
}

.policy-history__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 540px;
  height: 56px;
  border: 0;
  border-radius: 50px;
  background: #f3f5f6;
  color: #000000;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.16px;
  cursor: pointer;
}

.policy-history__close:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 3px;
}

/* ----------------------------------------------------------
   개정내용 상세 팝업 (CO015–CO019)
   ---------------------------------------------------------- */
.policy-revision {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.6);
  overscroll-behavior: contain;
}

.policy-revision.is-open {
  display: flex;
}

.policy-revision__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  /* Figma CO015: 다이얼로그 720 */
  max-height: min(720px, calc(100vh - 80px));
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

.policy-revision__title {
  flex-shrink: 0;
  margin: 0;
  padding: 60px 50px 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: -0.32px;
  color: #000000;
}

.policy-revision__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  /* 하단 닫기 영역(106) 위로 스크롤 여유 — 페이드가 본문 위에 겹침 */
  padding: 40px 40px 106px;
  -webkit-overflow-scrolling: touch;
}

.policy-revision__lead,
.policy-revision__text,
.policy-revision__note {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: -0.16px;
  color: #000000;
}

.policy-revision__summary-title,
.policy-revision__compare-title,
.policy-revision__subtitle {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.16px;
  color: #000000;
}

.policy-revision__summary-list {
  margin: 30px 0 0;
  padding: 0 0 0 1.15em;
  list-style: disc;
}

.policy-revision__summary-list > li {
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.16px;
  color: #000000;
}

.policy-revision__summary-title {
  display: block;
}

.policy-revision__summary-sub {
  margin: 0;
  padding: 0;
  list-style: none;
}

.policy-revision__summary-sub li {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: -0.16px;
  color: #000000;
}

.policy-revision__compare-title {
  margin: 30px 0 0;
  padding-left: 1.15em;
  position: relative;
}

.policy-revision__compare-title::before {
  content: "";
  position: absolute;
  left: 0.35em;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #000000;
}

.policy-revision__cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.policy-revision__card {
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
}

.policy-revision__card-head {
  margin: 0;
  padding: 15px 20px;
  background: #000000;
  border: 1px solid #000000;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.16px;
  color: #ffffff;
}

.policy-revision__card-body {
  padding: 30px 20px;
  border: 1px solid #dddddd;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.policy-revision__subtitle + .policy-revision__text,
.policy-revision__subtitle + .policy-revision__table-wrap {
  margin-top: 5px;
}

.policy-revision__text + .policy-revision__subtitle,
.policy-revision__table-wrap + .policy-revision__subtitle {
  margin-top: 20px;
}

.policy-revision__table-wrap {
  overflow: hidden;
  border: 1px solid #dddddd;
  border-radius: 10px;
}

.policy-revision__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.policy-revision__table th,
.policy-revision__table td {
  width: 50%;
  padding: 15px 20px;
  border: 0;
  border-right: 1px solid #dddddd;
  border-bottom: 1px solid #dddddd;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: -0.16px;
  text-align: left;
  vertical-align: middle;
  color: #000000;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: loose;
  white-space: normal;
}

.policy-revision__table th:nth-child(2),
.policy-revision__table td:nth-child(2) {
  border-right: 0;
}

.policy-revision__table tbody tr:last-child th,
.policy-revision__table tbody tr:last-child td {
  border-bottom: 0;
}

/* rowspan이 마지막 행까지 이어질 때 하단 보더 중복 방지 */
.policy-revision__table tbody tr:nth-last-child(2) > td[rowspan="2"] {
  border-bottom: 0;
}

.policy-revision__table thead th {
  background: #dddddd;
  font-weight: 700;
  border-right-color: #ffffff;
  border-bottom-color: #dddddd;
}

.policy-revision__table thead th:last-child {
  border-right: 0;
}

.policy-revision__note {
  margin-top: 30px;
  padding-bottom: 10px;
}

.policy-revision__footer {
  /* Figma CO015 Frame 2085673918: 하단 106, 페이드 #fff0 → #fffcc@55% */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 106px;
  padding: 10px 40px 40px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 55%
  );
  pointer-events: none;
}

.policy-revision__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 540px;
  height: 56px;
  border: 0;
  border-radius: 50px;
  /* Figma: solid #f3f5f6 (하단 딤은 footer 그라데이션) */
  background: #f3f5f6;
  color: #000000;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.16px;
  cursor: pointer;
  pointer-events: auto;
}

.policy-revision__close:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 3px;
}

/* ----------------------------------------------------------
   모바일 (CO012 / CO013 mobile)
   ---------------------------------------------------------- */
@media (max-width: 1279.98px) {
  .br-mobile {
    display: block;
  }

  .legal-doc {
    padding: 0 20px 80px;
  }

  .legal-doc__header {
    padding: 40px 0 0;
  }

  /* 모바일: GNB(.header__detail-title)만 타이틀 노출 → 본문 h1/여백 정리 */
  body.is-mobile-sub-gnb .legal-doc__header {
    padding: 0;
  }

  body.is-mobile-sub-gnb .legal-doc__body {
    margin-top: 20px;
  }

  .legal-doc__title {
    font-size: 24px;
    line-height: 34px;
    letter-spacing: -0.24px;
  }

  .legal-doc__body {
    margin-top: 32px;
    gap: 40px;
  }

  .legal-section {
    gap: 12px;
  }

  .legal-section__title {
    font-size: 22px;
    line-height: 32px;
    letter-spacing: -0.22px;
  }

  .legal-section__text,
  .legal-section__text p {
    font-size: 14px;
    line-height: 22px;
    letter-spacing: -0.14px;
  }

  .legal-section__stack,
  .legal-section__tables {
    gap: 24px;
  }

  .legal-table th,
  .legal-table td {
    padding: 12px 12px;
    font-size: 14px;
    line-height: 22px;
    letter-spacing: -0.14px;
    box-sizing: border-box;
  }

  /* 모바일: 컨테이너에 맞춰 유동, 칸 최소 160px (부족하면 가로 스크롤) */
  .legal-table--2col,
  .legal-table--entrust-2col {
    width: 100%;
    min-width: 320px;
  }

  .legal-table--3col,
  .legal-table--entrust {
    width: 100%;
    min-width: 480px;
  }

  .legal-table--2col th,
  .legal-table--2col td,
  .legal-table--2col th:first-child,
  .legal-table--2col td:first-child,
  .legal-table--entrust-2col th,
  .legal-table--entrust-2col td,
  .legal-table--entrust-2col th:first-child,
  .legal-table--entrust-2col td:first-child,
  .legal-table--entrust-2col th:nth-child(2),
  .legal-table--entrust-2col td:nth-child(2),
  .legal-table--3col th,
  .legal-table--3col td,
  .legal-table--entrust th,
  .legal-table--entrust td,
  .legal-table--entrust th:first-child,
  .legal-table--entrust td:first-child,
  .legal-table--entrust th:nth-child(2),
  .legal-table--entrust td:nth-child(2),
  .legal-table--entrust th:nth-child(3),
  .legal-table--entrust td:nth-child(3) {
    width: 160px;
  }

  .legal-doc__actions {
    margin-top: 48px;
  }

  .legal-doc__btn {
    width: 100%;
    min-width: 0;
    height: 52px;
  }

  /* CO014 mobile: bottom sheet */
  .policy-history {
    align-items: flex-end;
    padding: 0;
  }

  .policy-history__dialog {
    max-width: none;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }

  .policy-history__title {
    padding: 40px 24px 0;
    font-size: 26px;
    line-height: 40px;
    letter-spacing: -0.26px;
  }

  .policy-history__table-wrap {
    margin: 40px 20px 0;
  }

  .policy-history__table th,
  .policy-history__table td {
    height: 54px;
    padding: 0 4px;
    font-size: 14px;
    line-height: 22px;
    letter-spacing: -0.14px;
  }

  .policy-history__table th:first-child,
  .policy-history__table td:first-child {
    width: 28%;
  }

  .policy-history__table th:nth-child(2),
  .policy-history__table td:nth-child(2),
  .policy-history__table th:nth-child(3),
  .policy-history__table td:nth-child(3) {
    width: 36%;
  }

  .policy-history__icon {
    width: 16px;
    height: 16px;
    background-size: 16px 16px;
  }

  .policy-history__footer {
    padding: 20px 20px 24px;
  }

  .policy-history__close {
    max-width: none;
    height: 48px;
    font-size: 14px;
    line-height: 22px;
    letter-spacing: -0.14px;
  }

  /* CO015–CO019 mobile: bottom sheet */
  .policy-revision {
    align-items: flex-end;
    padding: 0;
  }

  .policy-revision__dialog {
    max-width: none;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }

  .policy-revision__title {
    padding: 40px 24px 0;
    font-size: 26px;
    line-height: 40px;
    letter-spacing: -0.26px;
  }

  .policy-revision__body {
    padding: 32px 20px 92px;
  }

  .policy-revision__lead,
  .policy-revision__text,
  .policy-revision__note,
  .policy-revision__summary-title,
  .policy-revision__summary-list li,
  .policy-revision__compare-title,
  .policy-revision__subtitle,
  .policy-revision__card-head,
  .policy-revision__table th,
  .policy-revision__table td {
    font-size: 14px;
    line-height: 22px;
    letter-spacing: -0.14px;
  }

  .policy-revision__summary-list {
    margin-top: 24px;
  }

  .policy-revision__compare-title {
    margin-top: 24px;
  }

  .policy-revision__card-body {
    padding: 20px 16px;
  }

  .policy-revision__table th,
  .policy-revision__table td {
    padding: 12px 12px;
  }

  .policy-revision__footer {
    height: 92px;
    padding: 10px 20px 20px;
  }

  .policy-revision__close {
    max-width: none;
    height: 48px;
    font-size: 14px;
    line-height: 22px;
    letter-spacing: -0.14px;
  }
}
