/* ============================================
   CUSTOM LEAD GENERATION MODAL - FULL WIDTH TOP ALIGNED
   Brand new modal with custom classes - no popup builder conflicts
   ============================================ */

/* Hide old popup builder elements */
.sgpb-main-popup-data-container-2793,
#sg-popup-content-wrapper-2793,
.sgpb-popup-builder-content-2793,
.sgpb-popup-dialog-main-div-wrapper,
.sgpb-popup-dialog-main-div-theme-wrapper-3 {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Modal Overlay */
.ds-lead-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ds-lead-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main Modal Container - Full Width, 10px from top */
.ds-lead-modal-container {
  position: fixed;
  top: 10px;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 10px;
  z-index: 999999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-height: calc(100vh - 20px);
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.ds-lead-modal-container.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Modal Content Box */
.ds-lead-modal-content {
  width: 100%;
  max-width: 100%;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Modal Inner Content */
.ds-lead-modal-inner {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 30px 20px;
  box-sizing: border-box;
}

/* Form Styling - Professional Design */
.ds-lead-modal-inner .wpcf7-form {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.ds-lead-modal-inner .wpcf7-form p {
  margin: 0 0 20px 0;
  width: 100%;
  padding: 0;
}

.ds-lead-modal-inner .wpcf7-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}

.ds-lead-modal-inner .wpcf7-form-control {
  width: 100%;
  max-width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #ffffff;
}

.ds-lead-modal-inner .wpcf7-form-control:focus {
  outline: none;
  border-color: #627251;
  box-shadow: 0 0 0 3px rgba(98, 114, 81, 0.1);
}

.ds-lead-modal-inner .wpcf7-submit {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  background: #627251;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ds-lead-modal-inner .wpcf7-submit:hover {
  background: #4f5d3f;
  transform: translateY(-1px);
}

.ds-lead-modal-inner .wpcf7-submit:active {
  transform: translateY(0);
}

.ds-lead-modal-inner .wpcf7-submit.ds-submit-disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.ds-lead-modal-inner .wpcf7-submit.ds-submit-disabled:hover {
  transform: none;
}

/* Heading Styling */
.ds-lead-modal-inner .elementor-heading-title {
  margin: 0 0 25px 0;
  padding: 0;
  font-size: 24px;
  line-height: 1.3;
}

/* Phone Number Field Styling - No flag container in modal */
.ds-lead-modal-inner .ds-modal-phone-input {
  width: 100%;
  border-radius: 4px;
}

/* Select Dropdown Styling */
.ds-lead-modal-inner .wpcf7-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 40px;
}

/* Response Output Styling */
.ds-lead-modal-inner .wpcf7-response-output {
  display: none !important;
  visibility: hidden !important;
  margin: 15px 0 0 0;
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
}

/* Hide wpcf7-response-output from Book A Consultation form */
.elementor-element-554d3a9 .wpcf7-response-output,
#wpcf7-f2459-p2460-o3 .wpcf7-response-output {
  display: none !important;
  visibility: hidden !important;
}

/* Validation Error Styling - Global for all forms */
.ds-field-error {
  display: none;
  color: #d32f2f;
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.4;
  width: 100%;
}

.ds-field-error:not(:empty) {
  display: block;
}

.ds-field-invalid {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1) !important;
}

.ds-field-valid {
  border-color: #4caf50 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ds-lead-modal-container {
    top: 10px;
    padding: 0 5px;
    max-height: calc(100vh - 20px);
  }
  
  .ds-lead-modal-content {
    border-radius: 6px;
    max-height: calc(100vh - 20px);
  }
  
  .ds-lead-modal-inner {
    padding: 20px 15px;
    max-height: calc(100vh - 60px);
  }
  
  .ds-lead-modal-inner .wpcf7-form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
  }
  
  .ds-lead-modal-inner .wpcf7-submit {
    font-size: 15px;
    padding: 12px 15px;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .ds-lead-modal-inner {
    padding: 25px 30px;
  }
}

/* Desktop */
@media (min-width: 1025px) {
  .ds-lead-modal-container {
    max-width: 480px;
    width: 480px;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(0);
    padding: 0;
  }
  
  .ds-lead-modal-container.active {
    transform: translateX(-50%) translateY(0);
  }
  
  .ds-lead-modal-content {
    max-width: 480px;
    width: 100%;
  }
  
  .ds-lead-modal-inner {
    padding: 40px 50px;
  }
}

/* ============================================
   GLOBAL CONTACT FORM 7 STYLING
   Apply lead modal form styling to all forms
   ============================================ */

/* Global Form Styling - Applied to all Contact Form 7 forms */
.wpcf7-form {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.wpcf7-form p {
  margin: 0 0 20px 0;
  width: 100%;
  padding: 0;
}

.wpcf7-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}

.wpcf7-form-control {
  width: 100%;
  max-width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #ffffff;
}

.wpcf7-form-control:focus {
  outline: none;
  border-color: #627251;
  box-shadow: 0 0 0 3px rgba(98, 114, 81, 0.1);
}

.wpcf7-submit {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  background: #627251;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wpcf7-submit:hover {
  background: #4f5d3f;
  transform: translateY(-1px);
}

.wpcf7-submit:active {
  transform: translateY(0);
}

.wpcf7-submit.ds-submit-disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.wpcf7-submit.ds-submit-disabled:hover {
  transform: none;
}

/* Select Dropdown Styling - Global */
.wpcf7-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 40px;
}


/* Mobile Responsive - Global Forms */
@media (max-width: 768px) {
  .wpcf7-form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
  }
  
  .wpcf7-submit {
    font-size: 15px;
    padding: 12px 15px;
  }
}
