/* Shared by the reserved-area button in every language. */
.btn-modern[data-target="#modal-login-cliente"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: left;
}

/* Scoped to the public login: management dialogs retain their own styling. */
#modal-login-cliente {
  padding-right: 0 !important;
  padding-left: 0 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#modal-login-cliente .modal-dialog {
  width: calc(100% - 32px);
  max-width: 520px;
  margin: 24px auto;
}

#modal-login-cliente .modal-content {
  border: 1px solid #dce3e9;
  border-radius: 18px;
  background: #fff;
  color: #173c56;
  box-shadow: 0 20px 65px rgba(0, 24, 47, .26);
}

#modal-login-cliente .modal-body {
  margin: 0;
  padding: 24px;
}

#modal-login-cliente .customer-login-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-right: 56px;
  position: relative;
  min-height: 44px;
}

#modal-login-cliente .customer-login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid #dce7ef;
  border-radius: 12px;
  background: #eef4f8;
  color: #003c70;
  font-size: 20px;
}

#modal-login-cliente #customerLoginTitle {
  flex: 1 1 160px;
  min-width: 0;
  margin: 0;
  color: #173c56;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
}

#modal-login-cliente .customer-login-close {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #dce3e9;
  border-radius: 12px;
  background: #fff;
  color: #173c56;
  font-size: 18px;
  cursor: pointer;
}

#modal-login-cliente #customerLoginDescription {
  margin: 18px 0 24px;
  color: #536675;
  font-size: 15px;
  line-height: 1.65;
}

#modal-login-cliente .customer-login-field + .customer-login-field {
  margin-top: 18px;
}

#modal-login-cliente label {
  display: block;
  margin: 0 0 8px;
  color: #364957;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

#modal-login-cliente .form-control {
  width: 100%;
  height: 48px;
  padding: 10px 12px;
  border: 1px solid #dce3e9;
  border-radius: 12px;
  background: #fff;
  color: #173c56;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: none;
}

#modal-login-cliente .form-control:focus {
  border-color: #287ab9;
  box-shadow: 0 0 0 3px rgba(40, 122, 185, .15);
}

#modal-login-cliente .customer-login-submit {
  display: block;
  width: 100%;
  min-height: 48px;
  height: auto;
  margin: 24px 0 0;
  padding: 12px 20px;
  border: 1px solid #003c70;
  border-radius: 12px;
  background: #003c70;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(0, 60, 112, .14);
}

#modal-login-cliente button:focus-visible {
  outline: 3px solid #287ab9;
  outline-offset: 3px;
}

@media (hover: hover) {
  #modal-login-cliente .customer-login-close:hover { background: #eef4f8; }
  #modal-login-cliente .customer-login-submit:hover { background: #002e57; }
}

@media (max-width: 575px), (max-height: 480px) {
  #modal-login-cliente .modal-dialog { width: calc(100% - 24px); margin: 12px auto; }
  #modal-login-cliente .modal-body { padding: 20px; }
}

/* Long translated titles get the full row below the icon and close control. */
@media (max-width: 575px) {
  #modal-login-cliente .customer-login-header { padding-right: 0; }
  #modal-login-cliente .customer-login-icon { margin-right: 56px; }
  #modal-login-cliente #customerLoginTitle { flex-basis: 100%; }
}

@media (max-width: 359px) {
  #modal-login-cliente .modal-body { padding: 16px; }
  #modal-login-cliente #customerLoginTitle { font-size: 20px; }
}

/* Shared mobile navigation. The existing desktop layout starts above 992px. */
#tools a:focus-visible {
  outline: 2px solid #003c70;
  outline-offset: 3px;
}

@media (max-width: 992px) {
  #nav-main .mobile-nav-toggle {
    position: relative;
    display: block;
    width: 44px;
    height: 44px;
    margin: 8px 8px 8px 16px;
    padding: 10px;
    border: 1px solid rgba(0, 60, 112, .14);
    border-radius: 12px;
    background: #fff;
    color: #003c70;
    line-height: 1;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
    touch-action: manipulation;
  }

  /* The highlight follows the open state, including on touch devices. */
  #nav-main .mobile-nav-toggle[aria-expanded="true"] {
    background: #fff4ed;
    border-color: #fa7636;
    color: #003c70;
  }

  /* Keep the expanded menu's existing highlight distinct from pointer feedback. */
  @media (hover: hover) {
    #nav-main .mobile-nav-toggle:not([aria-expanded="true"]):not(:disabled):not(.disabled):not([aria-disabled="true"]):hover {
      background: #dfedf7;
      border-color: #9fbdd3;
    }
  }

  #nav-main .mobile-nav-toggle:not([aria-expanded="true"]):not(:disabled):not(.disabled):not([aria-disabled="true"]):is(:focus-visible, :active) {
    background: #dfedf7;
    border-color: #9fbdd3;
  }

  #nav-main .mobile-nav-toggle:focus-visible,
  #nav-main .mobile-nav-panel a:focus-visible,
  #nav-main .mobile-nav-language select:focus-visible {
    outline: 2px solid #003c70;
    outline-offset: 3px;
  }

  #nav-main .mobile-nav-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 18px;
  }

  #nav-main .mobile-nav-line {
    position: absolute;
    left: 0;
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .22s ease, opacity .16s ease;
  }

  #nav-main .mobile-nav-line:nth-child(1) { top: 1px; }
  #nav-main .mobile-nav-line:nth-child(2) { top: 8px; }
  #nav-main .mobile-nav-line:nth-child(3) { top: 15px; }

  #nav-main .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  #nav-main .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(.4);
  }

  #nav-main .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  #nav-main .mobile-nav-panel,
  #nav-main .mobile-nav-panel.in {
    padding: 0 12px;
    border-top: 1px solid rgba(0, 60, 112, .09);
    border-radius: 0 0 18px 18px;
    background: #fff;
    box-shadow: 0 12px 22px -16px rgba(0, 60, 112, .35);
    max-height: calc(100vh - 60px) !important;
    max-height: calc(100svh - 60px) !important;
  }

  #nav-main .mobile-nav-panel.in {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  #nav-main .mobile-nav-panel.collapsing {
    transition: height .24s ease;
  }

  #nav-main .mobile-nav-panel > .navbar-nav {
    width: 100%;
    max-width: 680px;
    margin: 12px auto 16px !important;
    padding: 0;
    text-align: left;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li + li {
    margin-top: 4px;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li > a {
    position: relative;
    display: block;
    min-height: 48px;
    padding: 13px 34px 13px 16px !important;
    border-radius: 10px;
    color: #003c70;
    font-size: 16px !important;
    font-weight: 500;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li > a::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    opacity: .45;
    transform: translateY(-50%) rotate(45deg);
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li > a:hover,
  #nav-main .mobile-nav-panel > .navbar-nav > li > a:focus-visible {
    background: #f2f6f9;
    color: #003c70;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li > a[aria-current="page"] {
    background: #fff4ed;
    box-shadow: inset 3px 0 0 #fa7636;
    font-weight: 600;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > .mobile-nav-language {
    position: relative;
    margin-top: 12px;
    padding: 16px 4px 0;
    border-top: 1px solid rgba(0, 60, 112, .1);
  }

  #nav-main .mobile-nav-language select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    height: auto;
    margin: 0 !important;
    padding: 11px 12px;
    border: 1px solid rgba(0, 60, 112, .18);
    border-radius: 10px;
    background-color: #f7f9fb;
    color: #003c70;
    font-family: var(--portal-font-family);
    font-size: 16px;
    line-height: 1.5;
  }
}

@media (max-width: 992px) and (prefers-reduced-motion: reduce) {
  #nav-main .mobile-nav-toggle,
  #nav-main .mobile-nav-line,
  #nav-main .mobile-nav-panel.collapsing,
  #nav-main .mobile-nav-panel a {
    transition: none;
  }
}

/* One toolbar for both public masters, using the existing controls. */
/* Keep layout changes immediate when rotating or crossing a breakpoint. */
#nav-main .navbar-brand,
.call-to-action,
#searchBoxToggleButton,
.profile-menu > a {
  transition-property: color, background-color, border-color, box-shadow;
}

.mobile-toolbar-row { display: none; }
@media (max-width: 992px) {
  html.mobile-toolbar-ready body:not(.homepage) {
    padding-top: var(--navigation-header-height, 60px);
  }

  body #nav-main:has(.mobile-toolbar) {
    padding-right: 12px;
    padding-left: 12px;
  }

  body #nav-main .navbar-header.mobile-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    float: none;
    min-height: 60px;
    margin: 0;
    padding: 8px 0;
  }

  body #nav-main .mobile-toolbar::before,
  body #nav-main .mobile-toolbar::after { display: none; }

  body #nav-main .mobile-toolbar > .mobile-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  body #nav-main .mobile-toolbar-row > .navbar-brand {
    order: 0;
    flex: 0 0 clamp(96px, 27vw, 112px);
    width: clamp(96px, 27vw, 112px);
    height: 44px;
    margin: 0 auto 0 0 !important;
    padding: 0 !important;
  }

  body #nav-main .mobile-toolbar-row > .mobile-nav-toggle {
    order: 3;
    flex: 0 0 44px;
    float: none;
    margin: 0;
  }

  body #nav-main .mobile-toolbar-row > .call-to-action {
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    position: static;
    float: none;
    width: auto;
    min-width: min-content;
    max-width: 100%;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 4px 8px !important;
    border: 1px solid #d5e1e9;
    border-radius: 10px;
    background: #f2f6f9;
    color: #003c70 !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    text-transform: none;
    white-space: normal;
    box-shadow: none;
  }

  body #nav-main #searchBoxToggleButton {
    order: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    position: static;
    float: none;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0 !important;
    border: 1px solid #d5e1e9;
    border-radius: 12px;
    background: #fff;
    color: #003c70 !important;
    font-size: 18px !important;
    line-height: 1;
    box-shadow: none;
  }

  body #nav-main .mobile-toolbar > .profile-menu {
    position: static;
    float: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: 1px solid #d5e1e9;
    border-radius: 10px;
    background: #f2f6f9;
    box-shadow: none;
  }

  body #nav-main .mobile-toolbar > .profile-menu > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px !important;
    color: #003c70 !important;
    font-size: 14px !important;
    line-height: 1.5;
    text-transform: none;
    white-space: normal;
  }

  body #nav-main .mobile-toolbar-row > .call-to-action:hover,
  body #nav-main .mobile-toolbar-row > .call-to-action:focus-visible,
  body #nav-main #searchBoxToggleButton:hover,
  body #nav-main #searchBoxToggleButton:focus-visible {
    background-color: #e5eef5;
    color: #003c70 !important;
  }

  body #nav-main .mobile-toolbar-row > a:focus-visible {
    outline: 2px solid #003c70;
    outline-offset: 2px;
  }

  body #nav-main:has(.mobile-toolbar) .mobile-nav-panel,
  body #nav-main:has(.mobile-toolbar) .mobile-nav-panel.in {
    margin-right: -12px;
    margin-left: -12px;
    max-height: calc(100vh - var(--navigation-header-height, 60px)) !important;
    max-height: calc(100svh - var(--navigation-header-height, 60px)) !important;
  }

  html.mobile-toolbar-ready body ol.breadcrumb { padding-top: 12px; }
}

@media (max-width: 319px) {
  body #nav-main .mobile-toolbar > .mobile-toolbar-row { flex-wrap: wrap; }
  body #nav-main .mobile-toolbar-row > .call-to-action {
    order: 4;
    flex: 1 0 100%;
  }
}

/* Header actions: the same search affordance at every screen size. */
body #searchBoxToggleButton,
body #nav-main #searchBoxToggleButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0 !important;
  border: 1px solid #cbdde9;
  border-radius: 12px;
  background: #edf4fa;
  color: #003c70 !important;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 60, 112, .06);
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

body #searchBoxToggleButton > .fa-search {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0;
  font-size: 22px;
  line-height: 1;
}

body #searchBoxToggleButton > .fa-search::before {
  display: block;
  vertical-align: 0;
}

body #searchBoxToggleButton:hover,
body #searchBoxToggleButton:focus-visible,
body #nav-main #searchBoxToggleButton:hover,
body #nav-main #searchBoxToggleButton:focus-visible {
  border-color: #9fbdd3;
  background: #dfedf7;
  color: #003c70 !important;
  box-shadow: 0 3px 8px rgba(0, 60, 112, .12);
}

body #searchBoxToggleButton:focus-visible {
  outline: 2px solid #003c70;
  outline-offset: 3px;
}

/* Replace the legacy protruding ovals only above the mobile breakpoint. */
@media not all and (max-width: 992px) {
  body #searchBoxToggleButton,
  body .call-to-action {
    position: fixed;
    top: calc(var(--navigation-header-height, 96px) + 8px);
    right: 16px;
    z-index: 1031;
    float: none;
    margin: 0;
  }

  body .call-to-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 180px;
    height: auto;
    min-height: 44px;
    padding: 10px 14px !important;
    border: 1px solid #003c70;
    border-radius: 12px;
    background: #003c70;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
    box-shadow: 0 3px 8px rgba(0, 60, 112, .16);
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
  }

  @supports ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
    body .call-to-action::before {
      content: "";
      flex: 0 0 18px;
      width: 18px;
      height: 18px;
      background-color: currentColor;
      -webkit-mask: url("/Assets/Img/icons/lucide/circle-plus.svg?v=20261104-1") center / contain no-repeat;
      mask: url("/Assets/Img/icons/lucide/circle-plus.svg?v=20261104-1") center / contain no-repeat;
    }
  }

  body .call-to-action ~ #searchBoxToggleButton { right: 204px; }

  body .call-to-action:hover,
  body .call-to-action:focus-visible {
    border-color: #00538d;
    background: #00538d;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(0, 60, 112, .22);
  }

  body .call-to-action:focus-visible {
    outline: 2px solid #003c70;
    outline-offset: 3px;
  }

  /* Pages without a breadcrumb need the same clearance below these controls. */
  body:not(.homepage):not(:has(ol.breadcrumb)):has(#searchBoxToggleButton, .call-to-action) {
    padding-top: calc(var(--navigation-header-height, 96px) + 64px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body #searchBoxToggleButton,
  body #nav-main #searchBoxToggleButton { transition: none; }
}

@media not all and (max-width: 992px) {
  @media (prefers-reduced-motion: reduce) {
    body .call-to-action { transition: none; }
  }
}

/* Shared by Main and Corporate; keep the compiled FlagList links intact. */
#tools {
  padding-bottom: 0;
}

#tools .navbar-nav.navbar-right {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin: 0;
}

#tools .navbar-nav.navbar-right > li {
  float: none;
  padding: 4px 0;
}

#tools .navbar-nav.navbar-right > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 30px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  transition: background-color .16s ease, border-color .16s ease;
}

#tools .navbar-nav.navbar-right > li > a:hover {
  background: #eef3f7;
  border-color: #d2dfe8;
}

#tools .navbar-nav.navbar-right > li > a[aria-current="true"] {
  background: #eef3f7;
  border-color: #003c70;
}

#tools .navbar-nav.navbar-right > li > a:focus-visible {
  outline: 2px solid #003c70;
  outline-offset: 1px;
}

#tools .flag,
#tools a:hover .flag {
  display: block;
  flex: 0 0 24px;
  float: none;
  width: 24px;
  height: 18px;
  margin: 0;
  padding: 0;
  border-radius: 2px;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 30, 55, .12);
  transform: none;
  transition: none;
}

#tools .flag-it { background-image: url('../Img/Flags/it.svg'); }
#tools .flag-en { background-image: url('../Img/Flags/en.svg'); }
#tools .flag-de { background-image: url('../Img/Flags/de.svg'); }
#tools .flag-fr { background-image: url('../Img/Flags/fr.svg'); }
#tools .flag-es { background-image: url('../Img/Flags/es.svg'); }
#tools .flag-pt-pt { background-image: url('../Img/Flags/pt-pt.svg'); }
#tools .flag-ro { background-image: url('../Img/Flags/ro.svg'); }
#tools .flag-ru { background-image: url('../Img/Flags/ru.svg'); }
#tools .flag-sv { background-image: url('../Img/Flags/sv.svg'); }
#tools .flag-sl { background-image: url('../Img/Flags/sl.svg'); }
#tools .flag-zh-cn { background-image: url('../Img/Flags/zh-cn.svg'); }
#tools .flag-ja { background-image: url('../Img/Flags/ja.svg'); }
#tools .flag-nl { background-image: url('../Img/Flags/nl.svg'); }
#tools .flag-no { background-image: url('../Img/Flags/no.svg'); }
#tools .flag-pl { background-image: url('../Img/Flags/pl.svg'); }
#tools .flag-tr { background-image: url('../Img/Flags/tr.svg'); }
#tools .flag-hi { background-image: url('../Img/Flags/hi.svg'); }
#tools .flag-hu { background-image: url('../Img/Flags/hu.svg'); }
#tools .flag-fi { background-image: url('../Img/Flags/fi.svg'); }
#tools .flag-el { background-image: url('../Img/Flags/el.svg'); }
#tools .flag-cs { background-image: url('../Img/Flags/cs.svg'); }
#tools .flag-da { background-image: url('../Img/Flags/da.svg'); }

/* Keep this layout at fractional widths too (for example when zooming).
   The existing mobile rule hides the whole #tools bar through 992px. */
#tools > div {
  display: flex;
  /* Reserve the flag links' 26px height plus 4px padding on each side. */
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Long translated taglines must not push the flags out of the header. */
#tools > div > .navbar-nav:not(.navbar-right) {
  min-width: 0;
}

#tools > div > .navbar-nav:not(.navbar-right) > li {
  max-width: 100%;
  padding-top: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  #tools .navbar-nav.navbar-right > li > a {
    transition: none;
  }
}

/* Shared navigation dialog; no content is inserted into the page flow. */
html.portal-search-modal-open { overflow-y: hidden !important; scroll-behavior: auto !important; }
html.portal-search-modal-open.portal-search-keep-gutter { overflow-y: scroll !important; }

dialog#portalSearchDialog {
    display: none;
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: calc(100% - 40px);
    max-width: 900px;
    height: fit-content;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #315465;
    color: #fff;
    box-shadow: 0 20px 65px rgba(0, 24, 47, .3);
    /* Select2 lists belong to the top layer and may extend beyond the photo. */
    overflow: visible;
}
dialog#portalSearchDialog[open] { display: block; }
#portalSearchDialog::backdrop { background: rgba(5, 24, 43, .58); }
#portalSearchDialog #searchBoxToggle {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border-radius: inherit;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
#portalSearchDialog .portal-search-header {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-bottom: 12px;
}
#portalSearchClose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 14px;
    border: 0;
    border-radius: 24px;
    background: #fff;
    color: #003c70;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    cursor: pointer;
}
#portalSearchClose:hover { background: #edf4f8; }
#portalSearchClose:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
#portalSearchDialog > .select2-container--open .select2-search { flex: 0 0 auto; }
#portalSearchDialog > .select2-container--open .select2-results { display: flex; flex-direction: column; min-height: 0; }
#portalSearchDialog > .select2-container--open .select2-results__options { min-height: 0; overscroll-behavior: contain; }
@media (max-width: 599px) {
    dialog#portalSearchDialog { width: calc(100% - 16px); border-radius: 14px; }
}
/* The search opened from the navigation: same controls as the home hero. */
#searchBoxToggle {
    --portal-field-height: 58px;
    padding: 14px 28px 32px;
    font-family: var(--portal-font-family);
    background: linear-gradient(180deg, rgba(2, 29, 47, .18), rgba(2, 29, 47, .29)),
                url('/Assets/Img/search-bg.jpg') center / cover no-repeat #315465;
}

#searchBoxToggle .search-box {
    width: 100%;
    max-width: 810px;
    margin: 0 auto;
    padding: 0;
    min-height: 0;
    flex: 0 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#searchBoxToggle .search-box h1 {
    margin: 0 0 24px;
    font-family: var(--portal-font-family) !important;
    font-size: clamp(30px, 4.5vw, 52px) !important;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 3px 24px rgba(0, 25, 40, .16);
    overflow-wrap: anywhere;
}

#searchBoxToggle .portal-search-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 76px;
    align-items: center;
    padding: 9px;
    border-radius: 17px;
    background: #fff;
    color: #223e4f;
    box-shadow: 0 12px 36px rgba(2, 24, 37, .17);
}

#searchBoxToggle .portal-search-fields > .select2-container,
#searchBoxToggle .portal-search-fields > select:not(.select2-hidden-accessible),
#searchBoxToggle .portal-search-fields > .btn {
    width: 100% !important;
    min-width: 0;
    margin: 0;
    float: none;
}

#searchBoxToggle .portal-search-fields > select:not(.select2-hidden-accessible) {
    height: var(--portal-field-height);
    font-family: inherit !important;
}

#searchBoxToggle .portal-search-fields > .btn {
    height: var(--portal-field-height);
    padding: 8px 12px;
    border: 0;
    border-radius: 11px;
    background: #003c70;
    color: #fff;
    font-family: inherit !important;
    font-size: 21px;
    box-shadow: none;
}

#searchBoxToggle .portal-search-fields > .btn:hover,
#searchBoxToggle .portal-search-fields > .btn:focus {
    background: #002b50;
}

#searchBoxToggle .portal-search-label { display: none; }

#searchBoxToggle .townSearchList + .select2-container {
    border-left: 1px solid #e2e8ed;
}

#searchBoxToggle .select2-selection--single {
    height: var(--portal-field-height);
    border: 0;
    border-radius: 8px;
    background: #fff;
}

#searchBoxToggle .select2-selection__rendered {
    height: var(--portal-field-height);
    padding: 0 25px 0 16px;
    color: #223e4f;
}

#searchBoxToggle .select2-selection__arrow {
    height: var(--portal-field-height);
    padding: 0;
    top: 0;
    right: 7px;
}

#searchBoxToggle .select2-container .selected {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: var(--portal-field-height);
    padding: 0;
}

#searchBoxToggle .selected > span {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    float: none;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    font-size: 21px;
    line-height: 24px;
    color: #526977;
}

#searchBoxToggle .selected > strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    flex-shrink: 0;
    margin: 0 0 0 34px;
    font-size: 15px;
    font-weight: 600;
    line-height: 19px;
    white-space: normal;
    overflow: hidden;
    overflow-wrap: anywhere;
}

#searchBoxToggle .selected > small {
    flex-shrink: 0;
    margin: 0 0 0 34px;
    color: #526977;
    /* Keep the lower part of letters visible, as in the home search. */
    font-size: 14px !important;
    line-height: 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#searchBoxToggle .selected b { font-size: inherit; }
#searchBoxToggle .selected > small:empty,
#searchBoxToggle .placeholder > span,
#searchBoxToggle .placeholder > small { display: none; }

#searchBoxToggle .select2-container .placeholder strong {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--portal-field-height);
    margin: 0;
    padding: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: clamp(15px, 1.6vw, 17px);
    font-weight: 500;
    line-height: 1.25;
}

#searchBoxToggle .select2-selection:focus-visible,
#searchBoxToggle .btn:focus-visible {
    outline: 3px solid #437fa9;
    outline-offset: 2px;
}

/* Only the dropdown belonging to this panel gets these styles. */
#portalSearchDialog.portal-search-open > .select2-container--open {
    position: fixed !important;
    top: var(--portal-list-top) !important;
    bottom: var(--portal-list-bottom) !important;
    left: var(--portal-list-left) !important;
    width: var(--portal-list-width) !important;
    z-index: 1051;
    color: #223e4f;
    font-family: var(--portal-font-family);
}

#portalSearchDialog.portal-search-open > .select2-container--open .select2-dropdown {
    position: relative;
    top: auto;
    left: auto;
    width: var(--portal-list-width) !important;
    display: flex;
    flex-direction: column;
    max-height: var(--portal-list-height);
    border: 1px solid #d6e0e6;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(2, 24, 37, .16);
}

#portalSearchDialog.portal-search-open > .select2-container--open .select2-search__field {
    min-height: 44px;
    color: #223e4f;
    border-radius: 6px;
    font-family: var(--portal-font-family) !important;
    font-size: 16px;
}

#portalSearchDialog.portal-search-open > .select2-container--open .select2-results__option {
    padding-bottom: 6px;
}

#portalSearchDialog.portal-search-open > .select2-container--open .select2-results__option > div {
    height: auto;
    min-height: 50px;
}

/* Leave space for results when a phone keyboard or landscape reduces height. */
#portalSearchDialog.portal-search-compact-list > .select2-container--open {
    position: fixed !important;
    bottom: auto !important;
    top: calc(var(--portal-view-top, 0px) + max(8px, env(safe-area-inset-top))) !important;
    left: calc(var(--portal-view-left, 0px) + var(--portal-view-width, 100vw) * .04) !important;
    width: calc(var(--portal-view-width, 100vw) * .92) !important;
    z-index: 1051;
}

#portalSearchDialog.portal-search-compact-list > .select2-container--open .select2-dropdown {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-height: calc(var(--portal-view-height, 100vh) - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
    max-height: calc(var(--portal-view-height, 100svh) - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
    border: 1px solid #d6e0e6;
    border-radius: 10px;
}

#portalSearchDialog.portal-search-compact-list > .select2-container--open .select2-results {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

@media (max-width: 599px) {
    #searchBoxToggle { --portal-field-height: 54px; padding: 12px 16px 24px; }
    #searchBoxToggle .search-box h1 { margin-bottom: 18px; }
    #searchBoxToggle .portal-search-fields { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 6px; }
    #searchBoxToggle .townSearchList + .select2-container { border-left: 0; border-top: 1px solid #e2e8ed; }
    #searchBoxToggle .selected:not(.placeholder) > strong { line-height: 16px; }
    #searchBoxToggle .portal-search-fields > .btn { font-size: 16px; }
    #searchBoxToggle .portal-search-label { display: inline; }
}

@media (max-height: 480px) and (orientation: landscape) {
    #searchBoxToggle { --portal-field-height: 52px; padding: 8px 16px 18px; }
    #searchBoxToggle .search-box h1 { font-size: 26px !important; margin-bottom: 12px; }
}

/* A short viewport can also be a portrait phone with its keyboard open.
   Keep its fields stacked; only wider windows have room for two columns. */
@media (min-width: 600px) and (max-height: 480px) and (orientation: landscape) {
    #searchBoxToggle .portal-search-fields { grid-template-columns: repeat(2, minmax(0, 1fr)) 60px; gap: 0; padding: 6px; }
    #searchBoxToggle .townSearchList + .select2-container { border-top: 0; border-left: 1px solid #e2e8ed; }
    #searchBoxToggle .selected > span { display: none; }
    #searchBoxToggle .selected:not(.placeholder) > strong { margin: 0; line-height: 15px; }
    #searchBoxToggle .selected > small { margin: 0; }
    #searchBoxToggle .portal-search-label { display: none; }
}

/* Shared help dialog. Content and translations remain in Main.Master. */
html.how-it-works-open {
  overflow-y: hidden !important;
  scroll-behavior: auto !important;
}

/* Preserve an existing gutter, without adding one to a short page. */
html.how-it-works-open.how-it-works-keep-gutter {
  overflow-y: scroll !important;
}

.how-it-works-trigger {
  display: inline-block;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: #f3f3f3;
  color: #333;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.how-it-works-trigger:focus-visible,
#comeFunzionaContainer button:focus-visible {
  outline: 3px solid #287ab9;
  outline-offset: 3px;
}

dialog#comeFunzionaContainer.how-it-works-modal {
  display: none;
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 1080px;
  height: fit-content;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid #dce3e9;
  border-radius: 18px;
  background: #fff;
  color: #333;
  box-shadow: 0 20px 65px rgba(0, 24, 47, .26);
  overflow: hidden;
  overscroll-behavior: contain;
}

dialog#comeFunzionaContainer.how-it-works-modal[open] {
  display: flex;
  flex-direction: column;
  animation: how-it-works-appear .16s ease-out;
}

#comeFunzionaContainer::backdrop {
  background: rgba(5, 24, 43, .58);
  animation: how-it-works-appear .16s ease-out;
}

#comeFunzionaContainer .how-it-works-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid #e8edf1;
  background: #fff;
}

#comeFunzionaContainer .how-it-works-title {
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #003c70;
  font-size: 22px;
  line-height: 1.3;
  text-transform: none;
  overflow-wrap: anywhere;
}

#comeFunzionaContainer #comeFunzionaClose {
  position: static;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 50%;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 24px;
  background: #f1f5f8;
  color: #003c70;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

#comeFunzionaContainer #comeFunzionaClose:hover { background: #e5edf4; }

#comeFunzionaContainer .how-it-works-content {
  min-height: 0;
  flex: 1 1 auto;
  padding: 24px 28px 32px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#comeFunzionaContainer .how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

#comeFunzionaContainer .how-it-works-step { min-width: 0; text-align: center; }
#comeFunzionaContainer .how-it-works-copy { min-width: 0; }

#comeFunzionaContainer .how-it-works-step img {
  display: block;
  width: 100%;
  max-width: 230px;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto;
}

#comeFunzionaContainer .how-it-works-step hr { margin: 20px 0; }
#comeFunzionaContainer .how-it-works-step h2 {
  margin: 0 0 15px;
  padding: 0;
  font-size: 25px;
  line-height: 1.3;
  text-transform: none;
  overflow-wrap: anywhere;
}

#comeFunzionaContainer .how-it-works-step p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

@media (max-width: 991px) {
  #comeFunzionaContainer .how-it-works-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  #comeFunzionaContainer .how-it-works-step {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    text-align: left;
  }
  #comeFunzionaContainer .how-it-works-step hr { display: none; }
}

@media (max-width: 599px) {
  dialog#comeFunzionaContainer.how-it-works-modal {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
  #comeFunzionaContainer .how-it-works-header { padding: 12px 14px; gap: 10px; }
  #comeFunzionaContainer .how-it-works-title { font-size: 19px; }
  #comeFunzionaContainer .how-it-works-content { padding: 18px 18px 26px; }
  #comeFunzionaContainer .how-it-works-step { display: block; text-align: center; }
  #comeFunzionaContainer .how-it-works-step img { max-width: 144px; margin-bottom: 16px; }
  #comeFunzionaContainer .how-it-works-step h2 { font-size: 23px; }
}

/* Landscape phones and short/zoomed windows need less vertical illustration space. */
@media (min-width: 480px) and (max-height: 500px) {
  #comeFunzionaContainer .how-it-works-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  #comeFunzionaContainer .how-it-works-step {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    text-align: left;
  }
  #comeFunzionaContainer .how-it-works-step img { margin: 0; }
  #comeFunzionaContainer .how-it-works-step hr { display: none; }
}

@media (max-height: 400px) {
  #comeFunzionaContainer .how-it-works-header { padding-top: 6px; padding-bottom: 6px; }
}

@keyframes how-it-works-appear { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  dialog#comeFunzionaContainer.how-it-works-modal[open],
  #comeFunzionaContainer::backdrop { animation: none; }
}

/* Shared category lists: preserve the server-rendered headings, order and links. */
/* Point/guide pages nest this section inside another Bootstrap container. */
.container > #ListaCategorie.container {
  width: 100%;
}

#categoriesPlaceHolder {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

/* Each legacy group becomes a full-width band, in its original reading order. */
#categoriesPlaceHolder > .row {
  display: contents;
  margin: 0;
}

#categoriesPlaceHolder > .row::before,
#categoriesPlaceHolder > .row::after {
  display: none;
}

#categoriesPlaceHolder > .row > .col-md-4,
#categoriesPlaceHolder > .row > .col-12 {
  --category-ink: #225c8b;
  --category-tint: #eff5fb;
  --category-hover: #e2eef9;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  float: none;
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 20px;
  border: 1px solid #e1e8ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 60, 112, .05);
  text-align: left;
}

#categoriesPlaceHolder > .row > :nth-child(3n + 2) {
  --category-ink: #865322;
  --category-tint: #fcf5eb;
  --category-hover: #f7ebda;
}

#categoriesPlaceHolder > .row > :nth-child(3n) {
  --category-ink: #346b54;
  --category-tint: #eff7f2;
  --category-hover: #e1efe6;
}

/* Without scripting, the original links still wrap below their heading. */
#categoriesPlaceHolder > .row > .category-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

#categoriesPlaceHolder .category-links {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

#categoriesPlaceHolder > .row > div > h2 {
  box-sizing: border-box;
  flex: 0 0 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 0 0 16px;
  border-bottom: 1px solid #e8edf2;
  color: #003c70;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  white-space: normal;
  /* Keep complete words, consistently with the portal typography. */
  overflow-wrap: normal !important;
  hyphens: none;
}

#categoriesPlaceHolder > .row > .category-band > h2 {
  margin: 0;
  padding: 0 0 14px;
}

#categoriesPlaceHolder a.btn-tag,
#categoriesPlaceHolder a.btn-tag:visited {
  box-sizing: border-box;
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  /* Override the legacy !important declarations and inline tag margins. */
  margin: 0 !important;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background-color: var(--category-tint, #eff5fb) !important;
  background-image: none;
  color: var(--category-ink, #225c8b) !important;
  box-shadow: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  text-shadow: none;
  white-space: normal;
  overflow: visible;
  /* Narrow-screen spacing below makes room for whole translated compounds. */
  overflow-wrap: normal !important;
  word-break: normal;
  hyphens: none;
  transition: background-color .16s ease, border-color .16s ease;
}

#categoriesPlaceHolder a.btn-tag > .fa-tag {
  margin-inline-end: 4px;
  font-size: 12px;
  opacity: .65;
}

@media (hover: hover) {
  #categoriesPlaceHolder a.btn-tag:hover {
    border-color: var(--category-ink, #225c8b);
    background-color: var(--category-hover, #e2eef9) !important;
    text-decoration: none;
  }
}

#categoriesPlaceHolder a.btn-tag:focus-visible {
  outline: 3px solid #003c70;
  outline-offset: 3px;
  background-color: var(--category-hover, #e2eef9) !important;
  text-decoration: none;
}

#categoriesPlaceHolder a.btn-tag:active {
  background-color: var(--category-hover, #e2eef9) !important;
  text-decoration: none;
}

@media (min-width: 1200px) {
  #categoriesPlaceHolder > .row > .category-band {
    grid-template-columns: 190px minmax(0, 1fr);
    column-gap: 20px;
  }

  #categoriesPlaceHolder > .row > .category-band > h2 {
    padding: 8px 0;
    border-bottom: 0;
  }

  #categoriesPlaceHolder .category-links {
    padding-inline-start: 20px;
    border-inline-start: 1px solid #e8edf2;
  }
}

@media (max-width: 479px) {
  #categoriesPlaceHolder {
    gap: 14px;
  }

  #categoriesPlaceHolder > .row > .col-md-4,
  #categoriesPlaceHolder > .row > .col-12 {
    padding: 16px;
  }

  #categoriesPlaceHolder a.btn-tag {
    font-size: 15px;
  }
}

@media (max-width: 359px) {
  #categoriesPlaceHolder > .row > .col-md-4,
  #categoriesPlaceHolder > .row > .col-12 {
    padding: 12px;
  }

  #categoriesPlaceHolder a.btn-tag {
    font-size: 14px;
    padding-inline: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #categoriesPlaceHolder a.btn-tag {
    transition: none;
  }
}

/* Progressive enhancement: without JavaScript the original links remain visible.
   The extra class also takes precedence over the shared desktop typography grid. */
#categoriesPlaceHolder > .row > .category-band.category-accordion {
  --category-padding: 20px;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

#categoriesPlaceHolder > .row > .category-accordion > h2 {
  margin: 0;
  padding: 0;
  border: 0;
}

#categoriesPlaceHolder .category-toggle {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 60px;
  margin: 0;
  padding: var(--category-padding);
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: start;
  white-space: normal;
  cursor: pointer;
  scroll-margin-top: 90px;
  -webkit-appearance: none;
  appearance: none;
}

#categoriesPlaceHolder .category-label {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: normal !important;
}

#categoriesPlaceHolder .category-toggle::after {
  content: '';
  box-sizing: border-box;
  justify-self: center;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

#categoriesPlaceHolder .category-toggle[aria-expanded="true"]::after {
  transform: translateY(3px) rotate(225deg);
}

#categoriesPlaceHolder .category-toggle:focus-visible {
  outline: 3px solid #003c70;
  outline-offset: -4px;
}

@media (hover: hover) {
  #categoriesPlaceHolder .category-toggle:hover {
    background-color: var(--category-tint);
  }
}

#categoriesPlaceHolder .category-accordion > .category-links {
  margin: 0 var(--category-padding) var(--category-padding);
  padding: 16px 0 0;
  border-top: 1px solid #e8edf2;
  border-inline-start: 0;
}

#categoriesPlaceHolder .category-links[hidden] {
  display: none;
}

@media (max-width: 479px) {
  #categoriesPlaceHolder > .row > .category-band.category-accordion {
    --category-padding: 16px;
  }
}

@media (max-width: 359px) {
  #categoriesPlaceHolder > .row > .category-band.category-accordion {
    --category-padding: 12px;
  }
}

@media print {
  #categoriesPlaceHolder .category-links[hidden] {
    display: flex;
  }
  #categoriesPlaceHolder .category-toggle::after {
    display: none;
  }
}

/* Shared "Accogliente" invitation. Keep the page grid outside this card. */
.visibility-panel {
  box-sizing: border-box;
  container-type: inline-size;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 34px 30px;
  border: 1px solid #d5e5f2;
  border-radius: 20px;
  background: #f0f7fd;
  box-shadow: 0 10px 30px rgba(0, 50, 90, .07);
  color: #003c70;
  font-family: var(--portal-font-family);
  text-align: center;
}

.visibility-panel *, .visibility-panel *::before, .visibility-panel *::after {
  box-sizing: border-box;
}

.visibility-panel .visibility-panel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #dceefb;
  color: #003c70;
}

.visibility-panel .visibility-panel-icon .fa { font-size: 26px; line-height: 1; }

.visibility-panel .visibility-panel-title {
  margin: 0;
  padding: 0;
  color: #003c70;
  font-family: inherit;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.6px;
  text-transform: none;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

/* Override the legacy #page h2 margins without changing responsive type sizes. */
#page .visibility-panel .visibility-panel-title { margin: 0; }

.visibility-panel .visibility-panel-description {
  max-width: 410px;
  margin: 11px auto 0;
  padding: 0;
  color: #485c6d;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.visibility-panel .visibility-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.visibility-panel .visibility-panel-primary,
.visibility-panel .visibility-panel-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  max-width: 100%;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid #d5e5f2;
  border-radius: 11px;
  background: #fff;
  color: #003c70;
  font: 500 14px/1.5 var(--portal-font-family);
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color .15s;
}

.visibility-panel .visibility-panel-primary {
  border-color: #0759a3;
  background: #0759a3;
  color: #fff;
}

.visibility-panel .visibility-panel-primary span { min-width: 0; }
.visibility-panel .visibility-panel-actions .fa { flex-shrink: 0; font-size: 16px; line-height: 1; }
.visibility-panel .visibility-panel-primary:hover { border-color: #064b89; background: #064b89; color: #fff; text-decoration: none; }
.visibility-panel .visibility-panel-secondary:hover { background: #dceefb; color: #003c70; }
.visibility-panel .visibility-panel-primary:focus-visible,
.visibility-panel .visibility-panel-secondary:focus-visible { outline: 3px solid #287ab9; outline-offset: 3px; }

/* A card can be narrow even on a wide screen when it sits beside a map. */
@container (max-width: 370px) {
  .visibility-panel .visibility-panel-title { font-size: 24px; }
  .visibility-panel .visibility-panel-actions { flex-direction: column; }
  .visibility-panel .visibility-panel-actions > * { width: 100%; }
}

@media (max-width: 599px) {
  .visibility-panel { padding: 28px 20px; }
  .visibility-panel .visibility-panel-title { font-size: 24px; }
  .visibility-panel .visibility-panel-actions { flex-direction: column; }
  .visibility-panel .visibility-panel-actions > * { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .visibility-panel .visibility-panel-primary,
  .visibility-panel .visibility-panel-secondary { transition: none; }
}

/* Keep native emoji sequences intact, including joiners, selectors and flag tags.
   Enclosed symbols and regional indicators retain their original fallback fonts. */
@font-face {
  font-family: "Portal Native Emoji";
  src: local("Segoe UI Emoji"), local("Apple Color Emoji"), local("Noto Color Emoji");
  font-style: normal;
  font-weight: normal;
  unicode-range: U+200D,U+231A-231B,U+23E9-23EC,U+23F0,U+23F3,U+25FD-25FE,U+2614-2615,U+2648-2653,U+267F,U+2693,U+26A1,U+26AA-26AB,U+26BD-26BE,U+26C4-26C5,U+26CE,U+26D4,U+26EA,U+26F2-26F3,U+26F5,U+26FA,U+26FD,U+2705,U+270A-270B,U+2728,U+274C,U+274E,U+2753-2755,U+2757,U+2795-2797,U+27B0,U+27BF,U+2B1B-2B1C,U+2B50,U+2B55,U+FE0E-FE0F,U+1F004,U+1F0CF,U+1F300-1F320,U+1F32D-1F335,U+1F337-1F37C,U+1F37E-1F393,U+1F3A0-1F3CA,U+1F3CF-1F3D3,U+1F3E0-1F3F0,U+1F3F4,U+1F3F8-1F43E,U+1F440,U+1F442-1F4FC,U+1F4FF-1F53D,U+1F54B-1F54E,U+1F550-1F567,U+1F57A,U+1F595-1F596,U+1F5A4,U+1F5FB-1F64F,U+1F680-1F6C5,U+1F6CC,U+1F6D0-1F6D2,U+1F6D5-1F6D8,U+1F6DC-1F6DF,U+1F6EB-1F6EC,U+1F6F4-1F6FC,U+1F7E0-1F7EB,U+1F7F0,U+1F90C-1F93A,U+1F93C-1F945,U+1F947-1F9FF,U+1FA70-1FA7C,U+1FA80-1FA8A,U+1FA8E-1FAC6,U+1FAC8,U+1FACD-1FADC,U+1FADF-1FAEA,U+1FAEF-1FAF8,U+E0020-E007F;
}

/* One text family throughout the portal; script-specific families match the preview.
   Google Fonts serves unicode subsets on demand, including the language picker. */
:root {
  --portal-font-family: "Plus Jakarta Sans", "Portal Native Emoji", "Noto Sans", "Noto Sans Devanagari", "Noto Sans SC", "Noto Sans JP", Arial, sans-serif;
}

html:lang(ru), html:lang(el) {
  --portal-font-family: "Noto Sans", "Portal Native Emoji", "Plus Jakarta Sans", Arial, sans-serif;
}
html:lang(hi) {
  --portal-font-family: "Noto Sans Devanagari", "Portal Native Emoji", "Noto Sans", sans-serif;
}
html:lang(ja) {
  --portal-font-family: "Noto Sans JP", "Portal Native Emoji", "Noto Sans", sans-serif;
}
html:lang(zh) {
  --portal-font-family: "Noto Sans SC", "Portal Native Emoji", "Noto Sans", sans-serif;
}

body, button, input, select, textarea,
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.form-control, .select2-container, .select2-dropdown, .select2-search input,
.tooltip, .popover, .leaflet-container, .leaflet-popup-content,
font[face], [style*="font-family"]:not(.fa):not(.glyphicon) {
  font-family: var(--portal-font-family) !important;
}

/* Do not replace icon fonts: their private-use glyphs are not text. */
.fa, [style*="font-family:FontAwesome"], [style*="font-family: FontAwesome"] {
  font-family: FontAwesome !important;
}
.glyphicon { font-family: "Glyphicons Halflings" !important; }

/* Keep words whole at every breakpoint, including CMS-authored text. */
html, body, body * {
  -webkit-hyphens: none !important;
  -ms-hyphens: none !important;
  hyphens: none !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* The picker can contain several writing systems on the same page. */
#FooterLanguages {
  font-family: "Plus Jakarta Sans", "Noto Sans", "Noto Sans Devanagari", "Noto Sans SC", "Noto Sans JP", sans-serif !important;
}
#FooterLanguages option[value="ru"], #FooterLanguages option[value="el"],
#FooterLanguages option[value^="/ru/"], #FooterLanguages option[value^="/el/"] { font-family: "Noto Sans", sans-serif !important; }
#FooterLanguages option[value="hi"], #FooterLanguages option[value^="/hi/"] { font-family: "Noto Sans Devanagari", sans-serif !important; }
#FooterLanguages option[value="ja"], #FooterLanguages option[value^="/ja/"] { font-family: "Noto Sans JP", sans-serif !important; }
#FooterLanguages option[value="zh-cn"], #FooterLanguages option[value^="/zh-cn/"] { font-family: "Noto Sans SC", sans-serif !important; }

/* Translated controls grow with their labels instead of clipping a second line. */
.btn, button, .btn-tag, .btn-with-badge {
  max-width: 100%;
  white-space: normal;
}
.btn-modern {
  height: auto;
  min-height: 48px;
  padding-top: 12px;
  padding-bottom: 12px;
  line-height: 1.5;
}
.evento-box h3 { height: auto; min-height: 50px; line-height: 1.45; }
#comeFunzionaContainer .how-it-works-header { flex-wrap: wrap; }
#comeFunzionaContainer #comeFunzionaClose { max-width: 100%; flex-shrink: 0; }

/* On narrow cards, move the arrow below the address before compressing its words. */
.widget.box-item.customer-card .customer-card-location-row { flex-wrap: wrap; }
.widget.box-item.customer-card .customer-card-location-wrap { flex-basis: 140px; max-width: 100%; }
.widget.box-item.customer-card .customer-card-arrow { margin-inline-start: auto; }

/* Select2 selections and results must show whole labels, in all scripts. */
body .select2-container .select2-selection--single,
body .select2-container .select2-selection__rendered {
  height: auto !important;
  min-height: var(--home-field-height, var(--portal-field-height, var(--offers-field-height, 50px)));
  white-space: normal !important;
  text-overflow: clip;
}
body .select2-container .select2-selection__rendered {
  display: flex;
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
  line-height: 1.5 !important;
}
body .select2-container .selected,
body .select2-container .placeholder,
body .select2-results__option > div {
  height: auto !important;
  min-height: 38px;
  min-width: 0;
  max-width: 100%;
}
body .select2-container .selected > strong,
body .select2-container .placeholder > strong,
body .select2-container .selected > small,
body .select2-results__option strong,
body .select2-results__option small {
  display: block !important;
  height: auto !important;
  min-height: 0;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.5 !important;
}
body .select2-container .placeholder > strong { padding-block: 6px; }
body .select2-container .select2-selection__arrow { top: 50% !important; transform: translateY(-50%); }

/* Region and guide headings share the photo but remain in normal document flow. */
#page .main-header:has(> .main-header-cover) {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  height: auto !important;
  min-height: 360px;
  padding: 32px 20px !important;
}
#page .main-header.guida:has(> .main-header-cover) { min-height: 160px; }
#page .main-header > .main-header-cover { inset: 0; width: 100%; height: 100%; }
#page .main-header:has(> .main-header-cover) > h1,
#page .main-header:has(> .main-header-cover) > h3 {
  position: relative !important;
  inset: auto !important;
  transform: none;
  width: 100%;
  max-width: 1100px;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
}
#page .main-header:has(> .main-header-cover) > h1 { font-size: clamp(26px, 3.2vw, 44px) !important; }
#page .main-header:has(> .main-header-cover) > h3 { font-size: clamp(16px, 2vw, 24px) !important; }

/* Give complete compound words a wider heading column on desktop. */
@media (min-width: 1200px) {
  #categoriesPlaceHolder > .row > .category-band { grid-template-columns: minmax(260px, 30%) minmax(0, 1fr); }
}

/* Devanagari marks need vertical room; CJK text needs natural character spacing. */
html:lang(hi) h1, html:lang(hi) h2, html:lang(hi) h3,
html:lang(hi) .section-title, html:lang(hi) .home-promo-copy summary,
html:lang(hi) #page .main-header:has(> .main-header-cover) > h1,
html:lang(hi) #page .main-header:has(> .main-header-cover) > h3 {
  line-height: 1.55 !important;
  letter-spacing: normal !important;
}
html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3,
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3,
html:lang(ja) #page .main-header:has(> .main-header-cover) > h1,
html:lang(ja) #page .main-header:has(> .main-header-cover) > h3,
html:lang(zh) #page .main-header:has(> .main-header-cover) > h1,
html:lang(zh) #page .main-header:has(> .main-header-cover) > h3 {
  line-height: 1.5 !important;
  letter-spacing: normal !important;
}
html:lang(hi) p, html:lang(hi) li,
html:lang(ja) p, html:lang(zh) p { line-height: 1.8; }

@media (max-width: 767px) {
  .form-control, input[type="text"], input[type="email"], input[type="password"], textarea, select { font-size: 16px; }
  #page h1.section-title { font-size: clamp(24px, 5.6vw, 32px); line-height: 1.4; }
}
@media (max-width: 992px) {
  #page .main-header.guida:has(> .main-header-cover) { min-height: 360px; }
}

/* Inherit text styles without picking up legacy icon rules for nested spans. */
html body span.portal-whole-word {
    all: unset !important;
    white-space: nowrap !important;
}

html body span.portal-whole-word::before,
html body span.portal-whole-word::after {
    content: none !important;
}

/* A generated word joiner bridges emphasis boundaries without changing text. */
html body span.portal-word-joiner,
html body span.portal-word-joiner::before,
html body span.portal-word-joiner::after {
    all: unset !important;
}
html body span.portal-word-joiner::before,
html body span.portal-word-joiner::after {
    content: '\2060' !important;
}

/* Breadcrumbs wrap between words, including long translated page names. */
html body ol.breadcrumb > li,
html body ol.breadcrumb > li > a,
html body ol.breadcrumb > li > a > span {
    overflow-wrap: normal !important;
    word-wrap: normal !important;
}

/* Keep the complete tax-number label at its normal size on narrow phones. */
@media (max-width: 359px) {
    .attivita-page-intro ~ .contact-wrapper .corporate-form-card #PanelForm {
        padding-left: 8px;
        padding-right: 8px;
    }
}

