/* 利用規約モーダルの設定 */
#terms-modal {
  position: fixed;
  inset: 0;
  z-index: 9950;
  pointer-events: none;
}

#terms-modal .terms-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  opacity: 0;
  transition: opacity .2s ease;
}

#terms-modal .terms-detail {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
  transition: transform .3s ease, opacity .3s ease;
  opacity: 0;
  display: flex;
  flex-direction: column;
}

#terms-modal .modal-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

#terms-modal .modal-body .text {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 10px;
  min-height: 0;
}

/* 「同意する」ボタンを固定表示 */
.modal-body .btn-area {
  flex: 0 0 auto;
  background: #fff;
  padding: 20px 0;
  border-top: 1px solid #EBEEF0;
  text-align: center;
}

.form_area #terms-modal .submit input {
  background: var(--brown);
  box-shadow: none;
  margin-top: 0;
}


/* PC */
@media (min-width: 850px) {
  #terms-modal .terms-detail {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    max-width: 90%;
    height: 80vh;
    padding: 30px 30px 0;
    transform: translate(-50%, -50%);
  }
  #terms-modal.show .terms-detail {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

/* SP */
@media (max-width: 849px) {
  #terms-modal .terms-detail {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 80vh;
    padding: 20px 15px 0;
    border-radius: 16px 16px 0 0;
    transform: translate(-50%, 100%);
    display: flex;
    flex-direction: column;
  }
  #terms-modal.show .terms-detail {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* 表示状態 */
#terms-modal.show { pointer-events: auto; }
#terms-modal.show .terms-overlay { opacity: 1; }

#terms-modal .popup-ttl {
  margin-bottom: 0;
}

/* 閉じるボタン */
#terms-modal .close-terms {
  position: absolute;
  top: -40px;/* 他のモーダルと統一 */
  right: 0px;/* 他のモーダルと統一 */
  background: transparent;
  border: 0;
  cursor: pointer;
}

#terms-modal .close-terms .close-btn {
  filter: brightness(0) invert(1);/* svgを白色に変更 */
}

/* 利用規約のテキスト */
.text p {
  margin: 10px 0 0;
}
