/* Smooth modal fade-in */
@keyframes fadeInScale {
  from {opacity: 0; transform: scale(0.85);}
  to {opacity: 1; transform: scale(1);}
}

/* Success bounce-in */
@keyframes popIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.98); }
  60% { opacity: 1; transform: translateY(0) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.65);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(3px);
}

/* Card look */
.modal-content {
  background: linear-gradient(135deg, #ffffff, #f8faff);
  padding: 25px 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 520px;
  text-align: center;
  animation: fadeInScale 0.35s ease;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  position: relative;
  max-height: 90vh;            /* keep content within viewport */
  overflow-y: auto;            /* scroll inside modal */
  -webkit-overflow-scrolling: touch; /* smooth iOS scrolling */
  scrollbar-width: none;       /* Firefox hide scrollbar */
  -ms-overflow-style: none;    /* IE/Edge legacy */
}
.modal-content::-webkit-scrollbar { display: none; } /* WebKit hide scrollbar */

/* Close button */
.close-btn {
  position: absolute;
  right: 18px; top: 14px;
  font-size: 28px;
  color: #444;
  transition: 0.2s;
}
.close-btn:hover {
  color: #ff4d4d;
  transform: rotate(90deg);
}

/* Inputs */
.modal-content input, 
.modal-content select {
  width: 100%;
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fafafa;
  transition: all 0.3s ease;
}
.input-wrapper { position: relative; }
.dob-placeholder {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa0a6;
  pointer-events: none;
}
.modal-content input:focus, 
.modal-content select:focus {
  border-color: #007bff;
  background: #fff;
  outline: none;
  box-shadow: 0 0 6px rgba(0,123,255,0.25);
}

/* Buttons */
.modal-content button {
  width: 100%;
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease, background 0.3s ease;
}
.modal-content button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #0056b3, #003c82);
}

/* Success message */
#successMessage {
  display: none;
  text-align: center;
  padding: 30px;
  animation: fadeInScale 0.4s ease;
}
.success-animate {
  animation: popIn 450ms cubic-bezier(0.22, 1, 0.36, 1);
}
.thankyou-text {
  color: #28a745;
  font-size: 22px;
  margin-bottom: 8px;
}
.thankyou-sub {
  font-size: 16px;
  color: #555;
}

/* Eligibility message */
#eligibilityMessage {
  margin-top: 10px;
  font-weight: 500;
  font-size: 14px;
}

/* Loader overlay */
.loader-overlay {
  position: absolute;
  inset: 0;
  display: none; /* toggled via JS */
  align-items: center;
  justify-content: center;
}
.loader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(2px);
  border-radius: 16px;
}
.loader-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader-text {
  font-size: 14px;
  color: #333;
  font-weight: 600;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Prevent background scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Confetti */
.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 16px;
}
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 12px;
  opacity: 0.9;
  top: -12px;
  will-change: transform, opacity;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110%) rotate(720deg); opacity: 1; }
}

.h4-heading {
  color: grey;
  font-size: 15px;
  margin-top: 6px;

}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  white-space: pre-line; /* allows \n line breaks */
  transition: all 0.4s ease;
  z-index: 9999;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  background-color: #e74c3c;
}
.toast.success {
  background-color: #2ecc71;
}
.toast.info {
  background-color: #3498db;
}