/* Enquiry form "Personalizza il tuo Viaggio" (element/side-form.php).

   Linked by the element itself, so it applies on both layouts. Colours use the
   Touria palette variables with fallbacks, because the legacy `default` layout
   doesn't define them. Everything is scoped to .sf-card; a few properties are
   !important only where the legacy base CSS forces its own (button/link colours,
   list padding) and would otherwise win. */

.inquireSection.sf-card {
  --sf-theme: var(--theme-color, #f98225);
  --sf-dark: var(--color-dark, #2a4456);
  --sf-text: var(--body-text-color, #757f95);
  --sf-border: #e6e8ec;
  --sf-radius: 12px;
  background: #fff;
  border: 1px solid var(--sf-border);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(20, 30, 60, 0.07);
  padding: 16px 18px 16px;
  font-family: var(--body-font, "Roboto", sans-serif);
}
.sf-card .sf-title {
  margin: 0 0 10px;
  text-align: center;
  font-family: var(--body-font, "Roboto", sans-serif) !important;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--sf-theme);
}

.sf-card .sf-body > a#Form {
  /* anchor target only; as an inline element it formed an empty text line */
  display: block;
}
.sf-card .sf-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.sf-card .sf-grid-2 {
  grid-template-columns: 1fr 1fr;
}
.sf-card .sf-grid-phone {
  grid-template-columns: 1.35fr 0.8fr 1.25fr;
}

/* Field with a leading icon */
.sf-card .sf-field {
  position: relative;
  margin-bottom: 0;
}
.sf-card > .sf-body > form > .sf-field,
.sf-card .sf-body form > .sf-field {
  margin-bottom: 8px;
}
.sf-card .sf-ico {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.sf-card .sf-field > .sf-ico {
  position: absolute;
  left: 11px;
  top: 20px;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
  z-index: 1;
}
.sf-card .sf-field.sf-accent > .sf-ico {
  color: var(--sf-theme);
}
.sf-card .sf-field .form-control,
.sf-card .sf-field .form-select {
  width: 100%;
  height: 40px;
  padding: 0 8px 0 36px;
  border: 1px solid var(--sf-border) !important;
  border-radius: var(--sf-radius) !important;
  background-color: #fff;
  color: var(--sf-dark);
  font-size: 15px !important;
  font-family: inherit;
  box-shadow: none;
  transition: border-color 0.2s ease;
}
.sf-card .sf-field.sf-no-icon .form-select {
  padding-left: 14px;
}
.sf-card .sf-field .form-control::placeholder {
  color: #9aa1ad;
  font-size: 15px;
  opacity: 1;
}
.sf-card .sf-field .form-control:focus,
.sf-card .sf-field .form-select:focus {
  border-color: var(--sf-theme) !important;
  box-shadow: 0 0 0 3px rgba(249, 130, 37, 0.12);
  outline: none;
}
.sf-card .sf-field input[type="number"]::-webkit-inner-spin-button,
.sf-card .sf-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.sf-card .sf-field input[type="number"] {
  -moz-appearance: textfield;
}
.sf-card .sf-field .form-control[readonly] {
  background-color: #fff;
  cursor: pointer;
}
.sf-card .sf-select .form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a4456' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  text-overflow: ellipsis;
}
.sf-card .sf-textarea > .sf-ico {
  top: 12px;
  transform: none;
}
.sf-card .sf-textarea .form-control {
  height: auto;
  min-height: 64px;
  padding-top: 10px;
  resize: vertical;
}

.sf-card .sf-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid rgba(249, 130, 37, 0.45);
  border-left: 4px solid var(--sf-theme);
  border-radius: 8px;
  background: #fff4ea;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--sf-dark);
  animation: sf-note-pulse 2.4s ease-in-out infinite;
}
.sf-card .sf-note .sf-ico {
  color: var(--sf-theme);
  margin-top: 1px;
}
/* Contact reminder as a tooltip on the shield icon inside the phone field */
.sf-card .sf-has-tip .form-control {
  padding-right: 36px;
}
.sf-card .sf-tip {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none !important;
  border-radius: 50%;
  background: transparent !important;
  color: var(--sf-theme) !important;
  cursor: help;
  z-index: 2;
}
.sf-card .sf-tip:hover,
.sf-card .sf-tip:focus-visible {
  background: rgba(249, 130, 37, 0.12) !important;
  outline: none;
}
.sf-card .sf-tip .sf-ico {
  width: 18px;
  height: 18px;
  color: var(--sf-theme);
}
.sf-card .sf-tip-text {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 240px;
  max-width: 80vw;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--sf-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(20, 30, 60, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 20;
  pointer-events: none;
}
.sf-card .sf-tip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 13px;
  border: 6px solid transparent;
  border-top-color: var(--sf-dark);
}
.sf-card .sf-tip:hover + .sf-tip-text,
.sf-card .sf-tip:focus + .sf-tip-text {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@keyframes sf-note-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 130, 37, 0); }
  50% { box-shadow: 0 0 0 4px rgba(249, 130, 37, 0.18); }
}
@media (prefers-reduced-motion: reduce) {
  .sf-card .sf-note { animation: none; }
}
.sf-card .sf-label {
  display: block;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--sf-dark);
}

/* Adults / children counters */
/* label centred on top, -/count/+ centred under it (every width) */
.sf-card .sf-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 34px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  padding: 6px 6px 4px;
  text-align: center;
}
.sf-card .sf-counter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--sf-dark);
}
.sf-card .sf-counter-label .sf-ico {
  width: 16px;
  height: 16px;
  color: var(--sf-theme);
}
.sf-card .sf-counter-row {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sf-card .sf-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none !important;
  border-radius: 50%;
  background: transparent !important;
  color: var(--sf-theme) !important;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.sf-card .sf-step:hover {
  background: rgba(249, 130, 37, 0.1) !important;
}
.sf-card .sf-count {
  width: 24px;
  border: none !important;
  background: transparent !important;
  text-align: center;
  font-size: 15px;
  color: var(--sf-dark);
  outline: none;
  box-shadow: none !important;
  padding: 0;
}

/* Children age fields (built by paxOnChangeAll) */
.sf-card .sf-ages {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sf-card .sf-ages .hidden,
.sf-card #ageInputDiv {
  display: none !important;
}
.sf-card .sf-ages [ageDesc="child"] {
  display: grid;
  /* an age is 1-2 digits: four small boxes per row, so even 10 children
     take three short rows and the submit button stays in view */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin: 0 0 10px;
}
.sf-card .sf-ages [ageDesc="child"]:not(:has(.age-input-div)) {
  display: none;
}
.sf-card .sf-ages [ageDesc="child"] > .age-input-div {
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
}
.sf-card .sf-ages .age-input-div > div {
  margin: 0;
  padding: 0;
}
/* the field's own placeholder ("Età 1", "Età 2"...) names the child; the
   label stays for screen readers only */
.sf-card .sf-ages .age-input-div .div-0 label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.sf-card .sf-ages .age-input-div .form-control {
  height: 32px;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--sf-border);
  border-radius: 8px;
  padding: 0 4px;
  font-size: 13px;
  text-align: center;
  -moz-appearance: textfield;
}
.sf-card .sf-ages .age-input-div .form-control::-webkit-inner-spin-button,
.sf-card .sf-ages .age-input-div .form-control::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Flight checkbox */
.sf-card .sf-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--sf-dark);
  cursor: pointer;
}
.sf-card .sf-check .form-check-input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
  border: 1.5px solid #9aa1ad !important;
  border-radius: 6px !important;
  cursor: pointer;
}
.sf-card .sf-check .form-check-input:checked {
  background-color: var(--sf-theme);
  border-color: var(--sf-theme) !important;
}
.sf-card .sf-check .sf-plane {
  color: #f5b034;
  display: inline-flex;
}
.sf-card .sf-check .sf-plane .sf-ico {
  width: 24px;
  height: 24px;
}

/* Submit */
.sf-card .sf-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  margin-top: 0;
  border: none !important;
  border-radius: var(--sf-radius);
  background: var(--sf-theme) !important;
  color: #fff !important;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.sf-card .sf-submit:hover,
.sf-card .sf-submit:focus {
  background: var(--sf-dark) !important;
}
.sf-card .sf-submit:disabled {
  opacity: 0.8;
  cursor: wait;
}
.sf-card .sf-submit .sf-ico {
  width: 22px;
  height: 22px;
}

/* jQuery Validate messages */
.sf-card label.error {
  display: block;
  margin: 4px 0 0 4px;
  font-size: 12px;
  color: #dc3545;
}
.sf-card .form-control.error,
.sf-card .form-select.error {
  border-color: #dc3545 !important;
}
/* The counters/prefix row stretch when an error label appears under one cell */
.sf-card .sf-grid > * {
  min-width: 0;
}

/* jQuery UI date picker, in theme colours */
.ui-datepicker {
  z-index: 9999 !important;
}
.ui-datepicker .ui-state-active,
.ui-datepicker .ui-state-highlight {
  background: var(--theme-color, #f98225) !important;
  border-color: var(--theme-color, #f98225) !important;
  color: #fff !important;
}
.sf-card .ui-datepicker-trigger {
  display: none;
}

/* Layout adapts to the card's own width (it sits in sidebars of different
   widths: ~510px on tour pages, ~300px on listing pages, full width on phones). */
.inquireSection.sf-card {
  container-type: inline-size;
}
@container (max-width: 400px) {
  .sf-card .sf-title {
    font-size: 21px;
  }
  .sf-card .sf-grid-phone {
    grid-template-columns: 0.8fr 1.4fr;
  }
  .sf-card .sf-grid-phone > .sf-field:first-child {
    grid-column: 1 / -1;
  }
}
@container (max-width: 340px) {
  .sf-card .sf-grid-dates .form-control {
    font-size: 13px !important;
    padding-left: 32px;
  }
  .sf-card .sf-grid-dates .sf-ico {
    left: 9px;
    width: 16px;
    height: 16px;
  }
}
@media (max-width: 575px) {
  .inquireSection.sf-card {
    padding: 20px 16px 18px;
    border-radius: 18px;
  }
}

/* Set by side-form.php when the sticky box holding the form is taller than
   the window (e.g. many children's ages): it scrolls with the page instead,
   so the submit button stays reachable. */
.sf-unstuck {
  position: static !important;
}
