/*
Generale Pagine client PSC (home, login client, eventuali landing, ecc.)
*/

/* ---------------------------
   GENERAL CLIENT
---------------------------- */
/* Background base */
html:has(body.psc-theme.client-side),
body.psc-theme.client-side {
    background: #fff !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/*body.psc-theme.client-side #content {
  flex: 1 1 auto;
  min-height: 0 !important;
  background: #fff !important;
  margin-top: 45px !important;
  margin-bottom: 105px !important;
}*/

/* Content base */
/* IMPORTANTISSIMO – gestisce larghezza delle pagine */
body.psc-theme.client-side #content {
  background: var(--color-primary-bg) !important;
  width: 100% !important;
  max-width: var(--page-max-width) !important;
  min-height: 0 !important;
  margin-top: 45px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 0px !important;
  padding: 0px !important;
  box-sizing: border-box;
  flex: 1 1 auto;
  box-shadow: none !important;
}

/* Evita clear “spaziatori” */
body.psc-theme.client-side > .clear {
  display: none !important;
}
/* evita clipping del ::before full-bleed */
body.psc-theme.client-side #content,
body.psc-theme.client-side .psc-home-wrapper,
body.psc-theme.client-side #container{
  overflow: visible !important;
}
/* ---------------------------
   FINE GENERAL CLIENT
---------------------------- */


















/* ---------------------------
   HEADER CLIENT
---------------------------- */
body.psc-theme #container {
  height: var(--header-height) !important;
}

body.psc-theme #header-inner {
    max-width: none  !important;  
    display: flex;
    align-items: center;        
    justify-content: space-between; 
    height: 100%;     
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
}



body.psc-theme.client-side .pull-right.flush-right{
  position: static !important;
  top: auto !important;
  transform: none !important;
}

/* wrapper login */
body.psc-theme.client-side .pull-right.flush-right p{
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;      /* spazio tra testo e bottone */
  margin: 0 !important;
  white-space: nowrap !important; /* evita che vada a capo */
}

/* bottone */
body.psc-theme.client-side .pull-right.flush-right a.btn{
  display: inline-flex !important;
  align-items: center !important;
}






















body.psc-theme.client-side #nav-wrapper{
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;

  width: 100% !important;
  min-height: var(--client-nav-min-height, 64px) !important;

  /* IMPORTANT: niente height fissa, sennò schiacci contenuti */
  height: auto !important;
  overflow: visible !important;
  background: var(--color-bg-layout-header) !important;
}

/* nav-inner come container */
body.psc-theme.client-side #nav-inner{
  max-width: var(--page-max-width, 1120px) !important;
  margin: 0 auto !important;
  padding-left: var(--page-gutter-x, 24px) !important;
  padding-right: var(--page-gutter-x, 24px) !important;
  box-sizing: border-box !important;
  min-height: var(--client-nav-min-height, 64px) !important;
  display: flex !important;
  align-items: center !important;
}

/* menu UL: deve avere altezza e centratura verticale */
body.psc-theme.client-side #nav-inner > ul#nav{
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;

  display: flex !important;
  align-items: center !important;
  min-height: var(--client-nav-min-height, 64px) !important;
}

/* lang-wrapper: NON deve essere assoluto (altrimenti crea overlay strani) */
body.psc-theme.client-side #lang-wrapper{
  position: static !important;
  margin-left: 0 !important;   /* il push a destra lo fa il gruppo #psc-header-right-group */

  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  height: var(--client-nav-min-height, 64px) !important;
}

/* Gruppo destra: lang-switcher + accedi, allineato a destra nell'header flex */
body.psc-theme.client-side #psc-header-right-group {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  margin-left: auto !important;   /* spinge il gruppo verso destra */
  height: var(--client-nav-min-height, 64px) !important;
  flex-shrink: 0;
}

body.psc-theme.client-side #nav-wrapper a {
   display: inline-flex !important;
  align-items: center !important;

  font-family: Inter, var(--font-body) !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1 !important;

  color: var(--color-text-on-brand) !important;
  text-decoration: none !important;
  opacity: 1 !important;
}

body.psc-theme.client-side ul#nav li a svg {
  fill: var(--color-text-on-brand);
}

body.psc-theme.client-side #left-logo {
  margin: 12px 11px 12px 12px !important;
}

body.psc-theme.client-side #header-logo {
  margin: 10px 20px 0px 20px !important; 
}
/* ---------------------------
   LANGUAGE SWITCHER (dropdown custom)
---------------------------- */

/* Quando JS aggiunge .psc-lang-dropdown: override di position:static */
body.psc-theme.client-side #lang-wrapper.psc-lang-dropdown {
  position: relative !important;
}

/* Nasconde il vecchio button-container una volta che JS ha trasformato il wrapper */
body.psc-theme.client-side #lang-wrapper.psc-lang-dropdown .button-container {
  display: none !important;
}

/* Bottone: sigla lingua + chevron */
body.psc-theme.client-side .psc-lang-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  height: auto !important;
  background: transparent !important;
  color: var(--color-text-on-brand, #fff) !important;
  font-family: var(--font-body) !important;
  letter-spacing: 0.6px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  transition: border-color 0.15s, background 0.15s;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px; /* 125% */
}
body.psc-theme.client-side .psc-lang-btn:hover {
  border: none !important;
}

/* Chevron */
body.psc-theme.client-side .psc-lang-chevron-icon {
  width: 14px;
  height: 8px;
  flex-shrink: 0;
  color: var(--color-accent, #35A660); /* fill="currentColor" eredita questo */
  transition: transform 0.2s ease;
}
body.psc-theme.client-side #lang-wrapper.psc-lang-dropdown--open .psc-lang-chevron-icon {
  transform: rotate(180deg);
}

/* Dropdown menu */
body.psc-theme.client-side .psc-lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 82px;
  max-height: 220px;       /* circa 4-5 voci visibili */
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--color-primary-bg, #fff);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14), 0 1px 4px rgba(0, 0, 0, 0.07);
  list-style: none !important;
  margin: 0 !important;
  padding: 6px 0 !important;
  z-index: 9999;
  /* scrollbar sottile */
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary, #017247) transparent;
}
/* scrollbar webkit */
body.psc-theme.client-side .psc-lang-menu::-webkit-scrollbar {
  width: 4px;
}
body.psc-theme.client-side .psc-lang-menu::-webkit-scrollbar-track {
  background: transparent;
}
body.psc-theme.client-side .psc-lang-menu::-webkit-scrollbar-thumb {
  background: var(--color-primary, #017247);
  border-radius: 4px;
}
body.psc-theme.client-side #lang-wrapper.psc-lang-dropdown--open .psc-lang-menu {
  display: block;
}

/* Singola voce del menu */
body.psc-theme.client-side .psc-lang-option {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 18px !important;
  color: var(--text-primary, #111) !important;
  font-family: var(--font-body, Inter, sans-serif) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.6px !important;
  text-decoration: none !important;
  transition: color 0.1s;
}
body.psc-theme.client-side #lang-wrapper .psc-lang-option:hover {
  color: var(--color-accent, #35A660) !important;
  text-decoration: none !important;
}
body.psc-theme.client-side .psc-lang-option--active {
  color: var(--color-primary, #017247) !important;
  font-weight: 700 !important;
}

/* Bandierina nel menu a tendina */
body.psc-theme.client-side .psc-lang-flag {
  display: inline-block !important;
  width: 16px !important;
  height: 11px !important;
  flex-shrink: 0 !important;
  align-self: center !important;  /* centra rispetto ai fratelli flex */
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  background-size: cover;
}

/* Testo sigla lingua: flex item esplicito per allineamento preciso */
body.psc-theme.client-side .psc-lang-label {
  display: inline-block;
  line-height: 1;
  align-self: center;
}

/* ---------------------------
   FINE LANGUAGE SWITCHER
---------------------------- */

/* ---------------------------
   FINE HEADER CLIENT
---------------------------- */




/* ---------------------------
   FOOTER CLIENT
---------------------------- */
/* Footer PSC in fondo */
body.psc-theme.client-side .psc-footer-wrapper {
  flex: 0 0 auto;
}
/* Nascondi eventuale footer core se presente */
body.psc-theme.client-side #footer,
body.psc-theme.client-side #footer-wrap {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* ---------------------------
   FINE FOOTER CLIENT
---------------------------- */


/* ---------------------------
   SFONDO GRIGIO PAGINE CON FORM
---------------------------- */
body.psc-theme.client-side #content > form::before{
  content: "";
  position: absolute !important;
  inset: 0 !important;                  
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100vw !important;
  background: var(--color-bg-surface-highlight) !important;
  z-index: -1 !important;
}
/* ---------------------------
   FINE SFONDO GRIGIO PAGINE CON FORM
---------------------------- */



/* MOBILE */
@media (max-width: 860px){
  body.psc-theme.client-side #content,
  body.psc-theme.client-side #container{
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.psc-theme.client-side #content{
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }
}
