/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 2px solid #231F20;
  width: 50%;
  max-width: 90%;
  max-height: 80%;
  overflow-y: auto;
  border-radius: 8px;
  position: relative;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

.close {
  color: #231F20;
  float: right;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 20px;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #231f20;
  text-decoration: none;
  cursor: pointer;
}

/* Form Container */
#form-container {
  margin: 0 auto;
  width: 100%;
  max-width: 500px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

label {
  font-weight: bold;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 3px solid #231F20;
  border-radius: 4px;
  font-size: 1rem;
}

/* Submit Button Styles */
input[type="submit"],
button[type="submit"] {
  background-color: #231F20;
  color: white;
  font-weight: bold;
  border: 3px solid #231F20;
  border-radius: 4px;
  cursor: pointer;
  padding: 10px 20px;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
  background-color: #FFCA00;
  border: 3px solid #FFCA00;
  color: #231F20;
}

/* =========================
   Privacy Consent Section Styling
   ========================= */
#privacy-consent-section {
  margin-top: 1.5em;
}

/* Aligns checkboxes and labels in a row */
#privacy-consent-section .hs-form__legal-consent__row {
  display: flex;
  align-items: center; /* Keeps checkbox and text vertically aligned */
  gap: 0.75em; /* Space between checkbox and text */
  flex-wrap: nowrap; /* Prevents wrapping */
}

/* Ensures checkboxes are properly aligned */
#privacy-consent-section input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0; /* Prevents resizing */
}

/* Labels should align next to checkboxes */
#privacy-consent-section label {
  flex-grow: 1; /* Ensures label takes available space */
  font-size: 0.9em;
  line-height: 1.4;
  white-space: normal; /* Allows text wrapping */
  text-align: left;
}

/* Ensure paragraphs have adequate spacing */
#privacy-consent-section p {
  margin-bottom: 1em;
  font-size: 0.9em;
  line-height: 1.4;
}

/* Privacy Policy Link Styling */
#privacy-consent-section a {
  text-decoration: none;
  color: #0073e6;
}

#privacy-consent-section a:hover {
  text-decoration: underline;
}

/* Responsive Modal Adjustments for Smaller Screens */
@media (max-width: 768px) {
  .modal-content {
    width: 90%;
    max-width: 90%;
    margin: 5% auto;
    padding: 15px;
  }

  form {
    gap: 10px;
  }

  input,
  select,
  textarea {
    font-size: 0.9rem;
  }

  .in-btn-custom {
    font-size: 0.9rem;
    padding: 8px 16px;
  }

/* Force privacy section to use flex */
#privacy-consent-section {
  display: flex !important;
  flex-direction: column;
  gap: 1rem; /* Space between sections */
  align-items: flex-start;
}

/* Ensure each row aligns checkboxes & labels properly */
.hs-form__legal-consent__row {
  display: flex !important;
  align-items: center !important; /* Keeps checkbox and text vertically aligned */
  gap: 0.75em; /* Space between checkbox and text */
  flex-wrap: nowrap; /* Prevents wrapping */
  width: 100%;
}

/* Ensure checkboxes do not shrink */
#privacy-consent-section input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0; /* Prevents resizing */
}

/* Ensure labels align properly next to checkboxes */
#privacy-consent-section label {
  flex-grow: 1;
  font-size: 0.9em;
  line-height: 1.4;
  white-space: nowrap; /* Prevents wrapping */
  text-align: left;
}

/* Force labels to stay on the same line */
.hs-form__legal-consent__row label {
  display: inline-block !important;
  vertical-align: middle;
  margin-left: 8px; /* Space between checkbox and label */
}

/* Ensure paragraphs have adequate spacing */
#privacy-consent-section p {
  margin-bottom: 1em;
  font-size: 0.9em;
  line-height: 1.4;
}

/* Ensure privacy policy text aligns properly */
#privacy-consent-section a {
  text-decoration: none;
  color: #0073e6;
}

#privacy-consent-section a:hover {
  text-decoration: underline;
}

/* Responsive Fix for Small Screens */
@media (max-width: 768px) {
  /* Ensure flex alignment on smaller screens */
  .hs-form__legal-consent__row {
    flex-direction: row;
    align-items: flex-start;
  }

  #privacy-consent-section input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }

  #privacy-consent-section label {
    white-space: normal !important; /* Allows wrapping on smaller screens */
  }
}
