/* ── 배경 & 오버레이 ───────────────────────────── */
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: 69px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  border-bottom: 1px solid #ffffff; /* 여기 */
}
.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 여유 */
  padding-top: 0 !important; /*여기*/
  margin-top: 1.5rem;
}

/* ── 카드 ──────────────────────────────────── */
.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;
  margin-top: 0.5rem !important;
  padding-top: 0 !important;
}
.terms-title {
  font-size: 5rem;
  text-align: center;
  margin-top: 0.6rem;
}

.terms-section {
  width: 100%;
  border-radius: 0 !important;
}
.terms-section h4 {
  font-size: 2rem;
  margin-bottom: 0.6rem;
  border-left: 4px solid #ffffff;
  padding-left: 12px;
}

/* 본문 박스 */
.terms-text {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.95); /* 투명 + 흰 배경 */
  padding: 1.2rem 1.4rem;
  border-radius: 0;
  font-size: 0.95rem;
  line-height: 1.6rem;
  color: #222;
  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;
  pointer-events: auto; /* 체크박스 클릭 가능 */
}
.form-check-label {
  font-size: 0.93rem;
}

/* 버튼 영역 */
.btn-wrap {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 3rem;
}

#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-section::-webkit-scrollbar {
  width: 6px;
}
.terms-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}
.terms-section::-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;
}

.terms-privacy {
  border: 1px solid #333;
  border-radius: 0;
  padding: 24px;
  margin-top: 10px;
  background-color: rgba(255, 255, 255, 0.95); /* 투명 + 흰 배경 */
  color: #222;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* 부드러운 그림자 */
  line-height: 1.8;
  font-size: 1rem;
  font-weight: 400;
}

.terms-text mark {
  background-color: #fff3cd;
  padding: 0 3px;
  border-radius: 2px;
}

.terms-text strong {
  font-weight: 600;
}

.terms-text u {
  text-decoration: underline;
  color: #0d6efd;
}

.mobile-header-divider {
  display: none;
}

/* 이거 */
html,
body {
  height: 100%;
  overflow: hidden;
}
/* 라벨 잠금 시 시각적 표시 (토스트 띄워야 하므로 pointer-events는 막지 않음) */
.agree-line.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
#scrollToast.toast {
  --bs-toast-bg: #fff; /* 완전 흰색 배경 */
  --bs-toast-color: #111; /* 진한 글자색 */
  --bs-toast-border-color: rgba(0, 0, 0, 0.12);
  --bs-toast-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  opacity: 1; /* 반투명 제거 */
  backdrop-filter: blur(2px); /* 살짝 또렷하게 */
}
#scrollToast .toast-body {
  font-weight: 600;
  letter-spacing: 0.1px;
}
#scrollToast .btn-close {
  filter: invert(0); /* X 버튼을 어둡게 */
  opacity: 0.7;
}

/* 토스트 컨테이너 z-index 보강 (헤더/오버레이 위로) */
.scroll-toast-wrap {
  z-index: 2000;
}
@media (max-width: 600px) {
  .logo {
    background-image: url("../images/mobiledongwon.png");
    width: 200px;
    height: 80px;
  }

  .terms-title {
    font-size: 3.5rem; /* 원하는 크기로 ↓ */
    line-height: 1.25; /* 줄 간격도 살짝 조정 */
    word-break: keep-all; /* 단어 단위 줄바꿈 유지 */
    margin-bottom: 1.5rem;
  }
}

/* ---- 모바일 대응 ---- */
@media (max-width: 740px) {
  .terms-title {
    font-size: 2.5rem;
    margin-top: 3rem;
  }
  .terms-section h4 {
    font-size: 1.5rem;
  }
  .form-check-input {
    transform: scale(1.5); /* 크기 조절 (1.2 ~ 2 추천) */
    font-size: 0.4rem;
    pointer-events: auto; /* 체크박스 클릭 가능 */
  }
  .terms-text {
    font-size: 1rem;
  }
}

/* ---- 초소형 모바일 대응: max-width 375px ---- */
@media (max-width: 375px) {
  .foot {
    font-size: 0.65rem;
  }
}

/* ---- 반응형: 세로 비율 화면용 이미지 처리 ---- */
@media (max-aspect-ratio: 3/4) {
  body {
    background:
      /* ① 아래로 갈수록 bg-primary 로 자연스럽게 잇기 */ 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: 740px) and (max-width: 1024px) and (orientation: portrait) {
  body {
    background-position: top center;
    background-size: contain;
  }
}

@media (max-height: 740px) {
  main {
    align-items: flex-start;
  }
}

@media (max-width: 740px) {
  main {
    align-items: normal;
  }
  .foot {
    font-size: 0.7rem;
  }
}

@media (max-aspect-ratio: 3/4) {
  .terms-center {
    background: url("../images/Mobilemain.png") top center/cover no-repeat,
      linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, #181819 100%);
  }
}

/* ---- 태블릿 세로 방향 대응 ---- */
@media (min-width: 600px) and (max-width: 1024px) and (orientation: portrait) {
  body {
    background-position: top center;
    background-size: contain;
  }
}

/* ── 모바일 ─────────────────────────────────── */
@media (max-width: 768px) {
  .terms-wrapper {
    width: 92%;
    padding: 1rem 1.5rem;
    margin-top: 0 !important;
  }
  .terms-text {
    font-size: 0.9rem;
  }
  .btn-wrap {
    flex-direction: column;
    align-items: center;
  }

  .btn-wrap .btn {
    width: 100%;
    max-width: 300px;
  }

  .terms-center {
    align-items: flex-start !important;
    padding-top: 1.5rem;
    padding-bottom: calc(var(--vh, 1vh) * 10) !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    overflow-y: auto;
  }

  .terms-wrapper {
    display: block !important;
    margin-top: 0 !important;
    padding-top: 1rem;
  }
  .temp {
    margin-top: 1.5rem;
  }

  .terms-center {
    padding-bottom: 160px !important;
    height: auto !important;
    overflow-y: auto !important;
  }

  .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background-color: #1c2e42;
    z-index: 1000;
  }

  .btn-wrap {
    margin-bottom: 1.5rem; /* 버튼 아래 간격 추가 */
  }

  html,
  body {
    height: 100%;
    overflow-x: hidden;
  }
}

@media (min-width: 1400px) {
  .terms-wrapper {
    /* 600px 이상, 화면의 70 %, 그리고 최대 1200 px까지 */
    width: clamp(600px, 70%, 1200px);
  }

  .terms-text {
    max-height: 14rem;
  }

  .terms-title {
    font-size: 3.6rem;
  }
  .terms-section h4 {
    font-size: 1.6rem;
  }
}

@media (max-width: 380px) {
  .terms-title {
    margin-bottom: 0.5rem;
  }
  .form-check-input {
    transform: scale(2);
    margin-right: 0.7rem;
    pointer-events: auto; /* 체크박스 클릭 가능 */
  }
  .label-text {
    font-size: 0.9rem;
  }
  .terms-wrapper {
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    background-color: #181819 !important;
    height: 64px;
  }
}

@media (max-width: 400px) and (max-height: 870px) {
  .terms-title {
    margin-top: 0rem;
  }
  .temp {
    margin-top: 0.5rem;
  }
}
