/* ── 배경 & 오버레이 ───────────────────────────── */
body.apply-page {
  background:
    url("../images/main.jpg") center/cover no-repeat,
    var(--bg-primary);
  color: var(--white);
  min-height: 100vh;
}
body.apply-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: -1;
}

/* ── 헤더 & 푸터 ──────────────────────────────── */
.site-header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1c2e42;
  padding: 1rem 0;
  font-size: 0.9rem;
  color: #cfdaf2;
}
.footer-link {
  color: #7fb8ff;
  text-decoration: none;
}

/* ── 중앙 위치용 래퍼 ─────────────────────────── */
.terms-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 64px - 96px); /* 헤더64 + 푸터96 여유 */
}

/* ── 카드 ──────────────────────────────────── */
.terms-wrapper {
  width: clamp(680px, 90%, 1500px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(2px);
  padding: 3rem 4rem;
  border-radius: 16px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
}
.terms-title {
  font-size: 5rem;
  text-align: center;
}

.terms-section {
  width: 100%;
}
.terms-section h4 {
  font-size: 2rem;
  margin-bottom: 0.6rem;
}

.terms-section + .terms-section {
  margin-top: 2rem; /* 또는 원하는 간격으로 조절 (ex: 3rem) */
}

/* 본문 박스 */
.terms-text {
  width: 100%;
  background: rgba(96, 115, 133, 0.55);
  padding: 1.2rem 1.4rem;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.6rem;
  color: #e6e6e6;
  max-height: 8rem;
  overflow-y: auto;
}

/* 체크박스 줄을 오른쪽 정렬 */
.agree-line {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.form-check-input {
  margin-right: 0.4rem;
}
.form-check-label {
  font-size: 0.93rem;
}

/* 버튼 영역 */
.btn-wrap {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

#agreeSubmit,
#disagreeBtn {
  min-width: 220px;
  height: 52px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  border-radius: 6px;
}

#agreeSubmit:hover:enabled {
  background: #24435a;
}

#agreeSubmit:disabled {
  background: #24435a;
  cursor: not-allowed;
}

/* 스크롤바(크롬) */
.terms-text::-webkit-scrollbar {
  width: 6px;
}
.terms-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}
.terms-text::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.55);
}

.btn-wrap .btn {
  width: 230px; /* 원하는 동일폭 */
  min-width: 0; /* min-width 해제 */
}

#disagreeBtn {
  background: rgb(184, 184, 184);
  color: #fff;
}

#disagreeBtn:hover {
  background: #4e4e4e;
}

.logo {
  display: inline-block;
  width: 250px;
  height: 48px;
  background: url("../images/dongwon.png") center/contain no-repeat;
}

.btn-search {
  background-color: #5a83ff;
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.btn-search:hover {
  background-color: #003b9b;
}

.form-label {
  font-size: 0.95rem;
}

.table-scroll-wrapper {
  max-height: 350px; /* 원하는 높이로 조정 가능 */
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 8px;
}

.table-fixed-header thead th {
  position: sticky;
  top: 0;
  background-color: #212529; /* 또는 table-dark 컬러 */
  z-index: 10; /* 충분히 높게 설정 */
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.15); /* 아래 경계선 깔끔하게 */
}

/* 테이블 전체 보정 */
.table-fixed-header {
  border-collapse: separate; /* collapse 사용 시 sticky 잘리는 경우 방지 */
  border-spacing: 0;
}

@media (max-width: 768px) {
  .terms-center {
    background:
      /* ① 아래로 갈수록 bg-primary 로 자연스럽게 잇기 */
      linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, #181819 100%),
      /* ② 원본 이미지: 가로폭에 맞추고 전체 보여주기 */
        url("/assets/images/Mobilemain.png") top center/contain no-repeat,
      #181819;
    min-height: auto;
    padding: 0rem;
  }
  .site-header {
    background-color: #181819 !important;
  }
  .terms-wrapper {
    max-height: 100dvh;
    overflow-y: auto; /* 내용이 넘치면 세로 스크롤 */
    width: 92%;
    padding: 4rem 1rem;
    padding-bottom: 9rem;
  }
  .terms-title {
    font-size: 3rem; /* 원하는 크기로 ↓ */
    line-height: 1.25; /* 줄 간격도 살짝 조정 */
    word-break: keep-all; /* 단어 단위 줄바꿈 유지 */
    margin: 7rem 0 1rem;
  }
  .table-scroll-wrapper {
    max-height: 400px; /* 세로 최대 높이 제한(넘치면 스크롤 발생) */
    overflow-x: auto !important; /* 가로 스크롤 허용*/
    overflow-y: auto; /* 세로 스크롤 허용 */
    border-radius: 8px;
  }

  .table-fixed-header {
    min-width: 780px; /* 화면보다 넓게 해 가로 스크롤 유도 */
    border-collapse: separate; /* 셀 경계 분리 */
    border-spacing: 0; /* 셀 사이 간격 제거 */
  }

  .table-fixed-header th,
  .table-fixed-header td {
    /* 모든 헤더/데이터 셀 공통 */
    white-space: nowrap; /* 줄바꿈 금지(가로로만 늘어나도록) */
  }

  .table-fixed-header td:nth-child(3) {
    /* 3번째 데이터 열만 예외 처리 */
    white-space: normal !important; /* 일반 줄바꿈 허용 */
    word-break: keep-all; /* 단어/음절 중간 강제 분리 방지(가독성 유지) */
  }
}
@media (max-width: 600px) {
  .logo {
    background-image: url("/assets/images/mobiledongwon.png");
    width: 200px;
    height: 80px !important;
  }
}

/* ---- 반응형: 세로 비율 화면용 이미지 처리 ---- */
@media (max-aspect-ratio: 3/4) {
  body.apply-page {
    background:
      linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, var(--bg-primary) 100%),
      url("../images/Mobilemain.png") top center/contain no-repeat,
      var(--bg-primary);
  }
}

/* ---- 태블릿 세로 방향 대응 ---- */
@media (min-width: 600px) and (max-width: 1024px) and (orientation: portrait) {
  body {
    background-position: top center;
    background-size: contain;
  }
}

@media (min-width: 1400px) {
  .terms-wrapper {
    /* 600px 이상, 화면의 70 %, 그리고 최대 1200 px까지 */
    width: clamp(600px, 70%, 1200px);
    padding: 3rem;
  }

  .terms-text {
    max-height: 14rem;
  }

  .terms-title {
    font-size: 3.6rem;
  }
  .terms-section h4 {
    font-size: 1.6rem;
  }
}
