/* ===================================
   STELLAH AI - LEADCONNECTOR FORM BRANDING
   Custom styling to match brand identity
   =================================== */

/* Modal Enhancements */
#bookDemoModal {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Branded Modal Container */
#bookDemoModal .modal-container {
  position: relative;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
}

/* Branded Header (appears above iframe) */
.stellah-form-header {
  background: linear-gradient(135deg, #FF7A45 0%, #EA580C 100%);
  padding: 22px 60px;
  position: relative;
  overflow: hidden;
}

.stellah-form-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.stellah-form-header h2 {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #FFFFFF;
  margin: 0;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
  line-height: 1.4;
  text-align: center;
}

/* Trust Badge */
.stellah-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  padding: 6px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: #FFFFFF;
  font-weight: 600;
}

.stellah-trust-badge svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Close Button - Branded */
#bookDemoModal .close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#bookDemoModal .close-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

#bookDemoModal .close-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Iframe Container */
.stellah-iframe-wrapper {
  position: relative;
  background: #F8F9FA;
  padding: 0;
  min-height: 600px;
}

/* Loading State */
.stellah-form-loading {
  position: absolute;
  inset: 0;
  background: #F8F9FA;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  transition: opacity 0.3s ease-out;
}

.stellah-form-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.stellah-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 122, 69, 0.2);
  border-top-color: #FF7A45;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.stellah-form-loading p {
  color: #666666;
  font-size: 14px;
  font-weight: 500;
}

/* Iframe Styling */
#bookDemoModal iframe {
  width: 100%;
  height: 600px;
  border: none;
  background: #FFFFFF;
  display: block;
}

/* Footer Trust Indicators */
.stellah-form-footer {
  background: #F8F9FA;
  padding: 16px 24px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.stellah-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666666;
  font-weight: 500;
}

.stellah-trust-item svg {
  width: 16px;
  height: 16px;
  color: #10B981;
  flex-shrink: 0;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  #bookDemoModal .modal-container {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .stellah-form-header {
    padding: 18px 50px;
  }

  .stellah-form-header h2 {
    font-size: 16px;
    line-height: 1.3;
    margin: 0;
  }

  .stellah-trust-badge {
    font-size: 12px;
    padding: 5px 12px;
    margin-top: 10px;
  }

  .stellah-trust-badge svg {
    width: 14px;
    height: 14px;
  }

  #bookDemoModal .close-button {
    width: 36px;
    height: 36px;
    top: 12px;
    right: 12px;
  }

  #bookDemoModal .close-button svg {
    width: 18px;
    height: 18px;
  }

  #bookDemoModal iframe {
    height: calc(100vh - 220px);
    min-height: 450px;
  }

  .stellah-iframe-wrapper {
    min-height: 450px;
  }

  .stellah-form-footer {
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }

  .stellah-trust-item {
    font-size: 12px;
  }

  .stellah-trust-item svg {
    width: 14px;
    height: 14px;
  }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1023px) {
  #bookDemoModal .modal-container {
    max-width: 90%;
  }

  .stellah-form-header h2 {
    font-size: 26px;
  }
}

/* Animation entrance */
@keyframes modalContentSlide {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-open .modal-container {
  animation: modalContentSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Form Field Override Attempts (limited by CORS) */
/* These styles would apply if LeadConnector allows custom CSS injection */
.form-field-stellah {
  font-family: 'Inter', sans-serif !important;
  border: 2px solid #E5E7EB !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
  color: #333333 !important;
  transition: all 0.2s ease !important;
}

.form-field-stellah:focus {
  border-color: #FF7A45 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(255, 122, 69, 0.1) !important;
}

.form-label-stellah {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #333333 !important;
  margin-bottom: 6px !important;
  display: block !important;
}

.form-button-stellah {
  background: linear-gradient(135deg, #FF7A45 0%, #EA580C 100%) !important;
  color: #FFFFFF !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  padding: 14px 32px !important;
  border-radius: 9999px !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 12px rgba(255, 122, 69, 0.3) !important;
  letter-spacing: 0.3px !important;
}

.form-button-stellah:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(255, 122, 69, 0.4) !important;
}

.form-button-stellah:active {
  transform: translateY(0) !important;
}

/* Error State */
.form-error-stellah {
  color: #DC2626 !important;
  font-size: 13px !important;
  margin-top: 4px !important;
  font-weight: 500 !important;
}

/* Success State */
.form-success-stellah {
  background: #F0FDF4 !important;
  border: 2px solid #10B981 !important;
  color: #065F46 !important;
  padding: 16px !important;
  border-radius: 12px !important;
  text-align: center !important;
  font-weight: 600 !important;
}
