/**
 * Endospheres Popup Widget Styles
 */

/* Popup Trigger Button */
.endospheres-popup-trigger {
  display: inline-block;
  padding: 16px 28px;
  background-color: #667eea;
  color: #fff;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.endospheres-popup-trigger:hover {
  background-color: #000;
  color: #fff;
}

/* Popup Overlay */
.endospheres-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overscroll-behavior: contain; /* prevent scroll chaining to body */
}

.endospheres-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Popup Modal */
.endospheres-popup-modal {
  background: #fff;
  border-radius: 10px;
  max-width: 90%;
  max-height: 96vh;
  width: 1100px;
  padding: 15px 40px;
  position: relative;
  overflow-y: auto !important; /* allow inner scroll */
  overflow-x: hidden;
  transform: scale(0.7);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overscroll-behavior: contain; /* keep wheel within modal */
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}

.endospheres-popup-overlay.active .endospheres-popup-modal {
  transform: scale(1);
}

/* Close Button */
.endospheres-popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: color 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

.endospheres-popup-close:hover {
  color: #000;
  transform: rotate(90deg);
}

.endospheres-popup-close svg {
  width: 24px;
  height: 24px;
}

/* Optional: ensure source stays hidden on page when not in popup */
.endospheres-popup-source-hidden, .wpcf7-hidden {
  display: none !important;
}

.endospheres-popup-content .endospheres-popup-source-hidden {
  display: block !important;
}

#endo-alternative-popup-content,
#endo-popup-message,
.endospheres-popup-content h2 br {
  display: none;
}

/* Scrollbar styling for popup */
.endospheres-popup-modal::-webkit-scrollbar {
  width: 8px;
}

.endospheres-popup-modal::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.endospheres-popup-modal::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.endospheres-popup-modal::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive */
@media (max-width: 768px) {
  .endospheres-popup-modal {
    max-width: 95%;
    padding: 30px 20px;
  }

  .endospheres-popup-close {
    top: 10px;
    right: 10px;
  }

  .endospheres-popup-trigger {
    padding: 14px 24px;
    font-size: 15px;
  }
}

/* Popup End ========================================================= */

/* Contact form for popup start ========================================================= */
.end-form-container {
  max-width: 1100px;
  margin: 0 auto;
  font-size: 18px;
  font-family: "Poppins", sans-serif;
}

.end-form-container .wpcf7-not-valid-tip {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  margin-top: 5px;
  margin-bottom: 5px;
}

.end-form-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.end-form-progress ul {
  display: flex;
  flex-wrap: wrap;
}

.end-form-progress li {
  flex-basis: 50%;
  position: relative;
}

.end-form-progress li::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #ade1f4;
}

.end-form-progress li.active::after {
  background-color: var(--cyan-dark);
}

.end-form-progress li a {
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  padding: 10px;
  display: block;
}

.end-form-progress li:nth-child(1) a {
  padding-left: 0;
}

.end-form-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#step-2.end-form-fields {
  gap: 0px;
}

.end-form-accordion {
  margin-bottom: 10px;
}

#step-2 .end-form-input-field {
  margin-bottom: 8px;
}

.end-form-accordion-title {
  background-color: #fff;
  padding: 10px 20px 11px;
  border-radius: 5px;
}

.end-form-accordion.active .end-form-accordion-title {
  border-radius: 5px 5px 0 0;
}

.end-form-accordion-title h2 {
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5em;
  display: flex;
  align-items: center;
}

.end-form-accordion-content {
  background-color: #fff;
  border-radius: 0 0 5px 5px;
}

.end-form-fields-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 50px;
}

#step-2 .end-form-fields-actions {
  margin-top: 20px;
}

.end-form-fields-actions a,
.end-form-fields-actions button,
.end-form-fields-actions input[type="submit"],
.end-form-submit-button {
  background-color: #00a2e0;
  padding: 16px 28px;
  border-radius: 5px;
  color: #fff;
  font-size: 18px;
  font-style: normal;
  font-weight: 600;
  line-height: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-family: "Poppins", sans-serif;
}

.end-form-fields-actions a:hover,
.end-form-fields-actions button:hover,
.end-form-fields-actions input[type="submit"]:hover,
.end-form-submit-button:hover {
  background-color: #000;
}

.end-form-progress li a {
  pointer-events: none;
  cursor: default;
  transition: opacity 0.3s ease;
}

.end-form-progress li.clickable a {
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
}

.end-form-progress li.clickable a:hover {
  opacity: 0.7;
}

.end-form-accordion-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
  padding: 0 20px;
}

.end-form-accordion.active .end-form-accordion-content {
  max-height: 500px;
  opacity: 1;
  padding: 4px 20px 0px;
  border-top: 1px solid #f1f1f1;
}

.end-form-accordion-title {
  cursor: pointer;
  user-select: none;
}

.end-form-container br {
  display: none;
}

.end-form-accordion-title svg {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.end-form-accordion.active .end-form-accordion-title svg {
  transform: rotate(180deg);
}

.end-form-fields {
  opacity: 1;
  transition: opacity 0.4s ease;
}

.end-form-fields.fade-out {
  opacity: 0;
}

#step-2 {
  display: none;
}

.end-form-input-field {
  margin-bottom: 15px;
  font-size: 18px;
  line-height: 1rem;
}

.end-form-input-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 0;
  color: #333;
}

.end-form-input-field input[type="text"],
.end-form-input-field input[type="email"],
.end-form-input-field input[type="tel"],
.end-form-input-field textarea,
.end-form-input-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 18px;
  font-family: inherit;
  transition: border-color 0.3s ease;
  color: #4e4e4e;
}

/* Select box with angle down icon */
.end-form-input-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px; /* Make room for the icon */
}

.end-form-input-field input[type="text"]::-webkit-input-placeholder,
.end-form-input-field input[type="text"]::-moz-placeholder,
.end-form-input-field input[type="text"]:-ms-input-placeholder,
.end-form-input-field input[type="text"]::placeholder,
.end-form-input-field input[type="email"]::-webkit-input-placeholder,
.end-form-input-field input[type="email"]::-moz-placeholder,
.end-form-input-field input[type="email"]:-ms-input-placeholder,
.end-form-input-field input[type="email"]::placeholder,
.end-form-input-field input[type="tel"]::-webkit-input-placeholder,
.end-form-input-field input[type="tel"]::-moz-placeholder,
.end-form-input-field input[type="tel"]:-ms-input-placeholder,
.end-form-input-field input[type="tel"]::placeholder,
.end-form-input-field textarea::-webkit-input-placeholder,
.end-form-input-field textarea::-moz-placeholder,
.end-form-input-field textarea:-ms-input-placeholder,
.end-form-input-field textarea::placeholder {
  color: #4e4e4e;
}

.end-form-input-field input[type="text"]:focus,
.end-form-input-field input[type="email"]:focus,
.end-form-input-field input[type="tel"]:focus,
.end-form-input-field textarea:focus,
.end-form-input-field select:focus {
  outline: none;
  border-color: var(--cyan-dark);
}

.end-form-input-field textarea {
  resize: vertical;
  min-height: 100px;
}

.end-form-input-field select:valid {
  color: rgba(78, 78, 78, 0.8);
}

.end-form-input-field input[type="radio"],
.end-form-input-field input[type="checkbox"] {
  cursor: pointer;
  margin: 0;
}

.end-form-input-field input[type="radio"] + .wpcf7-list-item-label,
.end-form-input-field input[type="checkbox"] + .wpcf7-list-item-label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.end-form-input-field input[type="radio"] + .wpcf7-list-item-label:before,
.end-form-input-field input[type="checkbox"] + .wpcf7-list-item-label:before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 100%;
  border: 3px solid #ddd;
  margin-right: 2px;
  background-color: #fff;
}

.end-form-input-field input[type="checkbox"] + .wpcf7-list-item-label:before {
  border-radius: 2px;
  border: 1px solid #000;
}

@media (max-width: 767px) {
  .end-form-input-field input[type="checkbox"] + .wpcf7-list-item-label:before {
    width: 44px;
  }
}

.end-form-input-field
  input[type="radio"]:checked
  + .wpcf7-list-item-label:before,
.end-form-input-field
  input[type="checkbox"]:checked
  + .wpcf7-list-item-label:before {
  background-color: var(--cyan-dark);
}

.end-form-input-field label[for]:not([for=""]) {
  cursor: pointer;
}

.end-form-input-field .wpcf7-list-item {
  margin-left: 0;
  margin-right: 1rem;
}

.end-form-input-field .wpcf7-list-item-label {
  font-size: 18px;
  color: #4e4e4e;
  line-height: 24px;
}

.end-form-container + .wpcf7-response-output {
  font-size: 18px;
  text-align: center;
  font-family: "Poppins", sans-serif;
}

.end-form-fields-actions .wpcf7-spinner {
  position: absolute;
}

.end-form-content-wrapper {
  display: flex;
  gap: 10px;
}

.end-form-content-wrapper .end-form-input-field:first-child {
  flex: 1;
}
.end-form-content-wrapper .end-form-input-field:last-child {
  white-space: nowrap;
}
.end-form-content-wrapper input.end-form-submit-button {
  padding-top: 13px;
  padding-bottom: 13px;
}

@media(max-width: 767px) {
  .end-form-content-wrapper {
    display: block;
  }
  .end-form-content-wrapper input.end-form-submit-button {
    width: 100%;
  }
  .end-form-fields-actions a {
    font-size: 15px;
    padding: 16px 26px;
  }
}
/* Contact form for popup end ========================================================= */
