/* Base Form Styles */
#therapyForm {
  padding: 20px;
  border: 1px solid #ddd;
  color: #fff;
  background: #2e299e;
  border-radius: 25px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  font-family: "Inter Tight", inter-tight, sans-serif;
  transition: height 0.5s ease;
  overflow: hidden;
  background-image: linear-gradient(128deg, var(--e-global-color-primary) 0%, #0d012e 100%);
}

/* Loader */
.loader {
  text-align: center;
  padding: 20px;
  font-size: 18px;
}

.spinner {
  margin: 0 auto 10px;
  width: 40px;
  height: 40px;
  border: 4px solid #615be5;
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Simple Spin Animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  counter-reset: step;
  padding-left: 0;
}

.progress-bar li {
  list-style-type: none;
  flex: 1;
  position: relative;
  text-align: center;
  font-size: 13px;
  color: #fff;
}

.progress-bar li:before {
  content: counter(step);
  counter-increment: step;
  width: 30px;
  height: 30px;
  line-height: 30px;
  border: 1px solid #ddd;
  display: block;
  text-align: center;
  margin: 0 auto 5px;
  border-radius: 50%;
}

.progress-bar li.active {
  color: #fff;
  font-weight: 500;
  font-size: 82%;
}

.progress-bar li.active:before {
  font-size: 100%;
  font-weight: 700;
  border: 1px solid #b87d15;
  color: #ffaa45;
}

.progress-bar li:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: #ddd;
  top: 15px;
  left: -50%;
  z-index: -1;
}

.progress-bar li:first-child:after {
  content: none;
}

.progress-bar li.active:after {
  background: #ffffff;
}

/* Form Steps */
.form-step {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.form-step.active {
  display: block;
  padding: 5px;
}

/* Fade-in Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Headings & Labels */
.form-step h3 {
  font-size: 22px;
  margin-bottom: 20px;
  font-weight: 700;
  color: #ffffff;
}

#therapyForm label {
  display: block;
  margin: 10px 0 5px;
  font-weight: 600;
  color: #ffffff;
}

/* Inputs */
#therapyForm input[type="text"], 
#therapyForm input[type="email"], 
#therapyForm textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 9px;
  box-sizing: border-box;
  font-size: 16px;
  background: #fff;
  color: #000;
}

#therapyForm input[type="radio"] {
  margin-right: 5px;
}

/* Textarea Styling */
#therapyForm textarea {
  resize: vertical;
  height: 80px;
}

/* Custom Date Picker */
.custom-date-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.nav-arrow {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin: 0 10px;
  color: #fff;
}

.day-cells {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  color: #000;
  padding: 20px 0;
}

.day-cell {
  min-width: 60px;
  text-align: center;
  padding: 10px;
  margin: 0 5px;
  border-radius: 9px;
  cursor: pointer;
  background-color: #f0f0f0;
  user-select: none;
}

.day-cell:hover {
  background-color: #e0e0e0;
}

.day-cell.active {
  background-color: #605BE5;
  color: #fff;
}

.day-name {
  display: block;
  font-weight: 600;
}

/* Time Picker */
.time-cell {
  display: inline-block;
  padding: 8px 12px;
  margin: 5px;
  background-color: #f0f0f0;
  border-radius: 9px;
  cursor: pointer;
  color: #000000;
}

.time-cell:hover {
  background-color: #e0e0e0;
}

.time-cell.active {
  background-color: #605BE5;
  color: #fff;
}

/* Country Code & Phone Number */
.country-phone-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#country_code {
  width: 100px;
  padding: 8px;
  font-size: 16px;
}

#phone {
  width: 200px;
  padding: 8px;
  font-size: 16px;
}

/* Navigation Buttons */
.form-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

button {
  background-color: #605BE5;
}

button.next-btn, 
button.prev-btn, 
button.submit-btn,
button.newconsent-btn{
  padding: 15px 20px;
  color: #ffffff;
  border-radius: 15px;
  font-size: 16px;
  border: none;
  background-color: #605BE5;
  margin-top: 20px;
  transition: background 0.3s;
}

.close-btn {
  padding: 15px 20px;
  color: #ffffff;
  border-radius: 15px;
  font-size: 16px;
  border: none;
  background-color: red;
  margin-top: 20px;
  transition: background 0.3s;
}

button:hover {
  background-color: #5045c0;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Consent Section */
label[for="consent"] {
  font-size: 14px;
  line-height: 1.5;
}

/* Success Message */
.success-message {
  margin: 0;
  padding: 20px 10px;
  transition: height 0.5s ease;
  overflow: hidden;
  background-image: linear-gradient(128deg, var(--e-global-color-primary) 0%, #0d012e 100%);
  border: 0px solid #c8e6c9;
  border-radius: 25px;
  text-align: center;
}

.success-message h2, 
.success-message h3 {
  margin-bottom: 20px;
  color: #ffffff;
}

.success-message p {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 15px;
  color: #ffffff;
}

.country-phone-container {
  display: flex;
  flex-wrap: wrap;   /* allows wrapping on small screens */
  gap: 20px;         /* space between the two fields */
  align-items: flex-start; /* or use 'baseline' if you prefer */
  margin-bottom: 15px;
}

.country-phone-container .field-group {
  display: flex;
  flex-direction: column;
}

/* Ensure the label is spaced just above its field */
.country-phone-container .field-group label {
  margin-bottom: 5px;
  font-weight: 600;
}

/* Make select and input visually consistent */
.country-phone-container .field-group select,
.country-phone-container .field-group input[type="text"] {
  /* remove forced height, let padding define size */
  padding: 10px;
  line-height: 1.4;
  border: 1px solid #ddd;
  border-radius: 9px;
  box-sizing: border-box;
  font-size: 16px;
}

/* Narrower width for Country Code select */
.country-phone-container .field-group select[name="country_code"] {
  width: 110px;   /* adjust as needed */
  max-width: 110px;
}

textarea::placeholder {
  color: #888; /* Light gray for visibility */
  font-style: italic; /* Optional for emphasis */
  opacity: 0.7; /* Ensure readability */
  font-size:0.8em;
}

/* 2) Larger Textarea for Dream Description */
textarea[name="dream_description"] {
  width: 100%;
  min-height: 120px;
  border: 1px solid #ddd;
  border-radius: 9px;
  padding: 8px;
  margin-bottom: 10px;
  box-sizing: border-box;
}

/* 3) 'No Thanks' Step link (End Session) styled as black button */
.close-btn {
  display: inline-block;
  background-color: #000;
  color: #fff;
  text-decoration: none;
  padding: 15px 20px;
  border-radius: 15px;
}

/* 4) Example for checkboxes if you want a bit more spacing */
input[type="checkbox"] {
  margin-right: 6px;
  transform: scale(1.2);
}
#therapyForm .form-step {
  display: none !important;
  visibility: hidden !important;
  z-index: 0 !important;
  position: relative !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
#therapyForm .form-step.active {
  display: block !important; /* or flex, with !important */
  visibility: visible !important;
  z-index: 10000 !important; /* Ensure it’s on top */
  position: relative !important;
  opacity: 1 !important; /* Prevent fade-out issues */
  height: auto !important;
  overflow: visible !important;
  pointer-events: auto !important; /* Allow interaction */
}

#therapyForm .no-thanks-step {
  display: none !important;
  visibility: hidden !important;
  z-index: -1000 !important;
  position: relative !important;
  opacity: 0 !important;
  height: 0 !important; /* Collapse height */
  overflow: hidden !important; /* Hide overflow */
  pointer-events: none !important; /* Prevent interaction */
}
#therapyForm .no-thanks-step.active {
  display: block !important; /* or flex */
  visibility: visible !important;
  z-index: 1000 !important;
  position: relative !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
  pointer-events: auto !important; /* Allow interaction */
}

#therapyForm .form-step.active,
#therapyForm .no-thanks-step.active {
  transition: none !important; /* Remove any transitions causing delays */
}

/* Mobile Adjustments */
@media (max-width: 480px) {
  .progress-bar li {
    font-size: 11px;
  }

  .progress-bar li:before {
    font-size: 14px;
    line-height: 30px;
    width: 30px;
    height: 30px;
  }
  
  .progress-bar li.active {
    font-size: 11px;
  }
}