/* ======== VARIABILI PRINCIPALI ======== */
:root {
  --site-max-width: 1320px;        /* max contenuto desktop */
  --site-padding-x: 16px;          /* padding laterale su mobile */
  --color-primary: #007bff;        /* blu Bootstrap */
  --color-text: #333333;
  --color-blue: #273D93;
  --color-muted: #6c757d;
  --color-topbar-bg: #ECF5FB;
  --color-header-bg: #ffffff;
  --color-border-light: #dbe9f2;
  --logo-height: 60px;
}

/* ======== RESET DI BASE ======== */
html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
}

/* Contenitore centrale limitato */
.site-container {
  max-width: var(--site-max-width);
  margin-inline: auto;
  padding-inline: var(--site-padding-x);
}

/* ======== HEADER ======== */
header {
  width: 100%;
  top: 0;
  left: 0;
  z-index: 999;
}

.text-blue {
  color: var(--color-blue);
}

/* --- Riga superiore --- */
.top-bar {
  background-color: var(--color-topbar-bg);
  font-size: 0.9rem;
}

.top-bar a {
  color: var(--color-blue);
  text-decoration: none;
}

.top-bar a:hover {
  text-decoration: underline;
}

/* Logo */
.logo {
  height: var(--logo-height);
  max-height: var(--logo-height);
}
/* Menu principale */
.main-menu .nav-link {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.main-menu .nav-link:hover {
  color: var(--color-blue);
  text-decoration: none;
}

/* Responsive: centra logo e menu in verticale su mobile */
@media (max-width: 767.98px) {
  .main-menu {
    margin-top: 0.5rem;
    text-align: center;
  }
  .main-menu .nav {
    justify-content: center;
  }
}
/* ======== Burger base ======== */
.menu-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border-light);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  position: relative;
  transition: transform .2s ease-in-out, opacity .2s ease-in-out;
}

.menu-toggle-bars {
  margin: 0 auto;
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after  { top:  6px; }

/* ======== Overlay mobile con UNICO NAV ======== */
body.menu-open {
  overflow: hidden; /* niente scroll sotto l'overlay */
}

/* per forzare la visibilità del nav su mobile quando aperto */
body.menu-open .main-menu {
  display: flex !important;
}

/* stile overlay solo su viewport mobile */
@media (max-width: 767.98px) {
  .main-menu {
    /* di base, su mobile il menu è nascosto (già d-none), qui solo i comportamenti overlay */
  }

  body.menu-open .main-menu {
    position: fixed;
    inset: 0;
    z-index: 1050; /* sopra l'header */
    background: rgba(255, 255, 255, 0.5); /* bianco alfa 50% */
    -webkit-backdrop-filter: saturate(180%) blur(2px);
    backdrop-filter: saturate(180%) blur(2px); /* opzionale, piacevole */
    align-items: center;
    justify-content: center;
  }

  /* nav centrato verticalmente: la lista in colonna */
  body.menu-open .main-menu .nav {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
  }

  body.menu-open .main-menu .nav-link {
    font-size: 1.25rem;
  }

  /* pulsante X in alto a destra */
  .menu-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border-light);
    background: #fff;
    border-radius: 50%;
    font-size: 28px;
    line-height: 36px;
    color: var(--color-text);
    cursor: pointer;
  }
}

.footer {
  background-color: #263A95;
}

.footer-link {
  color: #ffffff;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.social-link {
  color: #ffffff;
  font-size: 1.2rem;
  text-decoration: none;
  transition: opacity 0.2s ease-in-out;
}

.social-link:hover {
  opacity: 0.8;
}

/*CENTRO*/
.masonry {
  column-count: 3; /* numero colonne */
  column-gap: 1.5rem;
}
.masonry .card {
  display: inline-block;
  width: 100%;
  margin-bottom: 1.5rem;
  background: #fff;
  border-radius: 0rem;
}
@media (max-width: 992px) {
  .masonry { column-count: 2; }
}
@media (max-width: 576px) {
  .masonry { column-count: 1; }
}
h2 {
	color: var(--color-blue);
}
h3 {
	color: var(--color-text);
	font-size: 20px;
}
h4 {
	color: var(--color-text);
	font-size: 16px !important;
}
.card h3 {
  font-size: 1.3rem;
  font-weight: 600;
}

.card h4 {
  font-size: 1.0rem;
  font-weight: 600;
}

.card textarea {
  resize: vertical;
}

.card .btn-primary {
  background-color: #263A95; /* colore coerente con tuo footer */
  border: none;
  border-radius: 0.5rem;
}
/*CHAT*/
.chat-box {
  max-height: 500px;
  overflow-y: auto;
  padding: 0 .5rem; /* padding laterale generale */
  display: flex;
  flex-direction: column;
}

/* struttura messaggi */
.msg {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  max-width: 80%;
}

/* messaggi utente (destra) */
.msg.user {
  align-self: flex-end;
  text-align: right;
  margin-right: .5rem; /* piccolo distacco dal bordo destro */
}

.msg.user .msg-content {
  background-color: #263A95;
  color: #fff;
  border-radius: 1rem 1rem 0.2rem 1rem;
  padding: 10px;
}

/* messaggi admin (sinistra) */
.msg.admin {
  align-self: flex-start;
  text-align: left;
  margin-left: .5rem; /* piccolo distacco dal bordo sinistro */
}

.msg.admin .msg-content {
  background-color: #f1f1f1;
  color: #333;
  border-radius: 1rem 1rem 1rem 0.2rem;
  padding: 10px;
}

/* orari */
.msg-time {
  font-size: .75rem;
  color: #999;
  margin-top: .25rem;
  margin-right: .3rem;
}

.msg-time i {
    font-size: 0.8em;
    vertical-align: middle;
}

/* scrollbar */
.chat-box::-webkit-scrollbar {
  width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}
.support-section {
  position: relative;
  /*overflow: hidden;*/
  background: url("../images/bg-chat-2.jpg") no-repeat bottom right;
  background-size: contain;
  background-attachment: fixed; /* opzionale: effetto parallax */
}

/* leggera patina bianca per rendere leggibile il contenuto sopra */
.support-section::before {
  content: "";
  position: absolute;
  inset: 0;
  /*background: rgba(255, 255, 255, 0.8); /* 80% trasparenza */
  z-index: 0;
}

/* tutto il contenuto sopra l’overlay */
.support-section > * {
  position: relative;
  z-index: 1;
}
.support-section::before {
  pointer-events: none; /* evita qualsiasi interferenza con lo scroll */
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.card .row > .col-12 {
  align-items: flex-start;
}

.card .fw-bold.text-muted {
  line-height: 1.4;
}

.card small {
  font-size: 0.85rem;
  color: #888;
}

.card .border-bottom {
  border-color: #e5e5e5 !important;
}

.card .col-md-9 {
  color: #333;
  line-height: 1.5;
}

/*LOGIN*************/
.login-card {
  max-width: 400px;
}

.login-card,
.login-card .card,
.login-card .card-body {
  border-radius: 0 !important;
}

section.bg-light {
  padding-top: 0rem !important;
  padding-bottom: 4rem !important;
}

/* Colore aziendale coerente */
.text-primary {
  color: #263A95 !important;
}
.btn-primary {
  background-color: #263A95;
  border: none;
}
.btn-primary:hover {
  background-color: #1f317c;
}