/* Modal Background */
#myModal {
  display: none;
  position: fixed;
  z-index: 999;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  font-family: Arial, sans-serif;
}

/* Modal Box */
.modal-content {
  background-color: #fff;
  margin: 8% auto;
  padding: 20px;
  border-radius: 10px;
  width: 480px;
  max-width: 92%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

/* Close Button */
.close {
  color: #aaa;
  float: right;
  font-size: 26px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

/* Headings */
h2 {
  font-size: 22px;
  margin-bottom: 18px;
  color: #333;
}

/* Form */
.form-group {
  margin-bottom: 15px;
}

label {
  font-size: 15px;
  color: #333;
  display: block;
  margin-bottom: 5px;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
}

input:focus {
  border-color: #21cdb3;
  outline: none;
}

/* Button */
.verify-btn {
  width: 100%;
  padding: 12px;
  background-color: #21cdb3;
  color: #fff;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

.verify-btn:hover {
  background-color: #00806d;
}

/* Error */
#captchaError {
  font-size: 13px;
  color: red;
  margin-top: 8px;
}

/* Hide OTP initially */
#codeContainer {
  display: none;
}

/* ================= OTP INPUT ================= */

/* Container */
.code-input-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;      /* keep in one row */
  margin: 10px auto;
  padding: 0 10px;
  overflow: hidden;       /* 🚫 no scrollbar */
}

/* Input boxes */
.code-input-container input {
  width: 44px;
  height: 44px;
  text-align: center;
  font-size: 18px;
  border: 1px solid #000;
  border-radius: 8px;
  flex-shrink: 0;
}

.code-input-container input:focus {
  border-color: #21cdb3;
}

/* 4-digit OTP */
.code-input-container input:nth-child(1):nth-last-child(4),
.code-input-container input:nth-child(2):nth-last-child(3),
.code-input-container input:nth-child(3):nth-last-child(2),
.code-input-container input:nth-child(4):nth-last-child(1) {
  width: 52px;
  height: 52px;
  font-size: 22px;
}

/* 6-digit OTP */
.code-input-container input:nth-child(1):nth-last-child(6),
.code-input-container input:nth-child(2):nth-last-child(5),
.code-input-container input:nth-child(3):nth-last-child(4),
.code-input-container input:nth-child(4):nth-last-child(3),
.code-input-container input:nth-child(5):nth-last-child(2),
.code-input-container input:nth-child(6):nth-last-child(1) {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

/* Buttons under OTP */
#codeContainer button {
  margin-top: 10px;
}

/* ================= SPINNER ================= */

#spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90px;
}

.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ================= RESPONSIVE ================= */

@media (max-width: 540px) {
  .modal-content {
    margin: 15% auto;
    padding: 15px;
  }

  h2 {
    font-size: 20px;
  }

  .code-input-container {
    gap: 8px;
  }

  /* 6-digit */
  .code-input-container input:nth-child(1):nth-last-child(6),
  .code-input-container input:nth-child(2):nth-last-child(5),
  .code-input-container input:nth-child(3):nth-last-child(4),
  .code-input-container input:nth-child(4):nth-last-child(3),
  .code-input-container input:nth-child(5):nth-last-child(2),
  .code-input-container input:nth-child(6):nth-last-child(1) {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  /* 4-digit */
  .code-input-container input:nth-child(1):nth-last-child(4),
  .code-input-container input:nth-child(2):nth-last-child(3),
  .code-input-container input:nth-child(3):nth-last-child(2),
  .code-input-container input:nth-child(4):nth-last-child(1) {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }
}

@media (max-width: 400px) {
  .code-input-container {
    gap: 6px;
  }

  .code-input-container input {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
}