/* Shared RSForm skin. The template strips !important from each form's own
   style block, and these selectors are more specific than form#id, so they win. */

.st-page--form {
  max-width: 40rem;
}

/* Event forms: hero + form card; registrations add a summary aside */
.st-page--form-prereg {
  max-width: 54rem;
}

.st-page--form-booking {
  max-width: 80rem;
}

.st-page__head {
  margin: 0 0 1.35rem;
}

.st-page__head h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.st-page__head h1::before {
  content: "";
  display: block;
  width: 2.4rem;
  height: 3px;
  margin-bottom: 0.8rem;
  background: var(--gold);
}

#st-content form.formResponsive .rsform-type-freetext .line {
  display: none;
}

#st-content form.formResponsive .grey-text {
  margin: 0 0 1.6rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.65;
  text-align: left;
}

#st-content form.formResponsive .grey-text a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

#st-content form.formResponsive .rsform-block {
  margin: 0 0 0.9rem;
}

#st-content form.formResponsive .rsform-block::before,
#st-content form.formResponsive .rsform-block::after {
  content: none;
  display: none;
}

/* class="hidden" on a field: the value is still sent but the whole block is hidden
   (e.g. selezione-pacchetto in Messina when only the Basic pack is on sale) */
#st-content form.formResponsive .rsform-block:has(select.hidden, input.hidden),
#st-content .st-fbody form.formResponsive .rsform-block:has(select.hidden, input.hidden) {
  display: none;
}

/* Hide a field in one language only: class="hiddenEng" (hidden on English pages)
   or class="hiddenIta" (hidden on Italian pages) in the field's additional attributes,
   or inside a free text. The value is still sent: a required field must have a
   preselected value ([c] or default value), otherwise the form cannot be submitted. */
html[lang^="en"] #st-content form.formResponsive .rsform-block:has(.hiddenEng),
html[lang^="en"] #st-content .st-fbody form.formResponsive .rsform-block:has(.hiddenEng),
html[lang^="it"] #st-content form.formResponsive .rsform-block:has(.hiddenIta),
html[lang^="it"] #st-content .st-fbody form.formResponsive .rsform-block:has(.hiddenIta) {
  display: none;
}

#st-content form.formResponsive .formHorizontal .formControlLabel,
#st-content form.formResponsive .rsform-block > .formControlLabel {
  position: static;
  float: none;
  display: block;
  width: auto;
  margin: 0 0 0.4rem;
  padding: 0;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
  text-align: left;
  text-transform: none;
}

#st-content form.formResponsive .rsform-block > .formControlLabel:empty {
  display: none;
}

#st-content form.formResponsive .formHorizontal .formControls,
#st-content form.formResponsive .rsform-block .formControls {
  margin: 0;
}

#st-content form.formResponsive .formBody {
  width: 100%;
}

#st-content form.formResponsive input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not(.iti__search-input),
#st-content form.formResponsive select,
#st-content form.formResponsive textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 3.15rem;
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(0, 51, 82, 0.14);
  border-radius: 0.85rem;
  background-color: var(--paper);
  box-shadow: none;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

#st-content form.formResponsive textarea {
  min-height: 9rem;
  resize: vertical;
}

#st-content form.formResponsive .formHorizontal select {
  appearance: none;
  height: auto;
  min-height: 3.15rem;
  padding: 0.8rem 2.5rem 0.8rem 1rem;
  border: 1px solid rgba(0, 51, 82, 0.14);
  border-radius: 0.85rem;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23003352' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.7rem;
  box-shadow: none;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-transform: none;
  cursor: pointer;
}

#st-content form.formResponsive .formHorizontal select:has(> option:disabled:checked) {
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
}

#st-content form.formResponsive :is(input, select, textarea):focus {
  outline: none;
  border-color: var(--navy);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(247, 202, 24, 0.45);
}

#st-content form.formResponsive .formBody:has(> select[id^="data"]) {
  display: flex;
  gap: 0.65rem;
}

#st-content form.formResponsive select[id^="data"] {
  width: auto;
  flex: 1 1 0;
}

#st-content form.formResponsive .iti {
  display: block;
  width: 100%;
}

#st-content form.formResponsive .rsform-block label:has(input[type="checkbox"]),
#st-content form.formResponsive .rsform-block label:has(input[type="radio"]) {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: auto;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(0, 51, 82, 0.14);
  border-radius: 0.85rem;
  background: #fff;
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

#st-content form.formResponsive .rsform-block label:has(input:checked) {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
}

#st-content form.formResponsive .rsform-block label input[type="checkbox"],
#st-content form.formResponsive .rsform-block label input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  margin: 0;
  accent-color: var(--navy);
  flex: 0 0 auto;
}

#st-content form.formResponsive .rsform-block:has(> label[id^="payment-"]) > .formControls > .formBody,
#st-content form.formResponsive .rsform-block:has(> label[id^="scelta-tipo-stanza"]) > .formControls > .formBody {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

#st-content form.formResponsive button[type="submit"],
#st-content form.formResponsive button.rsform-button-next,
#st-content form.formResponsive button.rsform-button-prev {
  width: auto;
  flex: 1 1 0;
  margin: 0;
  padding: 1rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
}

#st-content form.formResponsive button.rsform-button-prev {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--navy);
}

#st-content form.formResponsive button[type="submit"]:hover,
#st-content form.formResponsive button.rsform-button-next:hover {
  background: #e4b70c;
}

#st-content form.formResponsive .rsform-type-pagebreak .formBody,
#st-content form.formResponsive .rsform-type-submitbutton .formBody,
#st-content form.formResponsive .rsform-type-submit-button .formBody {
  display: flex;
  width: 100%;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

#st-content form.formResponsive .formBody:not(:has(button + button)) > button[type="submit"] {
  width: 100%;
  flex: 1 1 100%;
}

#st-content form.formResponsive .header-form {
  min-height: 13rem;
  margin: 0 0 1.15rem;
  border-radius: 1.15rem;
  background-attachment: scroll;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

#st-content form.formResponsive .header-form :is(h1, h2) {
  margin: 0;
  padding: 0 1.25rem;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 800;
}

#st-content form.formResponsive .under-header,
#st-content form.formResponsive .pre-join-information {
  display: block;
  margin: 0 0 1.4rem;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
}

#st-content form.formResponsive .guest-title {
  margin: 0 0 1.15rem;
  border-radius: 1rem;
}

#st-content form.formResponsive .rsform-type-recaptchav2 .formBody,
#st-content form.formResponsive .rsform-block-captcha .formBody {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#st-content form.formResponsive .formValidation:not(:has(.formError)),
#st-content form.formResponsive .formDescription:empty {
  display: none;
}

#st-content form.formResponsive .formDescription {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

#st-content form.formResponsive .formError {
  color: #9d2c2c;
  font-size: 0.8rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  #st-content form.formResponsive .rsform-block:has(> label[id^="payment-"]) > .formControls > .formBody,
  #st-content form.formResponsive .rsform-block:has(> label[id^="scelta-tipo-stanza"]) > .formControls > .formBody,
  #st-content form.formResponsive .formBody:has(> select[id^="data"]) {
    display: grid;
    grid-template-columns: 1fr;
  }

  #st-content form.formResponsive .rsform-type-pagebreak .formBody,
  #st-content form.formResponsive .rsform-type-submit-button .formBody {
    flex-direction: column;
  }
}

/* ==========================================================================
   Event forms (pre-registration / registration)
   Markup from form-event.php; contents from the RSForm free text blocks.
   ========================================================================== */

/* Hero */

.st-fhead {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  min-height: 17rem;
  margin: 0 0 1.75rem;
  padding: 1.1rem 1.1rem 1.5rem;
  overflow: hidden;
  border-radius: 1.5rem;
  background: var(--navy) var(--st-fhead-photo, none) center / cover no-repeat;
  color: #fff;
  box-shadow: var(--shadow);
}

.st-fhead::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 36, 59, 0.55), rgba(0, 36, 59, 0.2) 45%, rgba(0, 36, 59, 0.78));
}

.st-fhead__back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  padding: 0.5rem 0.9rem 0.5rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.st-fhead__back:hover,
.st-fhead__back:focus-visible {
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
}

.st-fhead__back svg {
  width: 1rem;
  height: 1rem;
}

.st-fhead__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
}

.st-fhead__kicker {
  margin: 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.st-fhead__logo {
  width: min(320px, 72%);
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.25));
}

.st-fhead__title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.st-fhead__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.st-fhead__meta li {
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 36, 59, 0.35);
  backdrop-filter: blur(6px);
  font-size: 0.8rem;
  font-weight: 600;
}

.st-fhead__meta .st-fhead__amount {
  border-color: transparent;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

/* Layout */

.st-fbody {
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 1000px) {
  .st-page--form-booking .st-fbody {
    grid-template-columns: minmax(0, 1fr) 19rem;
    gap: 2.5rem;
  }

  .st-fbody__aside {
    position: sticky;
    top: calc(var(--header) + 1.5rem);
  }
}

#st-content .st-fbody form.formResponsive {
  margin: 0;
  padding: clamp(1.25rem, 3.5vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 36, 59, 0.06);
}

/* Fields in two columns: short inputs side by side, everything else full width */
@media (min-width: 640px) {
  #st-content .st-fbody form.formResponsive .formSpan12 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    /* Inputs line up even when one caption wraps or is missing */
    align-items: end;
  }

  #st-content .st-fbody form.formResponsive .formSpan12 > * {
    grid-column: 1 / -1;
  }

  #st-content .st-fbody form.formResponsive .formSpan12 > :is(.rsform-type-textbox, .rsform-type-selectlist, .rsform-type-phonenumber, .rsform-type-multipleproducts) {
    grid-column: auto;
  }

  /* Long sentence options: full row so the chosen text is readable */
  #st-content .st-fbody form.formResponsive .formSpan12 > .rsform-block-pernotto-condiviso {
    grid-column: 1 / -1;
  }
}

#st-content .st-fbody form.formResponsive .rsform-block {
  margin-bottom: 1.05rem;
}

/*
 * Captions: each form's CSS floats them over the input with :has() rules specific
 * enough to beat a plain class chain. :not(#st-none) adds an id weight so this wins.
 */
#st-content .st-fbody form.formResponsive .rsform-block > .formControlLabel:not(#st-none) {
  position: static;
  width: auto;
  margin: 0 0 0.4rem;
  padding: 0;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: none;
  transition: none;
}

/* Old form CSS hides the "*" of selects (it lived in their first option): captions show it again */
#st-content .st-fbody form.formResponsive .formControlLabel .formRequired:not(#st-none) {
  display: inline;
}

/* A lone "*" caption is hidden. Half-width fields keep its height on two columns, so the row stays aligned */
#st-content .st-fbody form.formResponsive .formControlLabel.st-label-empty:not(#st-none) {
  display: none;
}

@media (min-width: 640px) {
  #st-content .st-fbody form.formResponsive :is(.rsform-type-textbox, .rsform-type-selectlist, .rsform-type-phonenumber, .rsform-type-multipleproducts) > .formControlLabel.st-label-empty:not(#st-none) {
    display: block;
    visibility: hidden;
  }
}

/* Birthday: three selects on one line; font-size 0 hides RSForm's "/" separators */
#st-content .st-fbody form.formResponsive .rsform-type-birthday .formBody {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0;
}

#st-content .st-fbody form.formResponsive .rsform-type-birthday select {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  font-size: 1rem;
}

#st-content .st-fbody form.formResponsive .rsform-type-birthday .formBody > :not(select) {
  font-size: 0.8rem;
}

@media (max-width: 479px) {
  #st-content .st-fbody form.formResponsive .rsform-type-birthday .formBody {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Legacy free text: the hero replaces the old image header */
#st-content .st-fbody .header-form {
  display: none;
}

#st-content .st-fbody form.formResponsive .under-header {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

#st-content .st-fbody .pre-join-information,
#st-content .st-fbody .traslucent-box {
  margin: 0 0 1.5rem !important;
  padding: 1.4rem 1.5rem !important;
  border: 0;
  border-radius: 1.1rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.65;
  text-align: left !important;
}

#st-content .st-fbody :is(.pre-join-information, .traslucent-box) :is(h2, h5) {
  margin: 0 0 0.8rem;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 800;
}

#st-content .st-fbody .pre-join-information .badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 800;
}

#st-content .st-fbody .pre-join-information .row {
  margin: 0;
}

#st-content .st-fbody .pre-join-information .col-12 {
  padding: 0;
}

#st-content .st-fbody .guest-title,
#st-content .st-fbody .st-form__guest {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0 0.4rem;
  padding: 0 0 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
}

#st-content .st-fbody .guest-title::before,
#st-content .st-fbody .st-form__guest::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(247, 202, 24, 0.25);
}

/* Acceptance checkboxes: box first, text left-aligned (old form CSS reverses them) */
#st-content .st-fbody form.formResponsive .rsform-type-checkboxgroup label:has(input[type="checkbox"]) {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
}

#st-content .st-fbody form.formResponsive .rsform-type-checkboxgroup label input[type="checkbox"] {
  margin: 0;
}

/* A text panel and its acceptance checkbox read as one group: tight above the checkbox, air below */
#st-content .st-fbody form.formResponsive .rsform-type-freetext:has(+ .rsform-type-checkboxgroup) {
  margin-bottom: 0.6rem;
}

#st-content .st-fbody form.formResponsive .rsform-type-freetext:has(+ .rsform-type-checkboxgroup) :is(.st-form__panel, .traslucent-box) {
  margin-bottom: 0 !important;
}

#st-content .st-fbody form.formResponsive .rsform-type-checkboxgroup {
  margin-bottom: 2rem;
}

/* Room type and payment method as cards */
#st-content .st-fbody form.formResponsive .rsform-block:has(> label[id^="payment-"]) > .formControls > .formBody,
#st-content .st-fbody form.formResponsive .rsform-block:has(> label[id^="scelta-tipo-stanza"]) > .formControls > .formBody {
  display: block;
}

#st-content .st-fbody .rsform-type-radiogroup .rsfp-fieldset,
#st-content .st-fbody .rsform-type-choosepayment .rsfp-fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  border: 0;
}

#st-content .st-fbody form.formResponsive .rsform-type-radiogroup .rsfp-fieldset label {
  min-height: 3.6rem;
  font-size: 1rem;
}

#st-content .st-fbody form.formResponsive .rsform-type-choosepayment label.st-pay {
  min-height: 4rem;
}

/* Logos are fluid: they take the space left by the radio and shrink with the card,
   object-fit keeps each brand's proportions whatever its file size */
#st-content .st-fbody .rsform-type-choosepayment label.st-pay img {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: 100%;
  height: 1.7rem;
  max-height: none;
  margin: 0;
  object-fit: contain;
  object-position: center;
}

/* reCAPTCHA is a fixed 304px iframe: scaled down on the narrowest phones */
@media (max-width: 380px) {
  #st-content .st-fbody .rsform-type-recaptchav2 [id^="g-recaptcha"] {
    width: 234px;
    height: 60px;
    transform: scale(0.77);
    transform-origin: 0 0;
  }
}

/* Logos still injected by each form's own script (alt "PayPalLogo"...): forms.js adds its own */
#st-content form.formResponsive .rsform-type-choosepayment label img[alt$="Logo"] {
  display: none;
}

/* Proof of payment upload */
#st-content .st-fbody .rsform-type-fileupload input[type="file"]:not(#st-none) {
  width: 100%;
  height: auto;
  line-height: normal;
  padding: 1rem;
  border: 1.5px dashed rgba(0, 51, 82, 0.28);
  border-radius: 0.85rem;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}

#st-content .st-fbody .rsform-type-fileupload input[type="file"]:not(#st-none)::file-selector-button {
  float: none;
  height: auto;
  margin: 0 0.8rem 0 0;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Total */
#st-content .st-fbody form.formResponsive .rsform-block-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 1.2rem;
  padding: 1.2rem 1.4rem;
  border-radius: 1.1rem;
  background: var(--navy);
  color: #fff;
}

#st-content .st-fbody form.formResponsive .rsform-block-total > .formControlLabel:not(#st-none) {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#st-content .st-fbody .rsform-block-total .formControls,
#st-content .st-fbody .rsform-block-total .formBody {
  width: auto;
  text-align: right;
}

#st-content .st-fbody .rsform-block-total .rsform_payment_total {
  color: var(--gold);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  white-space: nowrap;
}

#st-content .st-fbody .acconto-title:not(#st-none) {
  margin: 0.5rem 0 0;
  text-align: left;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/*
 * Deposit (bank transfer only), laid out like the total: label left, amount right.
 * Title and amount are two RSForm blocks, so the title block is pulled over the amount box.
 */
#st-content .st-fbody form.formResponsive .formSpan12 > .rsform-block-calculation-acconto {
  grid-column: 1 / -1;
}

#st-content .st-fbody form.formResponsive .rsform-block.rsform-block-calculation-acconto > .formControlLabel.formControlLabel:not(#st-none) {
  display: none;
}

#st-content .st-fbody form.formResponsive .rsform-block-acconto-title:has(+ .rsform-block-calculation-acconto) {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 4.5rem;
  margin: 0 0 -4.5rem;
  padding: 0 1.4rem;
  pointer-events: none;
}

#st-content .st-fbody form.formResponsive .rsform-block-acconto-title:has(+ .rsform-block-calculation-acconto) .acconto-title:not(#st-none) {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

#st-content .st-fbody form.formResponsive #calculation-acconto:not(#st-none) {
  height: 4.5rem;
  min-height: 0;
  padding: 0 1.4rem 0 45%;
  text-align: right;
  border: 1.5px dashed var(--gold);
  border-radius: 1rem;
  background: rgba(247, 202, 24, 0.12);
  color: var(--navy);
  -webkit-text-fill-color: var(--navy);
  opacity: 1;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
}

@media (max-width: 479px) {
  #st-content .st-fbody form.formResponsive #calculation-acconto:not(#st-none) {
    padding-left: 55%;
    font-size: 1.3rem;
  }

  #st-content .st-fbody form.formResponsive .rsform-block-acconto-title:has(+ .rsform-block-calculation-acconto) .acconto-title:not(#st-none) {
    max-width: 50%;
    font-size: 0.68rem;
    line-height: 1.3;
  }
}

/* Navigation buttons: each form's own CSS sizes them with form#id rules, reset here */
#st-content .st-fbody form.formResponsive .rsform-block .formControls .formBody > :is(button.rsform-button-next, button.rsform-button-prev, button[type="submit"]) {
  width: auto;
  min-width: 0;
  flex: 1 1 0;
  margin: 0;
  padding: 1rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.82rem;
}

#st-content .st-fbody form.formResponsive .rsform-block .formControls .formBody > button.rsform-button-prev {
  flex: 0 1 auto;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--navy);
}

#st-content .st-fbody form.formResponsive .rsform-block .formControls .formBody > :is(button.rsform-button-next, button[type="submit"]):hover {
  background: #e4b70c;
}

#st-content .st-fbody form.formResponsive :is(.rsform-type-pagebreak, .rsform-type-submitbutton) {
  margin-top: 1.5rem;
}

/* Progress of multi-page forms (built by forms.js) */
.st-fprogress {
  margin: 0 0 1.75rem;
}

.st-fprogress__text {
  margin: 0 0 0.6rem;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.st-fprogress__bar {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-fprogress__bar li {
  flex: 1 1 0;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 0.25s ease;
}

.st-fprogress__bar li.is-done,
.st-fprogress__bar li.is-current {
  background: var(--gold);
}

.st-fprogress__bar li span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Summary aside */
.st-fsum {
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.st-fsum__label {
  margin: 0 0 0.9rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.st-fsum__event {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.st-fsum__dates {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
}

.st-fsum__steps {
  display: grid;
  gap: 0.15rem;
  margin: 1.25rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  list-style: none;
  counter-reset: st-step;
}

.st-fsum__steps[hidden] {
  display: none;
}

.st-fsum__steps li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  font-weight: 600;
  counter-increment: st-step;
}

.st-fsum__steps li::before {
  content: counter(st-step);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
}

.st-fsum__steps li.is-current {
  color: #fff;
}

.st-fsum__steps li.is-current::before {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy);
}

.st-fsum__steps li.is-done::before {
  content: "✓";
  border-color: transparent;
  background: rgba(255, 255, 255, 0.16);
  color: var(--gold);
}

.st-fsum__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.1rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.st-fsum__total[hidden] {
  display: none;
}

.st-fsum__total span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.st-fsum__total strong {
  color: var(--gold);
  font-size: 1.6rem;
  font-weight: 800;
}

@media (max-width: 999px) {
  /* On small screens the progress bar above the form is enough */
  .st-fsum__steps {
    display: none;
  }
}

/* ==========================================================================
   Standard free text components for event forms (st-form__*)
   ========================================================================== */

#st-content .st-fbody .st-form__intro {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

#st-content .st-fbody .st-form__intro strong {
  color: var(--ink);
}

#st-content .st-fbody .st-form__page-title {
  margin: 0 0 0.5rem;
  color: var(--navy);
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

#st-content .st-fbody .st-form__panel {
  margin: 0 0 1.5rem;
  padding: 1.4rem 1.5rem;
  border-radius: 1.1rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.65;
}

#st-content .st-fbody .st-form__panel h3 {
  margin: 0 0 0.9rem;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 800;
}

#st-content .st-fbody .st-form__panel h4 {
  margin: 1.2rem 0 0.5rem;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 800;
}

#st-content .st-fbody .st-form__panel p {
  margin: 0 0 0.75rem;
}

#st-content .st-fbody .st-form__panel ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

#st-content .st-fbody .st-form__panel li + li {
  margin-top: 0.3rem;
}

#st-content .st-fbody .st-form__panel > :last-child {
  margin-bottom: 0;
}

#st-content .st-fbody .st-form__panel--legal {
  color: var(--muted);
  font-size: 0.85rem;
}

#st-content .st-fbody .st-form__panel a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

#st-content .st-fbody .st-form__steps {
  display: grid;
  gap: 0.8rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
  counter-reset: st-fstep;
}

#st-content .st-fbody .st-form__steps li {
  position: relative;
  padding-left: 2.6rem;
  counter-increment: st-fstep;
}

#st-content .st-fbody .st-form__steps li::before {
  content: counter(st-fstep);
  position: absolute;
  top: -0.1rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 800;
}

#st-content .st-fbody .st-form__bank {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #fff;
}

#st-content .st-fbody .st-form__bank div {
  display: grid;
  gap: 0.1rem;
}

#st-content .st-fbody .st-form__bank dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#st-content .st-fbody .st-form__bank dd {
  margin: 0;
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

#st-content .st-fbody .st-form__bank .st-form__iban dd {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

#st-content .st-fbody .st-form__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}

@media (max-width: 640px) {
  .st-fhead {
    min-height: 14rem;
    border-radius: 1.15rem;
  }

  #st-content .st-fbody form.formResponsive .rsform-block-total {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Thank-you and error messages of the forms
   Thank-you: block from messages/thanks.php ({st:ringraziamento} in the form).
   Error: the <p class="formRed"> of the form's "Messaggio di errore".
   ========================================================================== */

#st-content .st-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 36rem;
  margin: 2.5rem auto 1.5rem;
  padding: 2.4rem 1.6rem 2rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

#st-content .st-thanks__icon {
  width: 3.6rem;
  height: 3.6rem;
  color: #2f8f5b;
}

#st-content .st-thanks__text {
  margin: 0;
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
}

#st-content .st-thanks__code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0.4rem;
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  background: var(--paper);
}

#st-content .st-thanks__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#st-content .st-thanks__value {
  color: var(--navy);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  user-select: all;
}

#st-content .st-thanks__hint {
  color: var(--muted);
  font-size: 0.82rem;
}

/* "Continua" button that RSForm adds below the message */
#st-content .formResponsive button.rsform-thankyou-button,
#st-content input.rsform-submit-button[name="continue"] {
  display: block;
  margin: 0 auto 2.5rem;
  padding: 0.85rem 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#st-content .formResponsive button.rsform-thankyou-button:hover,
#st-content .formResponsive button.rsform-thankyou-button:focus-visible,
#st-content input.rsform-submit-button[name="continue"]:hover,
#st-content input.rsform-submit-button[name="continue"]:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 36, 59, 0.18);
}

/* Message above the form when something is wrong */
#st-content .formRed {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.2rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(157, 44, 44, 0.28);
  border-radius: 0.9rem;
  background: #fdf1f1;
  color: #8f2727;
  font-size: 0.92rem;
  font-weight: 700;
}

#st-content .formRed::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #9d2c2c;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

/* RSForm wraps the button in <div class="formResponsive"> (layout "responsive") */
#st-content .formResponsive:has(> button.rsform-thankyou-button) {
  display: flex;
  justify-content: center;
  margin: 0 0 2.5rem;
}

#st-content .formResponsive:has(> button.rsform-thankyou-button) > button {
  margin: 0;
}
