/* hubspot-popup.css */
/* Modal Overlay Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Modal visible state */
.modal-overlay.open {
  display: flex;
}

/* Updated Modal Content Container with increased width to 675px */
.modal-content {
  background: #fff;
  padding: 2em;
  border-radius: 8px;
  width: 700px;       /* Fixed width updated to 675px */
  max-width: 90%;     /* Responsive fallback on smaller screens */
  max-height: 90vh;   /* Limit modal height to 90% of the viewport */
  overflow-y: auto;   /* Enable vertical scrolling when necessary */
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
}

/* Modal Header Styling */
.modal-header {
  text-align: center;
  margin-bottom: 1.5em;
  font-family: "Poppins", sans-serif;
}

.modal-headline {
  font-size: 24px; /* Headline font size */
  margin: 0.5em 0;
  color: #4D4643; /* Credit Suite primary text color */
}

/* Responsive Adjustments for Mobile */
@media (max-width: 600px) {
  .modal-headline {
    font-size: 20px; /* Updated for mobile: 20px */
  }
}

.modal-graphic {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto; /* Center graphic/logo */
}

/* Custom Form Styling */
#customHubSpotForm {
  font-family: "Poppins", sans-serif; /* Default font family */
  box-sizing: border-box;
}

/* New: Two-column row layout for grouped fields */
.form-row {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 1.5em;
}
.form-row > div {
  flex: 1;
}

/* Keep existing styling for individual form elements */
#customHubSpotForm > div {
  margin-bottom: 1.5em;
}
#customHubSpotForm label {
  display: block;
  margin-bottom: 0.5em;
  font-weight: 600;
  color: #4D4643; /* Credit Suite primary text color */
}

#customHubSpotForm input[type="text"],
#customHubSpotForm input[type="email"],
#customHubSpotForm input[type="tel"],
#customHubSpotForm select {
  width: 100%;
  padding: 0.75em;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#customHubSpotForm input[type="text"]:focus,
#customHubSpotForm input[type="email"]:focus,
#customHubSpotForm input[type="tel"]:focus,
#customHubSpotForm select:focus {
  border-color: #196499;
  box-shadow: 0 0 0 3px rgba(0, 115, 230, 0.2);
  outline: none;
}

/* Custom Form Styling - Submit Button Base */
#customHubSpotForm button[type="submit"] {
  background-color: #196499;
  color: #fff;
  border: none;
  padding: 0.75em 1.5em;
  font-size: 1.5em;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: block;      /* Block-level for centering */
  margin: 0 auto;      /* Center horizontally */
}

/* Responsive Adjustments for Mobile */
@media (max-width: 600px) {
  #customHubSpotForm button[type="submit"] {
    width: 100%;         /* Full width on mobile */
    font-size: 1.3m;    /* Slightly larger font to fill space appropriately */
    padding: 1.5em;     /* Adjust padding if needed */
  }
}

/* Override grouped layout on mobile: Each field on a separate row */
@media (max-width: 600px) {
  .form-row {
    display: block;
  }
}

/* Hover state for submit button */
#customHubSpotForm button[type="submit"]:hover {
  background-color: #114569;
}

/* TCPA Legal Text Styling */
.tcpa-legal {
  font-size: 10px;
  line-height: 1.3em;
  text-align: center;
  margin-top: 1em;
  color: #4D4643; /* Credit Suite primary text color */
}

/* Loading Indicator Styles */
.loading-indicator {
  margin-top: 1em;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5em;
}

.progress-bar-inner {
  width: 0;
  height: 100%;
  background-color: #196499;
  transition: width 2s ease-in-out;
}

.spinner {
  display: none;
  width: 24px;
  height: 24px;
  border: 3px solid #ccc;
  border-top-color: #196499;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.loading-message {
  font-size: 1em;
  color: #333;
  margin-top: 0.5em;
}

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

/* Responsive Adjustments */
@media (max-width: 600px) {
  .modal-content {
    padding: 1.5em;
  }
}

/* NEW: Input Error Styling - applies a red border to invalid input fields */
.input-error {
  border: 1px solid red !important;
}

/* ===============================
   EMBED FORM STYLING
   =============================== */

/* Base embed form styling */
/* Higher specificity for Thrive Architect compatibility */
.hubspot-embed-container .hs-embed-form,
div.hs-embed-form,
.hs-embed-form {
  font-family: "Poppins", sans-serif !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
  padding: 1.5em 1.5em 0.8em 1.5em !important; /* Reduced: was 2em 2em 1em 2em */
  margin: 0 !important;
  background-color: #FFFFFF !important; /* Static white background for any page background */
  border: 1px solid #D4D4D4 !important; /* Light gray border for definition */
  border-radius: 8px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important; /* Reduced shadow */
}

/* Embed form container responsive adjustments */
.hs-embed-form > div {
  margin-bottom: 1em; /* Reduced from 1.5em to 1em */
}

.hs-embed-form .form-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8em; /* Reduced from 1em to 0.8em */
  margin-bottom: 1em; /* Reduced from 1.5em to 1em */
}

.hs-embed-form .form-row > div {
  flex: 1;
}

/* Form submit button container */
.hs-embed-form .form-submit {
  margin-top: 0.8em; /* Reduced from 1em to 0.8em */
  margin-bottom: 0.6em !important; /* Ensure no bottom margin on submit container */
  text-align: center;
}

/* Embed form input styling with higher specificity */
.hubspot-embed-container .hs-embed-form label,
div.hs-embed-form label,
.hs-embed-form label {
  display: block !important;
  margin-bottom: 0.3em !important; /* Reduced from 0.5em to 0.3em */
  font-weight: 600 !important;
  color: #4D4643 !important; /* Credit Suite primary text color */
  font-size: 0.75em !important; /* Reduced from 0.8em to 0.75em */
}

.hubspot-embed-container .hs-embed-form input[type="text"],
.hubspot-embed-container .hs-embed-form input[type="email"],
.hubspot-embed-container .hs-embed-form input[type="tel"],
.hubspot-embed-container .hs-embed-form select,
div.hs-embed-form input[type="text"],
div.hs-embed-form input[type="email"],
div.hs-embed-form input[type="tel"],
div.hs-embed-form select,
.hs-embed-form input[type="text"],
.hs-embed-form input[type="email"],
.hs-embed-form input[type="tel"],
.hs-embed-form select {
  width: 100% !important;
  padding: 0em .6em !important; /* Reduced from 0.75em to 0.6em */
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  font-size: 0.95rem !important; /* Reduced from 1rem to 0.95rem */
  box-sizing: border-box !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.hs-embed-form input[type="text"]:focus,
.hs-embed-form input[type="email"]:focus,
.hs-embed-form input[type="tel"]:focus,
.hs-embed-form select:focus {
  border-color: #196499;
  box-shadow: 0 0 0 3px rgba(0, 115, 230, 0.2);
  outline: none;
}

/* Embed form submit button with high specificity */
.hubspot-embed-container .hs-embed-form button[type="submit"],
div.hs-embed-form button[type="submit"],
.hs-embed-form button[type="submit"] {
  background-color: #196499 !important;
  color: #fff !important;
  border: none !important;
  padding: 0.75em 1.5em !important;
  font-size: 1.2em !important; /* Maintained at 1.2em as requested */
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: background-color 0.3s ease !important;
  min-width: 150px !important;
  display: inline-block !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.hubspot-embed-container .hs-embed-form button[type="submit"]:hover,
div.hs-embed-form button[type="submit"]:hover,
.hs-embed-form button[type="submit"]:hover {
  background-color: #114569 !important;
}

/* ===============================
   EMBED RESPONSIVE BREAKPOINTS
   =============================== */

/* Ultra Compact (< 400px) - Force single column, minimal spacing */
.hs-embed-form[data-container-size="ultra-compact"] .form-row {
  display: block;
}

.hs-embed-form[data-container-size="ultra-compact"] > div {
  margin-bottom: 1em;
}

.hs-embed-form[data-container-size="ultra-compact"] label {
  font-size: 0.9rem !important; /* Minimum readable size for ultra-compact: 14.4px */
}

.hs-embed-form[data-container-size="ultra-compact"] input,
.hs-embed-form[data-container-size="ultra-compact"] select {
  padding: 0.75rem !important;
  font-size: 1rem !important; /* Never go below 16px on mobile - prevents zoom */
}

.hs-embed-form[data-container-size="ultra-compact"] button[type="submit"] {
  width: 100%;
  padding: 0.8em;
  font-size: 1.1em; /* Slightly smaller button text for ultra-compact */
}

/* Compact (400-600px) - Single column, standard spacing */
.hs-embed-form[data-container-size="compact"] .form-row {
  display: block;
}

.hs-embed-form[data-container-size="compact"] button[type="submit"] {
  width: 100%;
  font-size: 1.2em; /* Standard button size */
}

/* Standard (600-800px) - Some field grouping allowed */
.hs-embed-form[data-container-size="standard"] .form-row {
  display: flex;
  gap: 1em;
}

/* Full (800px+) - Optimal layout with full field grouping */
.hs-embed-form[data-container-size="full"] .form-row {
  display: flex;
  gap: 1.5em;
}

.hs-embed-form[data-container-size="full"] button[type="submit"] {
  font-size: 1.3em; /* Slightly larger for full-width containers */
  padding: 1em 2em;
}

/* ===============================
   EMBED HEADLINE STYLING
   =============================== */

.embed-headline {
  font-size: 1.1em !important;
  font-weight: 600 !important;
  color: #4D4643 !important; /* Credit Suite primary text */
  text-align: center !important;
  margin: 0 0 1.2em 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}



/* ===============================
   EMBED LOADING AND MESSAGES
   =============================== */

/* Embed loading indicator */
.hs-embed-form + .loading-indicator {
  margin-top: 1em;
  text-align: center;
}

/* Embed success message */
.embed-success-message {
  text-align: center;
  padding: 2em;
  background-color: #ECF5FB; /* Credit Suite light background */
  border-radius: 8px;
  border: 2px solid #0CAE87; /* Credit Suite jungle green */
}

.embed-success-message .success-icon {
  font-size: 3em;
  color: #0CAE87; /* Credit Suite jungle green */
  margin-bottom: 0.5em;
}

.embed-success-message .success-text {
  font-size: 1.1em;
  color: #4D4643; /* Credit Suite primary text */
  font-weight: 500;
}

/* Embed error message */
.embed-error-message {
  text-align: center;
  padding: 1em;
  background-color: #f8d7da;
  border-radius: 4px;
  border: 1px solid #dc3545;
  margin-top: 1em;
}

.embed-error-message .error-icon {
  font-size: 1.5em;
  color: #dc3545;
  margin-bottom: 0.5em;
}

.embed-error-message .error-text {
  color: #721c24;
  font-weight: 500;
}

/* ===============================
   MOBILE RESPONSIVE ADJUSTMENTS FOR EMBED
   =============================== */

@media (max-width: 600px) {
  /* Force single column on mobile regardless of container size */
  .hubspot-embed-container .hs-embed-form .form-row,
  div.hs-embed-form .form-row,
  .hs-embed-form .form-row {
    display: block !important;
  }
  
  /* Mobile submit button - high specificity to override Thrive */
  .hubspot-embed-container .hs-embed-form button[type="submit"],
  div.hs-embed-form button[type="submit"],
  .hs-embed-form button[type="submit"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: auto !important;
    padding: 1em 1.5em !important; /* Increased padding for better touch target */
    font-size: 1.25rem !important; /* Modern recommended button size: 20px */
    margin: 0 auto !important;
    box-sizing: border-box !important;
    display: block !important;
    min-height: 44px !important; /* Apple/WCAG recommended minimum touch target */
  }
  
  /* Mobile form container adjustments */
  .hubspot-embed-container .hs-embed-form,
  div.hs-embed-form,
  .hs-embed-form {
    padding: 1.5rem 1.25rem 1.25rem 1.25rem !important; /* Modern mobile padding with proper spacing */
    margin: 0 !important;
  }
  
  /* Mobile form field spacing - MAXIMUM SPECIFICITY */
  .hubspot-embed-container .hs-embed-form > div,
  .hubspot-embed-container .hs-embed-form .form-row,
  div.hs-embed-form > div,
  div.hs-embed-form .form-row,
  .hs-embed-form > div,
  .hs-embed-form .form-row,
  .hs-embed-form[data-container-size="ultra-compact"] > div,
  .hs-embed-form[data-container-size="compact"] > div,
  .hs-embed-form[data-container-size="standard"] > div,
  .hs-embed-form[data-container-size="full"] > div {
    margin-bottom: 0.75rem !important; /* Aggressive mobile spacing reduction */
  }
  
  /* Mobile headline spacing adjustment */
  .hs-embed-form .embed-headline {
    margin-bottom: 1rem !important;
    font-size: 1.05em !important; /* Slightly smaller on mobile */
  }
  
  .hubspot-embed-container .hs-embed-form label,
  div.hs-embed-form label,
  .hs-embed-form label {
    font-size: 1rem !important; /* Modern mobile label size: 16px */
    margin-bottom: 0.5rem !important;
  }
  
  .hubspot-embed-container .hs-embed-form input,
  .hubspot-embed-container .hs-embed-form select,
  div.hs-embed-form input,
  div.hs-embed-form select,
  .hs-embed-form input,
  .hs-embed-form select {
    font-size: 1rem !important; /* Modern mobile input size: 16px - prevents zoom */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-height: 44px !important; /* WCAG/Apple recommended minimum touch target */
    line-height: 1.5 !important; /* Better text readability */
  }
}

/* MAXIMUM SPECIFICITY OVERRIDE for stubborn themes */
div.tcb-col .hubspot-embed-container .hs-embed-form input[type="text"],
div.tcb-col .hubspot-embed-container .hs-embed-form input[type="email"], 
div.tcb-col .hubspot-embed-container .hs-embed-form input[type="tel"],
div.tcb-col .hubspot-embed-container .hs-embed-form select,
div.tcb-col div.hs-embed-form input[type="text"],
div.tcb-col div.hs-embed-form input[type="email"],
div.tcb-col div.hs-embed-form input[type="tel"],
div.tcb-col div.hs-embed-form select,
.tcb-col .hs-embed-form input[type="text"],
.tcb-col .hs-embed-form input[type="email"],
.tcb-col .hs-embed-form input[type="tel"],
.tcb-col .hs-embed-form select {
  font-size: 1rem !important;
  min-height: 44px !important;
  padding: 0em .6em !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
}

/* AGGRESSIVE MOBILE SPACING OVERRIDE - Final attempt */
div.tcb-col .hubspot-embed-container .hs-embed-form > div,
div.tcb-col .hubspot-embed-container .hs-embed-form .form-row,
div.tcb-col div.hs-embed-form > div,
div.tcb-col div.hs-embed-form .form-row,
.tcb-col .hs-embed-form > div,
.tcb-col .hs-embed-form .form-row {
  margin-bottom: 0.75rem !important;
}

/* Tablet adjustments */
@media (min-width: 601px) and (max-width: 900px) {
  .hs-embed-form .form-row {
    gap: 1em;
  }
  
  .hs-embed-form button[type="submit"] {
    min-width: 200px;
  }
}