body {
  font-family: sans-serif;
  background: #f3f3f3;
  margin: 0;
  padding: 0;
}
.form-container {
  background-color: white;
  padding: 2rem;
  margin: 3rem auto;
  width: 350px;
  border-radius: 10px;
}
input, select, button {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
}
.terms-warning {
  text-align: center;
  font-size: large;
  color: red;
}
canvas {
  border: 1px solid #aaa;
  background-color: #fff;
}
#termsModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* จัดกลางทั้งแนวตั้งและแนวนอน */
  background-color: rgba(0, 0, 0, 0.4); /* พื้นหลังโปร่งแสง */
  width: 100%;
  height: 100%;
  display: none; /* ซ่อนเริ่มต้น */
  z-index: 9999; /* ให้อยู่หน้าสุด */
}

#termsModal .modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
}
.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  border-radius: 10px;
}

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.modal-content {
  background: #fff;
  margin: 5% auto;
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.modal-body {
  max-height: 300px;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid #ddd;
  margin-bottom: 1rem;
}

#acceptBtn {
  padding: 10px 20px;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  background: #28a745;
  color: white;
  cursor: pointer;
}
#submitBtn {
  padding: 10px 20px;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  background: #28a745;
  color: white;
  cursor: pointer;
}
#acceptBtn:disabled {
  background: #ccc;
  cursor: not-allowed;
}
