.referral-form-wrap {
  max-width: 820px;
  margin: 0px auto;
}

.success-message {
  padding: 100px 0px;
}

.success-message h4 {
  color: #3b3b3b;
  font-size: 42px;
  line-height: 10px;
}
.success-message p {
  margin-top: 15px;
  font-size: 21px;
  font-weight: 500;
}

.success-message p a {
  display: block;
  background: #3b3b3b;
  width: 370px;
  margin: 0 auto;
  margin-top: 25px;
  color: #fff;
  padding: 15px;
  text-transform: uppercase;
  border-radius: 50px;
  font-weight: 600;
}
.referral-form-wrap .referral-form-box {
  background: #fafafa;
  padding: 30px;
  border-radius: 12px;
}
.referral-form-wrap .form_title {
  font-size: 30px;
  line-height: 40px;
  margin-bottom: 5px;
  color: #3b3b3b;
  font-weight: bold !important;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
}
.referral-form-wrap > p {
  font-size: 20px;
  line-height: 30px;
}
/* Referral form: Chosen dropdowns full width (100%) */
.referral-form-wrap form#referral-form .chosen-container,
.referral-form-wrap form#referral-form .chosen-container-single,
.referral-form-wrap form#referral-form .chosen-container-multi {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}
.referral-form-wrap form#referral-form .chosen-container-multi .chosen-choices,
.referral-form-wrap form#referral-form .chosen-container-single .chosen-single {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}

/* Whole form: font-weight 500, color black */
.referral-form-wrap form#referral-form {
  font-weight: 500;
  color: #000;
}

#referral-form label {
  font-weight: 500;
  color: #000;
}
.referral-form-wrap form#referral-form label.error {
  font-size: 12px;
  line-height: 22px;
  margin: -18px 0 18px 0;
  color: red;
  font-weight: 500;
  display: block;
}

/* Hide labels that are moved into fields as placeholders (keep for accessibility) */
.referral-form-wrap
  form#referral-form
  label.referral-field-label-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Stronger, black borders on form fields for better contrast */
.referral-form-wrap form#referral-form input[type='text'],
.referral-form-wrap form#referral-form input[type='email'],
.referral-form-wrap form#referral-form select,
.referral-form-wrap form#referral-form textarea {
  border: 2px solid #000;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 500;
  color: #000;
  margin-bottom: 18px;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.referral-form-wrap form#referral-form input[type='text']::placeholder,
.referral-form-wrap form#referral-form input[type='email']::placeholder,
.referral-form-wrap form#referral-form textarea::placeholder {
  color: #000;
  opacity: 1;
}
.referral-form-wrap form#referral-form input[type='text']:focus,
.referral-form-wrap form#referral-form input[type='email']:focus,
.referral-form-wrap form#referral-form select:focus,
.referral-form-wrap form#referral-form textarea:focus {
  border-color: #000;
  outline: none;
}
/* Spacing for field wrappers so dropdowns and message area have proper gaps */
.referral-form-wrap form#referral-form .loader-container,
.referral-form-wrap form#referral-form .messageBox {
  margin-bottom: 18px;
}
.referral-form-wrap form#referral-form .error-message {
  margin-top: 0;
  margin-bottom: 0;
}
/* Chosen.js dropdowns: match 2px black border */
.referral-form-wrap form#referral-form .chosen-container-single .chosen-single,
.referral-form-wrap form#referral-form .chosen-container-multi .chosen-choices {
  border: 2px solid #000 !important;
  border-radius: 6px;
  min-height: 42px;
}
.referral-form-wrap
  form#referral-form
  .chosen-container-active.chosen-with-drop
  .chosen-single,
.referral-form-wrap
  form#referral-form
  .chosen-container-multi.chosen-container-active
  .chosen-choices {
  border-color: #000 !important;
}
.chosen-container .chosen-drop {
  border: 2px solid #000 !important;
  border-top: none !important;
}
.referral-form-wrap form#referral-form .chosen-container {
  font-size: 17px !important;
}
.referral-form-wrap form#referral-form .chosen-container .chosen-single,
.referral-form-wrap form#referral-form .chosen-container .chosen-choices input {
  color: #000 !important;
  font-weight: 500;
}
.chosen-container {
  font-size: 17px !important;
}

.chosen-container .chosen-results li {
  line-height: 24px;
  word-wrap: break-word;
  -webkit-touch-callout: none;
  font-size: 18px;
  font-weight: 600;
}

.loader-container {
  position: relative;
}

.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 9px;
  left: 135px;
  transform: translateY(-50%);
  display: none; /* Initially hidden */
}

.error-message {
  color: red;
  font-size: 14px;
  font-weight: 700;
}

.loader#emailloader {
  top: 30px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.active-box {
  display: block !important;
}
/* ---------08/12/2023--------- */
.hfeed .ast-container div#primary {
  margin: 0 !important;
}
/* Selected tags: black background, white text, no border radius, white X icon */
.referral-form-wrap
  form#referral-form
  .chosen-container
  > ul.chosen-choices
  > li.search-choice {
  background: #000 !important;
  color: #fff !important;
  font-weight: 600;
  margin: 0 0 2px 0 !important;
  padding: 6px 28px 6px 12px !important;
  display: inline-block;
  line-height: 1.4;
  border: none !important;
  border-radius: 0 !important;
  width: 100%;
}
.referral-form-wrap
  form#referral-form
  .chosen-container
  > ul.chosen-choices
  > li.search-choice
  > span {
  color: #fff !important;
  font-weight: 600;
}
.referral-form-wrap
  form#referral-form
  .chosen-container
  > ul.chosen-choices
  > li.search-choice
  a.search-choice-close {
  color: #fff !important;
  opacity: 1;
  filter: brightness(0) invert(1);
}
.referral-form-wrap
  form#referral-form
  .chosen-container
  > ul.chosen-choices
  > li.search-choice
  a.search-choice-close:hover {
  color: #fff !important;
  opacity: 1;
  filter: brightness(0) invert(1);
}
/* Chosen multi list: full width, allow tags to wrap and sit side by side */
.referral-form-wrap
  form#referral-form
  .chosen-container-multi
  ul.chosen-choices {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  padding: 0 !important;
  list-style: none !important;
}
.referral-form-wrap
  form#referral-form
  .chosen-container-multi
  ul.chosen-choices
  li {
  list-style: none !important;
}
.referral-form-wrap
  form#referral-form
  .chosen-container-multi
  ul.chosen-choices
  li.search-field {
  flex: 1 1 auto !important;
  min-width: 100px !important;
}
/* Select Course(s) input area: white background, black text (match other fields) */
.referral-form-wrap form#referral-form .chosen-container-multi .chosen-choices {
  background: #fff !important;
}
.referral-form-wrap
  form#referral-form
  .chosen-container-multi
  .chosen-choices
  li.search-field {
  background: #fff !important;
}
.referral-form-wrap
  form#referral-form
  .chosen-container-multi
  .chosen-choices
  li.search-field
  input[type='text'] {
  color: #000 !important;
  background: #fff !important;
}
/* Secondary buttons: white background, black border, same height and radius as others */
.referral-form-wrap form#referral-form #previewBtn {
  background: #fff !important;
  color: #000;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.3s ease;
  padding: 10px 16px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: bold;
  border: 2px solid #000;
  border-radius: 6px;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
}
.referral-form-wrap form#referral-form #editBtn {
  background: #fff !important;
  color: #000;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.3s ease;
  padding: 10px 28px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: bold;
  border: 2px solid #000;
  border-radius: 6px;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
}
.chosen-container-multi .chosen-choices li.search-field input[type='text'] {
  margin: 0 !important;
  color: #000 !important;
  background: #fff !important;
  font-weight: 500;
}
.referral-form-wrap form#referral-form #previewBtn:hover,
.referral-form-wrap form#referral-form #editBtn:hover {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
}

/* Primary submit button: solid black, same height and radius as others */
.referral-form-wrap form#referral-form input[type='submit'] {
  margin: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  max-width: 180px;
  font-size: 16px !important;
  font-weight: bold;
  padding: 10px 24px !important;
  margin-top: 0 !important;
  border: 2px solid #000 !important;
  background: #000 !important;
  color: #fff !important;
  border-radius: 6px;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
}
.referral-form-wrap form#referral-form input[type='submit']:hover {
  background: #333 !important;
  border-color: #333 !important;
  color: #fff !important;
}
.hfeed .site-primary-footer-wrap {
  padding-top: 0;
  padding-bottom: 0;
}
/* Button row: center all buttons as a group */
.referral-form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  width: 100%;
}
.referral-form #submitBtn,
.referral-form #clearBtn,
.referral-form #previewBtn,
.referral-form #editBtn {
  margin: 0;
}
.emailPreview {
  background: #fdfdfd;
  border-radius: 8px;
  padding: 20px;
}
.referral-form-wrap form#referral-form .chosen-container .chosen-drop {
  border: 2px solid #000 !important;
  border-top: none !important;
}

/* 13/12/2023 */
.success-message h4 {
  line-height: normal;
}
@media (max-width: 767px) {
  .referral-form-wrap {
    padding: 0 !important;
  }
  .referral-form-wrap .referral-form-box {
    padding: 0;
  }
  .elementor-88393 .elementor-element.elementor-element-465086f7 {
    margin-top: 40px !important;
  }
  .elementor-88393 .elementor-element.elementor-element-465086f7 {
    margin-top: 15px;
  }
  .referral-form-wrap form#referral-form #previewBtn,
  .referral-form-wrap form#referral-form #editBtn,
  .referral-form-wrap form#referral-form #clearBtn,
  .referral-form-wrap form#referral-form input[type='submit'] {
    font-size: 14px !important;
    padding: 8px 12px;
  }
  .elementor-88393 .elementor-element.elementor-element-465086f7 {
    margin-top: 40px !important;
  }
  .referral-form-wrap form#referral-form input[type='submit'] {
    font-size: 14px;
  }
  .success-message p a {
    max-width: 370px;
    width: 100%;
  }
  .success-message h4 {
    line-height: normal;
  }

  .referral-form {
    flex-direction: column;
  }
  .referral-form-wrap form#referral-form #submitBtn {
    max-width: none !important;
  }
}
@media (max-width: 480px) {
  .success-message {
    padding: 0;
  }
  .success-message h4 {
    font-size: 24px;
  }
  .success-message p a {
    font-size: 16px;
  }
  .referral-form {
    flex-direction: column;
  }

  .referral-form-wrap form#referral-form #submitBtn {
    max-width: none !important;
  }
}
@media (max-width: 375px) {
  .success-message p a {
    font-size: 13px;
  }
  .referral-form {
    flex-direction: column;
  }

  .referral-form-wrap form#referral-form #submitBtn {
    max-width: none !important;
  }
}
/* Clear button: same height and radius as Preview/Edit/Submit */
input#clearBtn {
  text-align: center;
  background: #fff !important;
  color: #000 !important;
  padding: 10px 16px !important;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.25;
  border: 2px solid #000 !important;
  border-radius: 6px;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
}
input#clearBtn:hover {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
}

.course-companion-row {
  margin: 8px 0 18px 0;
  display: flex;
  flex-wrap: nowrap;
  width: fit-content;
  max-width: 100%;
}
.course-companion-label {
  display: flex !important;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
  min-height: 20px;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: auto;
  max-width: 100%;
}
.course-companion-row .course-companion-label input[type='checkbox'] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
  flex-shrink: 0;
  vertical-align: middle;
  accent-color: #6c8e7c;
  box-sizing: border-box;
}

/*HTML Codes*/

.html-code-area textarea {
  background: #f0f0f0 !important;
}
.html-code-area button {
  position: absolute;
  right: 7px;
  top: 0.8181em;
  text-transform: uppercase;
  cursor: pointer;
  line-height: 1;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 6px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
