/* Improved Dynamic Referral Form Styling */

/* Make the form header sticky */
.gb-header {
  position: sticky;
  top: 0;
  background: #20b4ef; /* Blue header as per screenshot */
  color: white;
  padding: 20px;
  z-index: 100;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gb-header h1 {
  color: white !important;
  text-shadow: none !important;
  margin: 0;
  font-size: 2rem;
  text-align: center;
}

.gb-header h1::after {
  background: linear-gradient(90deg, white, transparent) !important;
}

/* Ensure the form has proper padding and doesn't collapse */
.gb-page {
  min-height: calc(100vh - 180px);
  padding-bottom: 80px !important;
}

.gb-container {
  padding: 0 20px !important;
}

/* Style section headers to match the yellow in screenshot */
.card__head {
  background: #face03 !important; /* Yellow header from screenshot */
  padding: 12px 20px !important;
  border-radius: 12px 12px 0 0 !important;
}

.card__head h2 {
  color: #103400 !important;
  font-weight: 700 !important;
}

/* Make cards more robust against collapsing */
.card {
  margin: 25px 0 !important;
  border: none !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
  overflow: visible !important;
  position: relative;
}

/* Add padding to card bodies */
.card__body {
  padding: 20px !important;
}

/* Improve form field styling */
#referral-form :where(input[type="text"], input[type="email"], input[type="tel"], select, textarea) {
  height: 52px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

#referral-form :where(input[type="text"], input[type="email"], input[type="tel"], select, textarea) {
  transition: all 0.3s ease;
}

#referral-form :where(input[type="text"], input[type="email"], input[type="tel"], select, textarea):focus {
  border-color: #20b4ef;
  box-shadow: 0 0 0 3px rgba(32, 180, 239, 0.2);
  transform: translateY(-1px);
}

/* Field focus styling */
.field--focus {
  background-color: rgba(32, 180, 239, 0.05);
  padding: 8px;
  border-radius: 4px;
  margin: -8px;
  transition: all 0.3s ease;
}

/* Add subtle animations to form elements */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeIn 0.5s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }

/* Improve grid responsiveness */
@media (max-width: 860px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .gb-header {
    top: 56px; /* Adjust for mobile navbar */
  }
  
  .card__head {
    top: 104px; /* Adjust based on mobile navbar + header */
  }
  
  /* Improve form button layout on mobile */
  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }
  
  .action-buttons button {
    width: 100%;
  }
}

/* Fix service cards to prevent collapsing */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.checkcard {
  height: auto;
  min-height: 100px;
  padding: 15px;
  transition: all 0.3s ease;
}

/* Add scroll-to-top button */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #20b4ef;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  border: none;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: #0275e2;
  transform: translateY(-3px);
}

/* Add progress indicator */
.form-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: #a6ce39;
  z-index: 1000;
  width: 0%;
  transition: width 0.3s ease;
}

/* Add smooth scrolling to the entire page */
html {
  scroll-behavior: smooth;
}

/* Fix for ios position:sticky */
@supports (-webkit-overflow-scrolling: touch) {
  .gb-header {
    position: -webkit-sticky;
  }
}

/* Submit button enhancements */
#referral-form button[type="submit"] {
  margin-top: 20px;
  padding: 12px 25px;
  font-size: 1.1rem;
}
