#terms-modal-overlay[hidden] {
  display: none;
}

#terms-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .62);
  box-sizing: border-box;
}

#terms-modal-overlay .terms-modal-box {
  width: min(680px, 100%);
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  color: #333;
  box-shadow: 0 10px 36px rgba(0, 0, 0, .28);
  font-family: sans-serif;
}

#terms-modal-overlay .terms-modal-title {
  margin: 0;
  padding: 18px 22px 12px;
  border-bottom: 2px solid #eee;
  font-size: 1.16rem;
}

#terms-modal-overlay .terms-modal-body {
  overflow-y: auto;
  padding: 14px 22px;
  font-size: .9rem;
  line-height: 1.65;
}

#terms-modal-overlay .terms-modal-body h3 {
  margin: 16px 0 5px;
  font-size: .98rem;
  color: #222;
}

#terms-modal-overlay .terms-modal-body p {
  margin: 7px 0;
}

#terms-modal-overlay .terms-modal-body ul {
  margin: 6px 0;
  padding-left: 22px;
}

#terms-modal-overlay .terms-modal-body a {
  color: #1d4ed8;
  text-decoration: underline;
}

#terms-modal-overlay .terms-modal-note {
  padding: 10px 12px;
  border-left: 4px solid #2563eb;
  background: #f3f7ff;
}

#terms-modal-overlay .terms-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px 16px;
  border-top: 1px solid #eee;
}

#terms-modal-overlay .terms-modal-footer label {
  font-size: .86rem;
  color: #555;
}

#terms-modal-overlay #terms-modal-agree {
  flex: 0 0 auto;
  border: 0;
  border-radius: 5px;
  padding: 9px 18px;
  background: #2563eb;
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
}

#terms-modal-overlay #terms-modal-agree:hover {
  background: #1d4ed8;
}

@media (max-width: 520px) {
  #terms-modal-overlay .terms-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }
  #terms-modal-overlay #terms-modal-agree {
    width: 100%;
  }
}
