/* ==========================================================
   BOOK A TOUR — COMPLETE OPTIMIZED CSS
   Replace all existing custom CSS with this stylesheet.
   ========================================================== */


/* ----------------------------------------------------------
   1. PAGE WIDTH AND CENTRED TITLE
   ---------------------------------------------------------- */

#block-consulta-page-title .container {
  width: 100%;
  max-width: 920px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 15px;
  padding-left: 15px;
}

#block-consulta-page-title .page-title {
  width: 100%;
  margin: 0 0 18px;
  text-align: center !important;
}

.field--name-body,
.field--name-webform {
  width: 100%;
  max-width: 920px;
  margin-right: auto;
  margin-left: auto;
}


/* ----------------------------------------------------------
   2. INTRODUCTORY CONTENT
   ---------------------------------------------------------- */

.field--name-body > p {
  margin: 0 0 16px;
  line-height: 1.65;
}

.field--name-body > p:first-child {
  font-size: 18px;
  line-height: 1.65;
}

.field--name-body > p:nth-of-type(2) {
  margin-top: 22px;
  padding: 17px 20px;
  border-left: 4px solid #3e8a57;
  border-radius: 4px;
  background: #f3f8f4;
  color: #2f4635;
}

.field--name-body > p:nth-of-type(3) {
  padding: 17px 20px;
  border: 1px solid #d9e2dc;
  border-radius: 6px;
  background: #ffffff;
  color: #35463a;
}

.field--name-body a {
  color: #2f7547;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* ----------------------------------------------------------
   3. FORM CONTAINER
   ---------------------------------------------------------- */

.webform-submission-book-a-school-tour-form {
  width: 100%;
  max-width: 920px;
  margin: 32px auto 44px;
  padding: 32px;
  border: 1px solid #dce5df;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(30, 67, 43, 0.08);
}

.webform-submission-book-a-school-tour-form *,
.webform-submission-book-a-school-tour-form *::before,
.webform-submission-book-a-school-tour-form *::after {
  box-sizing: border-box;
}


/* ----------------------------------------------------------
   4. FIELD GROUPING AND VERTICAL SPACING

   A label stays close to its related input.
   The next field group receives a larger gap.
   ---------------------------------------------------------- */

.webform-submission-book-a-school-tour-form .form-item {
  min-width: 0;
  margin: 0 0 21px !important;
}

.webform-submission-book-a-school-tour-form fieldset {
  min-width: 0;
  margin: 0 0 21px !important;
  padding: 0;
  border: 0;
}

/* Remove unnecessary space only from the final field */
.webform-submission-book-a-school-tour-form
.webform-wizard-page > .form-item:last-child {
  margin-bottom: 0 !important;
}


/* ----------------------------------------------------------
   5. LABELS
   ---------------------------------------------------------- */

.webform-submission-book-a-school-tour-form label,
.webform-submission-book-a-school-tour-form legend {
  display: block;
  margin: 0 0 7px !important;
  padding: 0;
  color: #263c2d;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.webform-submission-book-a-school-tour-form .form-required::after {
  margin-left: 3px;
}


/* ----------------------------------------------------------
   6. INPUTS, SELECTS AND TEXTAREAS
   ---------------------------------------------------------- */

.webform-submission-book-a-school-tour-form input[type="text"],
.webform-submission-book-a-school-tour-form input[type="email"],
.webform-submission-book-a-school-tour-form input[type="tel"],
.webform-submission-book-a-school-tour-form input[type="number"],
.webform-submission-book-a-school-tour-form input[type="date"],
.webform-submission-book-a-school-tour-form input[type="time"],
.webform-submission-book-a-school-tour-form select,
.webform-submission-book-a-school-tour-form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  margin: 0 !important;
  padding: 11px 14px;
  border: 1px solid #b8c4bc;
  border-radius: 5px;
  background: #ffffff;
  color: #24372a;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.webform-submission-book-a-school-tour-form textarea {
  min-height: 130px;
  resize: vertical;
}

.webform-submission-book-a-school-tour-form select {
  cursor: pointer;
}

.webform-submission-book-a-school-tour-form input:focus,
.webform-submission-book-a-school-tour-form select:focus,
.webform-submission-book-a-school-tour-form textarea:focus {
  border-color: #3e8a57;
  outline: 0;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(62, 138, 87, 0.16);
}

.webform-submission-book-a-school-tour-form input::placeholder,
.webform-submission-book-a-school-tour-form textarea::placeholder {
  color: #77827a;
  opacity: 1;
}


/* ----------------------------------------------------------
   7. HELP AND DESCRIPTION TEXT
   ---------------------------------------------------------- */

.webform-submission-book-a-school-tour-form .description,
.webform-submission-book-a-school-tour-form .form-item__description,
.webform-submission-book-a-school-tour-form .webform-element-description {
  display: block;
  margin: 7px 0 0 !important;
  color: #647168;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}


/* ----------------------------------------------------------
   8. VALIDATION
   ---------------------------------------------------------- */

.webform-submission-book-a-school-tour-form .form-item--error-message {
  margin: 7px 0 0;
  color: #a52828;
  font-size: 13px;
  font-weight: 600;
}

.webform-submission-book-a-school-tour-form
input.error,
.webform-submission-book-a-school-tour-form
select.error,
.webform-submission-book-a-school-tour-form
textarea.error {
  border-color: #b93636;
  box-shadow: 0 0 0 2px rgba(185, 54, 54, 0.1);
}


/* ----------------------------------------------------------
   9. PRIVACY / INFORMATION PANEL
   ---------------------------------------------------------- */

.webform-submission-book-a-school-tour-form #edit-markup,
.webform-submission-book-a-school-tour-form [data-webform-element-key="markup"],
.webform-submission-book-a-school-tour-form .form-item-markup {
  margin: 3px 0 22px !important;
  padding: 15px 17px;
  border-left: 4px solid #3e8a57;
  border-radius: 4px;
  background: #f3f8f4;
  color: #3f5145;
  font-size: 13px;
  line-height: 1.55;
}

.webform-submission-book-a-school-tour-form #edit-markup p,
.webform-submission-book-a-school-tour-form
[data-webform-element-key="markup"] p,
.webform-submission-book-a-school-tour-form
.form-item-markup p {
  margin: 0;
}


/* ----------------------------------------------------------
   10. WIZARD PROGRESS
   ---------------------------------------------------------- */

.webform-progress {
  width: 100%;
  max-width: 720px;
  margin: 0 auto 40px !important;
  padding: 0;
}

.webform-progress-tracker {
  display: flex !important;
  align-items: flex-start;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible;
  list-style: none;
}

.webform-progress-tracker .progress-step {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin: 0 !important;
  padding: 0 8px !important;
  text-align: center;
}

.webform-progress-tracker .progress-step:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: 21px;
  left: calc(50% + 23px);
  width: calc(100% - 46px);
  height: 4px;
  border-radius: 4px;
  background: #d9e2dc;
  content: "";
}

.webform-progress-tracker
.progress-step.is-complete:not(:last-child)::after {
  background: #3e8a57;
}

.webform-progress-tracker .progress-marker {
  position: relative !important;
  z-index: 2;
  display: block !important;
  width: 46px !important;
  height: 46px !important;
  margin: 0 auto 11px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
}

.webform-progress-tracker .progress-marker::after {
  display: none !important;
  content: none !important;
}

.webform-progress-tracker .progress-marker::before {
  position: absolute !important;
  z-index: 2;
  inset: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 46px !important;
  height: 46px !important;
  border: 3px solid #bdc9c1;
  border-radius: 50%;
  background: #ffffff;
  color: #647168;
  content: attr(data-text) !important;
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.webform-progress-tracker
.progress-step.is-active
.progress-marker::before {
  border-color: #3e8a57;
  background: #3e8a57;
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(62, 138, 87, 0.14);
}

.webform-progress-tracker
.progress-step.is-complete
.progress-marker::before {
  border-color: #3e8a57;
  background: #3e8a57;
  color: #ffffff;
  content: "✓" !important;
}

.webform-progress-tracker .progress-text {
  display: block !important;
  margin: 0 !important;
}

.webform-progress-tracker .progress-title {
  display: block;
  color: #6b756e;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
}

.webform-progress-tracker
.progress-step.is-active
.progress-title {
  color: #263c2d;
  font-weight: 700;
}

.webform-progress-tracker
.progress-step.is-complete
.progress-title {
  color: #3e8a57;
  font-weight: 600;
}


/* ----------------------------------------------------------
   11. FORM ACTIONS AND BUTTONS
   ---------------------------------------------------------- */

.webform-submission-book-a-school-tour-form .form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin: 6px 0 0 !important;
  padding: 0;
}

.webform-submission-book-a-school-tour-form
.form-actions
input,
.webform-submission-book-a-school-tour-form
.form-actions
button,
.webform-submission-book-a-school-tour-form
.form-actions
.button {
  min-width: 145px;
  min-height: 48px;
  margin: 0;
  padding: 12px 22px;
  border: 2px solid #3e8a57;
  border-radius: 5px;
  background: #3e8a57;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.webform-submission-book-a-school-tour-form
.form-actions
input:hover,
.webform-submission-book-a-school-tour-form
.form-actions
button:hover,
.webform-submission-book-a-school-tour-form
.form-actions
.button:hover {
  border-color: #2f7547;
  background: #2f7547;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(47, 117, 71, 0.2);
  transform: translateY(-1px);
}

.webform-submission-book-a-school-tour-form
.form-actions
input:focus,
.webform-submission-book-a-school-tour-form
.form-actions
button:focus,
.webform-submission-book-a-school-tour-form
.form-actions
.button:focus {
  outline: 3px solid rgba(62, 138, 87, 0.22);
  outline-offset: 2px;
}

/* Keep Next/Submit aligned to the right when there is no Back button */
.webform-submission-book-a-school-tour-form
.form-actions
.webform-button--next,
.webform-submission-book-a-school-tour-form
.form-actions
.webform-button--submit {
  margin-left: auto;
}

/* Previous button */
.webform-submission-book-a-school-tour-form
.form-actions
.webform-button--previous {
  margin-right: auto;
  border-color: #3e8a57;
  background: #ffffff;
  color: #2f7547;
}

.webform-submission-book-a-school-tour-form
.form-actions
.webform-button--previous:hover {
  border-color: #2f7547;
  background: #edf6f0;
  color: #245d37;
}


/* ----------------------------------------------------------
   12. CONFIRMATION PAGE
   ---------------------------------------------------------- */

.webform-confirmation {
  width: 100%;
  max-width: 780px;
  margin: 10px auto 45px;
}

.webform-confirmation__message {
  position: relative;
  padding: 32px 34px 32px 112px;
  border: 1px solid #cfe0d3;
  border-left: 5px solid #3e8a57;
  border-radius: 9px;
  background: #f5faf6;
  color: #314538;
  box-shadow: 0 8px 24px rgba(30, 67, 43, 0.08);
}

.webform-confirmation__message::before {
  position: absolute;
  top: 32px;
  left: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #3e8a57;
  color: #ffffff;
  content: "✓";
  font-family: Arial, sans-serif;
  font-size: 29px;
  font-weight: 700;
  line-height: 1;
}

.webform-confirmation__message h2,
.webform-confirmation__message h3 {
  margin: 0 0 14px;
  color: #263c2d;
  line-height: 1.3;
}

.webform-confirmation__message p {
  margin: 0 0 14px;
  line-height: 1.65;
}

.webform-confirmation__message p:last-child {
  margin-bottom: 0;
}

.webform-confirmation__message a {
  color: #2f7547;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.webform-confirmation__back {
  display: none;
}


/* ----------------------------------------------------------
   13. TABLET AND MOBILE
   ---------------------------------------------------------- */

@media (max-width: 767px) {
  #block-consulta-page-title .container {
    padding-right: 16px;
    padding-left: 16px;
  }

  #block-consulta-page-title .page-title {
    margin-bottom: 14px;
    font-size: 30px;
    line-height: 1.25;
  }

  .field--name-body > p:first-child {
    font-size: 16px;
  }

  .field--name-body > p:nth-of-type(2),
  .field--name-body > p:nth-of-type(3) {
    padding: 14px 16px;
  }

  .webform-submission-book-a-school-tour-form {
    margin-top: 25px;
    padding: 22px 18px;
    border-radius: 8px;
  }

  .webform-submission-book-a-school-tour-form .form-item,
  .webform-submission-book-a-school-tour-form fieldset {
    margin-bottom: 19px !important;
  }

  .webform-progress {
    margin-bottom: 32px !important;
  }

  .webform-progress-tracker .progress-step {
    padding-right: 4px !important;
    padding-left: 4px !important;
  }

  .webform-progress-tracker
  .progress-step:not(:last-child)::after {
    top: 18px;
    left: calc(50% + 19px);
    width: calc(100% - 38px);
    height: 3px;
  }

  .webform-progress-tracker .progress-marker,
  .webform-progress-tracker .progress-marker::before {
    width: 38px !important;
    height: 38px !important;
  }

  .webform-progress-tracker .progress-marker {
    margin-bottom: 9px !important;
  }

  .webform-progress-tracker .progress-title {
    font-size: 13px;
    line-height: 1.3;
  }

  .webform-submission-book-a-school-tour-form .form-actions {
    flex-direction: column-reverse;
    gap: 11px;
  }

  .webform-submission-book-a-school-tour-form
  .form-actions
  input,
  .webform-submission-book-a-school-tour-form
  .form-actions
  button,
  .webform-submission-book-a-school-tour-form
  .form-actions
  .button {
    width: 100%;
    margin: 0 !important;
  }

  .webform-confirmation {
    margin-top: 5px;
  }

  .webform-confirmation__message {
    padding: 23px 18px;
  }

  .webform-confirmation__message::before {
    position: static;
    width: 48px;
    height: 48px;
    margin-bottom: 17px;
    font-size: 25px;
  }
}


/* ----------------------------------------------------------
   14. REDUCED-MOTION ACCESSIBILITY
   ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .webform-submission-book-a-school-tour-form input,
  .webform-submission-book-a-school-tour-form select,
  .webform-submission-book-a-school-tour-form textarea,
  .webform-submission-book-a-school-tour-form button,
  .webform-submission-book-a-school-tour-form .button {
    transition: none;
  }
}

/* Keep upcoming wizard steps clear and readable */
.webform-progress-tracker
.progress-step:not(.is-active):not(.is-complete)
.progress-marker {
  border: 0 !important;
  background: transparent !important;
  opacity: 1 !important;
  filter: none !important;
}

.webform-progress-tracker
.progress-step:not(.is-active):not(.is-complete)
.progress-marker::before {
  border: 3px solid #aebeb3 !important;
  background: #ffffff !important;
  color: #536259 !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

.webform-progress-tracker
.progress-step:not(.is-active):not(.is-complete)
.progress-title {
  color: #536259 !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Move existing Need Help section below the Webform */
article[about="/bookatour"] > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Allow individual Body paragraphs to be reordered */
article[about="/bookatour"]
> div
> .field--name-body {
  display: contents;
}

/* Introduction */
article[about="/bookatour"]
.field--name-body
> p:nth-of-type(1) {
  order: 1;
  width: 100%;
  max-width: 920px;
}

/* Booking information notice */
article[about="/bookatour"]
.field--name-body
> p:nth-of-type(2) {
  order: 2;
  width: 100%;
  max-width: 920px;
}

/* Webform */
article[about="/bookatour"]
> div
> .field--name-webform {
  order: 3;
  width: 100%;
  max-width: 920px;
}

/* Need Help section */
article[about="/bookatour"]
.field--name-body
> p:nth-of-type(3) {
  order: 4;
  width: 100%;
  max-width: 920px;
  margin: -18px auto 45px !important;
  padding: 20px 23px;
  box-sizing: border-box;
  border: 1px solid #d7e3da;
  border-left: 5px solid #3e8a57;
  border-radius: 7px;
  background: #f5faf6;
  box-shadow: 0 5px 16px rgba(30, 67, 43, 0.07);
  color: #35463a;
  font-size: 15px;
  line-height: 1.65;
}

/* Need Help heading */
article[about="/bookatour"]
.field--name-body
> p:nth-of-type(3)
strong {
  display: block;
  margin-bottom: 5px;
  color: #263c2d;
  font-size: 17px;
}

/* Contact links */
article[about="/bookatour"]
.field--name-body
> p:nth-of-type(3)
a {
  color: #2f7547 !important;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Hide the empty paragraph after the contact details */
article[about="/bookatour"]
.field--name-body
> p:nth-of-type(4) {
  display: none;
}

@media (max-width: 767px) {
  article[about="/bookatour"]
  .field--name-body
  > p:nth-of-type(1),
  article[about="/bookatour"]
  .field--name-body
  > p:nth-of-type(2),
  article[about="/bookatour"]
  .field--name-body
  > p:nth-of-type(3) {
    width: calc(100% - 30px);
  }

  article[about="/bookatour"]
  .field--name-body
  > p:nth-of-type(3) {
    margin-top: -15px !important;
    padding: 17px 18px;
    font-size: 14px;
  }
}