/* ===== POPUP OVERLAY ===== */
#popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  transition:
    opacity 0.8s ease,
    visibility 0.8s ease;
}

#popup.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* === POPUP / INLINE FORM — Glassy card === */
#popup .popup-box,
.inline-form-box {
  position: relative;
  width: 50%;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 25px 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-family: "Orbitron", sans-serif;
  margin: 0 auto;
  animation: popupFade 0.5s ease;
}

#popup.show .popup-box {
  animation: popupFade 0.5s ease;
}

/* === CLOSE BUTTON (popup only) === */
#popup .popup-box .close,
#popup #popup-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #ffbe18;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    color 0.3s ease,
    text-shadow 0.3s ease;
}

#popup .popup-box .close:hover,
#popup #popup-close:hover {
  transform: scale(1.2);
  color: #bb2729;
  text-shadow: 0 0 10px #ffbe18;
}

/* === HEADER === */
#popup .popup-box h2,
.inline-form-box h2 {
  text-align: center;
  font-size: 28px;
  color: #ffbe18;
  text-shadow: 0 0 10px #bb2729;
  margin-bottom: 20px;
}

/* === FORM ELEMENTS === */
#popup .popup-box form,
.inline-form-box form {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#popup .popup-box label,
.inline-form-box label {
  font-size: 14px;
  color: #ffffff;
  text-shadow: none;
}

/* === INPUT STYLING === */
#popup .popup-box input,
#popup .popup-box select,
.inline-form-box input,
.inline-form-box select {
  padding: 8px 12px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: 0.3s;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1);
  appearance: none;
  -webkit-appearance: none;
}

#popup .popup-box input::placeholder,
.inline-form-box input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#popup .popup-box input:focus,
.inline-form-box input:focus {
  border-color: #ffbe18;
  box-shadow:
    0 0 8px #ffbe18,
    inset 0 0 6px rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

/* === SELECT OPTIONS === */
#popup .popup-box select option,
.inline-form-box select option {
  background: #1a1d26;
  color: #ffffff;
}

#popup .popup-box select option[value=""],
.inline-form-box select option[value=""] {
  color: rgba(255, 255, 255, 0.5);
}

/* === CHECKBOX === */
#popup .checkbox-container,
.inline-form-box .checkbox-container {
  margin: 8px 0;
}

#popup .custom-checkbox,
.inline-form-box .custom-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #ffbe18;
  cursor: pointer;
  user-select: none;
}

#popup .custom-checkbox .checkmark,
.inline-form-box .custom-checkbox .checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #ffbe18;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffbe18;
  font-weight: bold;
  font-size: 12px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

#popup .custom-checkbox a,
.inline-form-box .custom-checkbox a {
  color: #ffbe18;
  text-decoration: underline;
}

#popup .custom-checkbox a:hover,
.inline-form-box .custom-checkbox a:hover {
  color: #bb2729;
}

/* === SUBMIT BUTTON === */
#popup .popup-box button,
#popup .popup-box button[type="submit"],
.inline-form-box button,
.inline-form-box button[type="submit"] {
  margin-top: 10px;
  padding: 10px;
  height: 40px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.15),
      rgba(255, 255, 255, 0.05)
    ),
    linear-gradient(90deg, #bb2729, #ffbe18);
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition:
    transform 0.2s ease,
    box-shadow 0.3s ease,
    background 0.3s;
}

#popup .popup-box button:hover,
#popup .popup-box button[type="submit"]:hover,
.inline-form-box button:hover,
.inline-form-box button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 20px #ffbe18,
    0 0 30px #bb2729;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.05)
    ),
    linear-gradient(90deg, #ffbe18, #bb2729);
}

/* === ANIMATIONS === */
@keyframes popupFade {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  #popup .popup-box {
    padding: 20px;
    width: 95% !important;
  }

  #popup .popup-box h2,
  .inline-form-box h2 {
    font-size: 24px;
  }

  #popup .popup-box input,
  #popup .popup-box button,
  .inline-form-box input,
  .inline-form-box button {
    font-size: 13px;
    height: 34px;
  }

  .inline-form-box .checkbox-container {
    display: flex;
    justify-content: center;
    text-align: center;
  }

  .inline-form-box #checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
  }

  .inline-form-box button[type="submit"] {
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 480px) {
  #popup .popup-box {
    padding: 20px 15px;
  }

  #popup .popup-box h2,
  .inline-form-box h2 {
    font-size: 20px;
  }

  #popup .popup-box button[type="submit"],
  .inline-form-box button[type="submit"] {
    font-size: 13px;
  }
}

/* === Autofill fix === */
#popup .popup-box input:-webkit-autofill,
#popup .popup-box input:-webkit-autofill:hover,
#popup .popup-box input:-webkit-autofill:focus,
.inline-form-box input:-webkit-autofill,
.inline-form-box input:-webkit-autofill:hover,
.inline-form-box input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.05) inset !important;
  -webkit-text-fill-color: #ffffff !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* === INLINE FORM — course page sidebar overrides === */
.inline-form-box {
  margin-top: 20px;
}

.col-xxl-4.col-lg-5 .popup-box {
  width: 120%;
  border: none;
}

@media (max-width: 768px) {
  .col-xxl-4.col-lg-5 .popup-box {
    width: 100%;
  }
}
