/* Term acknowledgement modal — shown on first visit, gated by localStorage */
.term-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.term-modal-overlay.show {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.term-modal-dialog {
  width: 92%;
  max-width: 520px;
  margin: 20px auto;
}

.term-modal-overlay .registerAccount-container {
  position: relative;
  width: 100%;
}

.term-modal-overlay .bg-frame {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

/* registercard is overlaid on the lower ~62% of the background frame
   (top 38% of bg is the "發Q娛樂城 / 註冊帳號" decoration) */
.term-modal-overlay .registercard {
  position: absolute;
  top: 38%;
  left: 9%;
  right: 9%;
  bottom: 6%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: transparent;
  border: none;
}

.term-modal-overlay .registercard > img:first-child {
  width: 90%;
  height: auto;
  margin: 40px auto 6px;
  display: block;
}

.term-modal-overlay .checkbox-group {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  min-height: 0;
  width: -webkit-max-content;
  width: -moz-max-content;
  width: max-content;
  max-width: 100%;
  align-self: center;
}

.term-modal-overlay .custom-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.term-modal-overlay .custom-checkbox input[type="checkbox"] {
  display: none;
}

.term-modal-overlay .checkbox-icon {
  width: 22px;
  height: 22px;
  background-image: url(../images/term/button-03.png);
  background-size: cover;
  background-repeat: no-repeat;
  transition: 0.2s;
  flex-shrink: 0;
  margin-right: 6px;
}

.term-modal-overlay .custom-checkbox input:checked + .checkbox-icon {
  background-image: url(../images/term/button-04.png);
}

.term-modal-overlay .label-imgs {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}

.term-modal-overlay .word-img {
  height: 20px;
  width: auto;
}

.term-modal-overlay .btn-confirm {
  width: 96px;
  height: 46px;
  border: none;
  background-color: transparent;
  background-image: url(../images/term/button-01.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: 0.3s;
  margin: 4px auto 0;
  display: block;
  cursor: not-allowed;
  flex-shrink: 0;
}

.term-modal-overlay .btn-confirm.active {
  background-image: url(../images/term/button-02.png);
  cursor: pointer;
}

@media screen and (min-width: 600px) {
  .term-modal-dialog { max-width: 560px; }
  .term-modal-overlay .word-img { height: 28px; }
  .term-modal-overlay .checkbox-icon { width: 30px; height: 30px; }
  .term-modal-overlay .btn-confirm { width: 130px; height: 62px; }
}
