/* 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: 36px;
  top: 19px;
  font-size: 28px;
  color: #000;
  transition: 0.2s;
}
.close-btn:hover {
  color: #ff4d4d;
  transform: rotate(90deg);
  cursor: pointer;
}

/* 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;
  font-size: 15px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

}
.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;
  margin-top : 21px;
}
.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;
}

.thankyou-note {
  margin-top: 10px;
  color: #555;
  font-size: 15px;
}
.thankyou-note a {
  color: #007bff;
  text-decoration: none;
}
.thankyou-note a:hover {
  text-decoration: underline;
}
.file-size-note {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  margin-bottom: 10px;
  font-style: italic;
}

.popup.hidden {
  display: none;
}
.popup {
  display: flex; /* enables centering with flexbox */
  position: fixed;
  inset: 0;
  background: rgba(44, 62, 80, 0.45); /* deep blue overlay */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeInBg 0.3s;
}

@keyframes fadeInBg {
  from {background: rgba(44,62,80,0);}
  to {background: rgba(44,62,80,0.45);}
}

.popup-content {
  background: linear-gradient(120deg, #ffffff 75%, #e5f0fd 100%);
  padding: 32px 26px 22px 26px;
  border-radius: 18px;
  width: 92%;
  max-width: 430px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(44,62,80,0.13);
  position: relative;
  animation: popIn 0.5s;
  transition: box-shadow 0.25s, transform 0.25s;
  border: 1px solid #e8eaf6;
}

@keyframes popIn {
  from {transform: scale(0.8); opacity: 0;}
  to {transform: scale(1); opacity: 1;}
}

.close-popup {
  position: absolute;
  top: -1px; 
  right: 13px;
  font-size: 32px;
  cursor: pointer;
  color: #000;
  opacity: 65%;
  transition: color 0.18s, transform 0.18s;
}

.close-popup:hover {
  color: #2d8cf0;
  transform: rotate(90deg) scale(1.1);
  cursor: pointer;
}

h3 {
  color: #2d8cf0;
  font-size: 21px;
  margin-bottom: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

form label {
  display: block;
  margin: 14px 0 8px 0;
  font-size: 16px;
  color: #334e72;
  font-weight: 500;
  text-align: left;
}

input[type="checkbox"] {
  accent-color: #2d8cf0;
  margin-right: 10px;
  vertical-align: middle;
}

textarea {
  width: 100%;
  padding: 13px;
  border-radius: 8px;
  border: 1px solid #bfcfd8;
  margin-top: 11px;
  resize: vertical;
  min-height: 64px;
  font-size: 15px;
}

button[type="submit-form"] {
  background: linear-gradient(90deg, #2d8cf0 15%, #46e5c3 85%);
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 13px 0;
  margin-top: 21px;
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px 0 rgba(44,62,80,0.09);
  transition: background 0.28s, transform 0.16s;
}

button[type="submit-form"]:hover {
  background: linear-gradient(90deg, #46e5c3 15%, #2d8cf0 85%);
  transform: translateY(-2px) scale(1.04);
}
.thankyou-popup {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.thankyou-content {
  background: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  text-align: center;
  animation: popIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.thankyou-content h3 {
  color: #28a745;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}
@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.success-tick {
  font-size: 36px;
  color: #28a745;
  margin-bottom: 10px;
  animation: popTick 0.4s ease;
}

@keyframes popTick {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}
#eligibilityStep, #genericForm {
  transition: all 1s ease-in-out;
}

/* Greyed-out but still editable fields */
.prefilled {
  /* background-color: #f3f3f3 !important;
  border: 2px solid #ccc !important; */
  border: 2px solid #28a745 !important;  /* green success border */
  background-color: #f6fff9 !important;  /* subtle green tint */
  color: #000 !important;
  transition: background-color 0.2s ease-in-out;
}

/* When user focuses, restore normal appearance */
.prefilled:focus {
  background-color: #fff !important;
  border-color: #888 !important;
  color: #000 !important;
}

.prefilled-info-box {
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px 18px;
  margin-bottom: 20px;
  font-size: 14px;
}

.prefilled-info-box h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
}

.info-row {
  margin: 4px 0;
  color: #444;
}

.info-row strong {
  width: 130px;
  display: inline-block;
  color: #222;
}

.gender-inline {
  display: flex;
  align-items: center;
  gap: 28px; /* space between items */
  margin: -1px 4px;
  flex-wrap: wrap; /* makes it mobile-friendly */
}

.gender-inline label {
  font-size: 14px;
  color: #444;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.gender-inline input[type="radio"] {
  margin-right: 6px;
  accent-color: #007bff; /* changes radio color */
}

.gender-title {
  font-weight: 600;
  color: #333;
  margin-right: 10px;
  font-size: 15px;
}

.field-complete {
  border: 2px solid #28a745 !important;  /* green success border */
  background-color: #f6fff9 !important;  /* subtle green tint */
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.field-complete:focus {
  border-color: #1e7e34 !important;
  box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
}

/* ===========================
   Document Upload Layout
   =========================== */
.document-section {
  grid-column: 1 / -1; /* span full width in grid form */
  margin-top: 10px;
  text-align: left;
}

.document-main-label {
  display: block;
  font-weight: 600;
  color: #334e72;
  font-size: 16px;
  margin-bottom: 4px;
  text-align: center;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: end;
  margin-top: 10px;
}

.doc-col label {
  display: block;
  font-size: 15px;
  color: #444;
  font-weight: 500;
  margin-bottom: 6px;
}

.doc-col input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #bfcfd8;
  border-radius: 8px;
  background: #fafafa;
  transition: all 0.3s ease;
}

.doc-col input[type="file"]:focus {
  border-color: #007bff;
  background: #fff;
  outline: none;
}

/* Adjust file size note */
.document-section .file-size-note {
  font-size: 13px;
  color: #666;
  font-style: italic;
  margin-top: 2px;
  margin-bottom: 8px;
  text-align: center;
}

/* Responsive (stack on mobile) */
@media (max-width: 768px) {
  .document-grid {
    grid-template-columns: 1fr;
  }
}

button[disabled] {
  background-color: #ccc !important;
  cursor: not-allowed !important;
  pointer-events: none;
}


#cardSelector {
  margin-top: 15px;
}

.card-type-inline {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-top: 5px;
  margin-bottom: 5px;
  margin-left: 203px;
}

.radio-inline {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 16px;
  gap: 6px;
}

.radio-inline input[type="radio"] {
  accent-color: #2d6cdf; 
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#cardSelector small {
  color: #666;
  font-size: 13px;
  display: block;
  margin-top: 5px;
}
