/* ============================================================
   Studio Sigma — Blog
   Estende style.css: usa le stesse variabili di tema.
   ============================================================ */

/* ---------- Barra di avanzamento lettura ---------- */
.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--c-accent), var(--c-primary));
  z-index: 200; transition: width 0.1s linear;
}

/* ---------- Hero blog ---------- */
.blog-hero { position: relative; overflow: hidden; }
.blog-hero .container { position: relative; z-index: 1; }
.blog-search {
  display: flex; gap: 0.6rem; max-width: 520px; margin-top: 1.8rem;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px; padding: 0.35rem 0.35rem 0.35rem 1.2rem;
  backdrop-filter: blur(8px);
}
.blog-search input {
  flex: 1; border: none; background: transparent; color: #fff; font: inherit; font-size: 0.98rem;
}
.blog-search input::placeholder { color: rgba(255, 255, 255, 0.6); }
.blog-search input:focus { outline: none; }
.blog-search button {
  border: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 0.92rem;
  background: var(--c-accent); color: #fff; border-radius: 999px; padding: 0.6rem 1.3rem;
}
.blog-search button:hover { background: var(--c-accent-700); }

/* ---------- Filtro categorie ---------- */
.cat-bar {
  display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center;
  padding-bottom: 1.6rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--c-line);
}
.cat-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.05rem; border-radius: 999px; text-decoration: none;
  border: 1.5px solid var(--c-line); background: #fff;
  color: var(--c-body); font-size: 0.9rem; font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
}
.cat-pill:hover { transform: translateY(-1px); border-color: var(--c-accent); color: var(--c-primary); }
.cat-pill.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.cat-pill .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cat-pill .n {
  font-size: 0.72rem; font-weight: 700; line-height: 1;
  padding: 0.2rem 0.42rem; border-radius: 999px;
  background: var(--c-bg-soft); color: var(--c-muted);
}
.cat-pill.is-active .n { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* ---------- Articolo in evidenza ---------- */
.post-hero {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 3rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-hero:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-hero-media { position: relative; min-height: 340px; }
.post-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.post-hero-media .flag {
  position: absolute; top: 1.1rem; left: 1.1rem;
  background: rgba(9, 38, 56, 0.82); color: #fff; backdrop-filter: blur(6px);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.4rem 0.9rem; border-radius: 999px;
}
.post-hero-body { padding: clamp(1.8rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: center; gap: 0.9rem; }
.post-hero-body h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
.post-hero-body h2 a { color: inherit; text-decoration: none; }
.post-hero-body h2 a:hover { color: var(--c-primary); }
.post-hero-body p { color: var(--c-muted); }
@media (max-width: 860px) {
  .post-hero { grid-template-columns: 1fr; }
  .post-hero-media { min-height: 220px; }
}

/* ---------- Griglia articoli ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
@media (max-width: 1000px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .post-grid { grid-template-columns: 1fr; } }

.pcard {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #b8d8ea; }
.pcard-media { position: relative; overflow: hidden; }
.pcard-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.5s ease; }
.pcard:hover .pcard-media img { transform: scale(1.05); }
.pcard-body { padding: 1.4rem 1.6rem 1.7rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.pcard-body h3 { font-size: 1.1rem; line-height: 1.3; }
.pcard-body h3 a { color: inherit; text-decoration: none; }
.pcard-body h3 a::after { content: ""; position: absolute; inset: 0; }
.pcard-body p { font-size: 0.93rem; color: var(--c-muted); }
.pcard-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem;
  margin-top: auto; padding-top: 0.8rem; font-size: 0.8rem; color: var(--c-muted);
}
.pcard-meta .sep { opacity: 0.4; }

.cat-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 0.28rem 0.75rem; border-radius: 999px; text-decoration: none;
  background: var(--c-accent-100); color: var(--c-accent-700);
}
.cat-chip:hover { filter: brightness(0.95); }

/* ---------- Paginazione ---------- */
.pager { display: flex; justify-content: center; gap: 0.4rem; margin-top: 3rem; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 42px; height: 42px; padding: 0 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--c-line); border-radius: 12px;
  text-decoration: none; color: var(--c-body); font-weight: 600; font-size: 0.92rem;
}
.pager a:hover { border-color: var(--c-accent); color: var(--c-primary); }
.pager .is-current { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pager .is-disabled { opacity: 0.4; }

/* ---------- Stato vuoto ---------- */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--c-muted); }
.empty-state .icon { font-size: 3rem; opacity: 0.35; margin-bottom: 1rem; }

/* ---------- Articolo singolo ---------- */
.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
  max-width: 1080px; margin-inline: auto;
}
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; } }

.article-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 1.5rem; }
@media (max-width: 980px) { .article-aside { position: static; } }

.toc {
  background: var(--c-bg-soft); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 1.3rem 1.5rem;
}
.toc h4 {
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--c-muted); margin-bottom: 0.9rem;
}
.toc ol { list-style: none; counter-reset: toc; display: grid; gap: 0.5rem; }
.toc li { counter-increment: toc; }
.toc a {
  display: grid; grid-template-columns: 22px 1fr; gap: 0.5rem;
  font-size: 0.9rem; line-height: 1.35; color: var(--c-body); text-decoration: none;
  padding: 0.25rem 0; border-radius: 6px;
}
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--c-accent); font-weight: 700; font-size: 0.78rem; }
.toc a:hover, .toc a.is-active { color: var(--c-primary); font-weight: 600; }

.share { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share a, .share button {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1.5px solid var(--c-line); border-radius: 12px; background: #fff;
  color: var(--c-body); text-decoration: none; cursor: pointer; font-size: 0.95rem;
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}
.share a:hover, .share button:hover { border-color: var(--c-accent); color: var(--c-primary); transform: translateY(-2px); }

.aside-cta {
  background: linear-gradient(140deg, var(--c-primary-900), var(--c-primary));
  color: #cfe1ec; border-radius: var(--radius); padding: 1.6rem;
}
.aside-cta h4 { color: #fff; font-size: 1.05rem; text-transform: none; letter-spacing: 0; margin-bottom: 0.5rem; }
.aside-cta p { font-size: 0.88rem; margin-bottom: 1.1rem; }
.aside-cta .btn { width: 100%; justify-content: center; padding: 0.7rem 1rem; font-size: 0.92rem; }

/* Titoli con àncora nel corpo dell'articolo */
.prose h2 { scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2 .anchor {
  opacity: 0; margin-left: 0.4rem; font-size: 0.7em; color: var(--c-accent);
  text-decoration: none; transition: opacity 0.15s;
}
.prose h2:hover .anchor { opacity: 1; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; }
.prose > p:first-of-type { font-size: 1.12rem; color: var(--c-ink); }

/* ---------- FAQ articolo ---------- */
.article-faq { max-width: 720px; margin: 3rem auto 0; }
.article-faq h2 { font-size: 1.5rem; margin-bottom: 1.2rem; }

/* ---------- Articoli correlati ---------- */
.related { border-top: 1px solid var(--c-line); }

/* ---------- Newsletter ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.nl-form { gap: 0.7rem; }
.nl-riga { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.nl-campo { flex: 1 1 220px; display: block; }
.nl-campo input {
  width: 100%; font: inherit; font-size: 0.98rem; padding: 0.8rem 1.2rem;
  border: 1.5px solid rgba(255, 255, 255, 0.22); border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); color: #fff;
}
.nl-campo input::placeholder { color: rgba(255, 255, 255, 0.55); }
.nl-campo input:focus {
  outline: none; border-color: var(--c-accent);
  background: rgba(255, 255, 255, 0.16);
}
.nl-riga .btn { flex: none; padding: 0.8rem 1.9rem; }
.nl-privacy {
  display: flex; align-items: flex-start; gap: 0.55rem;
  font-size: 0.82rem; color: #b9cfda; font-weight: 400; line-height: 1.5;
}
.nl-privacy input { margin-top: 0.22rem; flex: none; }
.nl-privacy a { color: #7cc3e8; }
.nl-errore { color: #ffb4ad; font-size: 0.84rem; }

.nl-fatto {
  display: flex; align-items: flex-start; gap: 1rem;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius); padding: 1.4rem 1.6rem;
}
.nl-fatto-icona {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--c-accent); color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.nl-fatto b { color: #fff; display: block; margin-bottom: 0.25rem; }
.nl-fatto p { color: #b9cfda; font-size: 0.92rem; }

/* Su fondo chiaro (es. dentro una card) il form si adatta */
.section:not(.section--dark) .nl-campo input {
  border-color: var(--c-line); background: #fff; color: var(--c-ink);
}
.section:not(.section--dark) .nl-campo input::placeholder { color: var(--c-muted); }
.section:not(.section--dark) .nl-privacy { color: var(--c-muted); }
.section:not(.section--dark) .nl-privacy a { color: var(--c-primary); }

/* ---------- Software ---------- */
.sw-hero-media { position: relative; }
.sw-mock {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.sw-mock-bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 1rem; background: var(--c-bg-soft); border-bottom: 1px solid var(--c-line);
}
.sw-mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d6e0e6; display: block; }
.sw-mock-bar span { margin-left: 0.6rem; font-size: 0.76rem; color: var(--c-muted); }
.sw-mock-body { padding: 1.2rem; display: grid; gap: 0.7rem; }
.sw-row {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 0.8rem; align-items: center;
  padding: 0.7rem 0.9rem; border: 1px solid var(--c-line); border-radius: 10px;
}
.sw-row i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.sw-row b { font-size: 0.86rem; color: var(--c-ink); font-weight: 600; }
.sw-row small { font-size: 0.74rem; color: var(--c-muted); display: block; }
.sw-pill {
  font-size: 0.68rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.sw-ok    { background: #e4f4e8; color: #2f7a43; }
.sw-warn  { background: #fdf3dc; color: #8a6416; }
.sw-alert { background: #fdeceb; color: #b23b32; }

/* ---------- Scheda corso: dati rapidi ---------- */
.corso-fatti {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.4rem; font-size: 0.85rem;
}
.corso-fatti li {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.42rem 0.95rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #d3e4ee;
}
.corso-fatti b { color: #fff; font-weight: 700; }

/* ---------- Convenzioni ---------- */
/* Scheda asimmetrica: la targa del partner a sinistra fa da àncora visiva,
   il contenuto respira a destra. La seconda si specchia, così l'occhio
   scorre a zig-zag invece di incolonnarsi. */
.conv-card {
  display: grid; grid-template-columns: 260px 1fr;
  background: #fff; border: 1px solid var(--c-line);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); margin-bottom: 2.2rem;
  transition: transform 0.25s, box-shadow 0.25s;
}
.conv-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
@media (max-width: 820px) { .conv-card { grid-template-columns: 1fr; } }

.conv-marchio {
  position: relative; display: grid; place-content: center; gap: 0.9rem;
  padding: 2.5rem 1.5rem; text-align: center; overflow: hidden;
}
/* trama diagonale leggera, la stessa idea della hero */
.conv-marchio::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    -45deg, rgba(255,255,255,0.07) 0 2px, transparent 2px 14px);
}
.conv-card--food .conv-marchio { background: linear-gradient(150deg, #4a7c25, #2c4d13); }
.conv-card--dpi  .conv-marchio { background: linear-gradient(150deg, var(--c-primary), var(--c-primary-900)); }

.conv-monogramma {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.6rem, 2rem + 2vw, 3.6rem); line-height: 1;
  color: #fff; letter-spacing: -0.03em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.conv-settore {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px; padding: 0.28rem 0.85rem;
  position: relative; z-index: 1;
}

.conv-corpo { padding: clamp(1.6rem, 3vw, 2.4rem); display: grid; gap: 1rem; align-content: start; }
.conv-testa { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.conv-testa h2 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem); }
.conv-nastro {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
  padding: 0.3rem 0.8rem; border-radius: 999px;
  background: #e8f3e0; color: #3d6b1c;
}
.conv-nastro--nostro { background: var(--c-accent-100); color: var(--c-accent-700); }
.conv-cosa { color: var(--c-muted); }

.conv-vantaggio {
  background: var(--c-bg-soft); border-left: 3px solid var(--c-accent);
  border-radius: 0 12px 12px 0; padding: 1rem 1.2rem;
}
.conv-vantaggio h3 {
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--c-accent-700); margin-bottom: 0.45rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.conv-vantaggio h3 i { font-size: 0.85em; }
.conv-vantaggio p { font-size: 0.94rem; }

.conv-punti { list-style: none; display: grid; gap: 0.5rem; font-size: 0.92rem; color: var(--c-body); }
.conv-punti li { padding-left: 1.5rem; position: relative; }
.conv-punti li::before {
  content: "\f058"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; left: 0; top: 0.05em; color: var(--c-accent); font-size: 0.85em;
}

.conv-azioni { display: flex; flex-wrap: wrap; gap: 0.8rem 1.4rem; align-items: center; margin-top: 0.3rem; }
.conv-azioni .btn i { font-size: 0.78em; margin-left: 0.15rem; }
.conv-info { font-size: 0.88rem; color: var(--c-muted); }
.conv-info:hover { color: var(--c-primary); }

/* La seconda scheda specchia la targa: il ritmo della pagina cambia
   senza introdurre un layout diverso. */
@media (min-width: 821px) {
  .conv-card--rev { grid-template-columns: 1fr 260px; }
  .conv-card--rev .conv-marchio { order: 2; }
}

/* ---------- Passi di accesso ---------- */
.conv-passi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: passo; }
@media (max-width: 780px) { .conv-passi { grid-template-columns: 1fr; } }
.conv-passo {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 1.6rem; position: relative; padding-top: 2.4rem;
}
.conv-passo-num {
  position: absolute; top: -18px; left: 1.6rem;
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(140deg, var(--c-primary), var(--c-primary-900));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
}
.conv-passo h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.conv-passo p { font-size: 0.93rem; color: var(--c-muted); }

/* ---------- Modulo di adesione ai corsi ---------- */
.adesione-form { gap: 0; }
.ade-blocco {
  border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 1.6rem; margin-bottom: 1.4rem; background: #fff;
  display: grid; gap: 1rem;
}
.ade-blocco legend {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  color: var(--c-ink); padding: 0 0.6rem;
}
.ade-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 800;
}
.ade-nota { font-size: 0.86rem; color: var(--c-muted); }
.form-row--3 { grid-template-columns: 1fr 2fr 0.8fr; }
@media (max-width: 640px) { .form-row--3 { grid-template-columns: 1fr; } }

.ade-partecipante {
  border: 1px solid var(--c-line); border-left: 3px solid var(--c-accent);
  border-radius: 12px; padding: 1.1rem 1.3rem; margin-bottom: 0.9rem;
  display: grid; gap: 0.8rem; background: var(--c-bg-soft);
}
.ade-partecipante-testa {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.9rem; color: var(--c-ink);
}
.ade-rimuovi {
  border: none; background: none; cursor: pointer; color: var(--c-muted);
  font-size: 0.95rem; padding: 0.2rem 0.4rem; border-radius: 6px;
}
.ade-rimuovi:hover { color: #b23b32; background: #fdeceb; }
.ade-aggiungi { justify-self: start; padding: 0.6rem 1.2rem; font-size: 0.9rem; }

/* Le condizioni si leggono in un riquadro scorrevole: restano visibili
   senza allungare a dismisura il modulo. */
.ade-condizioni-scroll {
  max-height: 260px; overflow-y: auto;
  border: 1px solid var(--c-line); border-radius: 12px;
  padding: 1.1rem 1.3rem; background: var(--c-bg-soft);
  font-size: 0.88rem; line-height: 1.6; color: var(--c-body);
}
.ade-condizioni-scroll:focus { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.ade-condizioni-scroll h4 { font-size: 0.92rem; margin: 1.1em 0 0.35em; color: var(--c-ink); }
.ade-condizioni-scroll h4:first-of-type { margin-top: 0.6em; }
.ade-condizioni-scroll ul { margin: 0.4em 0 0.4em 1.1rem; display: grid; gap: 0.5em; }
.ade-avviso {
  background: #fdf3dc; border: 1px solid #f0dcae; border-radius: 10px;
  padding: 0.8rem 1rem; margin-bottom: 0.9rem; color: #7a5810;
}
.ade-avviso i { margin-right: 0.35rem; }

.ade-invio { display: grid; gap: 0.6rem; justify-items: start; }
.ade-invio .btn { padding: 0.9rem 2rem; font-size: 1.02rem; }

.ade-fatto {
  display: flex; align-items: flex-start; gap: 1.2rem;
  background: #e4f4e8; border: 1px solid #c3e6cd;
  border-radius: var(--radius); padding: 1.8rem;
}
.ade-fatto-icona {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: #2f7a43; color: #fff; display: grid; place-items: center; font-size: 1.1rem;
}
.ade-fatto h3 { color: #2f7a43; font-size: 1.15rem; margin-bottom: 0.4rem; }
.ade-fatto p + p { margin-top: 0.5rem; }

/* ---------- Area riservata ---------- */
.ar-login { display: grid; place-items: center; padding: 1rem 0 3rem; }
.ar-login-box {
  width: min(460px, 100%);
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: clamp(1.8rem, 4vw, 2.6rem);
}
.ar-login-box h2 { font-size: 1.35rem; }
.ar-login-box p { color: var(--c-muted); font-size: 0.95rem; margin-top: 0.5rem; }

.ar-testa {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center;
  justify-content: space-between; padding-bottom: 1.5rem; margin-bottom: 2rem;
  border-bottom: 1px solid var(--c-line);
}
.ar-testa h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.ar-testa p { color: var(--c-muted); font-size: 0.92rem; margin-top: 0.3rem; }

.ar-sintesi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
@media (max-width: 640px) { .ar-sintesi { grid-template-columns: 1fr; } }
.ar-tile {
  background: #fff; border: 1px solid var(--c-line); border-left: 4px solid var(--c-line);
  border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: var(--shadow-sm);
}
.ar-tile b { display: block; font-family: var(--font-display); font-size: 2.1rem; color: var(--c-ink); line-height: 1; }
.ar-tile span { font-size: 0.86rem; color: var(--c-muted); }
.ar-tile.is-alert { border-left-color: #b23b32; }
.ar-tile.is-alert b { color: #b23b32; }
.ar-tile.is-warn { border-left-color: #c08b1e; }
.ar-tile.is-warn b { color: #8a6416; }
.ar-tile.is-ok { border-left-color: #46a05f; }

.ar-sezione { margin-bottom: 2.8rem; }
.ar-sezione h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.ar-nota { font-size: 0.88rem; color: var(--c-muted); margin-bottom: 1rem; }

.ar-tabella { display: grid; gap: 0.7rem; margin-top: 1rem; }
.ar-riga {
  display: grid; grid-template-columns: 1.2fr 1.6fr auto; gap: 1.2rem; align-items: center;
  background: #fff; border: 1px solid var(--c-line); border-left: 4px solid var(--c-line);
  border-radius: 12px; padding: 1rem 1.3rem;
}
.ar-riga.is-alert { border-left-color: #b23b32; }
.ar-riga.is-warn  { border-left-color: #c08b1e; }
.ar-riga b { font-size: 0.95rem; color: var(--c-ink); display: block; }
.ar-riga small { font-size: 0.8rem; color: var(--c-muted); display: block; margin-top: 0.15rem; }
.ar-riga-data { text-align: right; }
@media (max-width: 780px) {
  .ar-riga { grid-template-columns: 1fr; gap: 0.6rem; }
  .ar-riga-data { text-align: left; }
}

.ar-pill {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 0.25rem 0.7rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.ar-pill.is-alert { background: #fdeceb; color: #b23b32; }
.ar-pill.is-warn  { background: #fdf3dc; color: #8a6416; }
.ar-pill.is-ok    { background: #e4f4e8; color: #2f7a43; }

.ar-vuoto {
  display: flex; align-items: center; gap: 1rem;
  background: #e4f4e8; border: 1px solid #c3e6cd; border-radius: var(--radius);
  padding: 1.3rem 1.6rem; margin-top: 1rem;
}
.ar-vuoto span {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: #2f7a43; color: #fff; display: grid; place-items: center; font-weight: 800;
}
.ar-vuoto p { color: #2f7a43; font-weight: 500; }

.ar-prenota { background: var(--c-bg-soft); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.6rem; }
.ar-prenota select[multiple] { min-height: 120px; padding: 0.5rem; }

/* ---------- Chat assistente (Rebecca) ---------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 150;
  width: 60px; height: 60px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 3px solid #fff;
  background: linear-gradient(140deg, var(--c-primary), var(--c-primary-900));
  color: #fff; font-size: 1.4rem; display: grid; place-items: center;
  box-shadow: 0 12px 30px -8px rgba(15, 61, 89, 0.55);
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-fab:hover { transform: translateY(-3px) scale(1.04); }
.chat-fab img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.chat-fab i { display: none; }
.chat-fab .badge-dot {
  position: absolute; top: 1px; right: 1px; width: 14px; height: 14px;
  border-radius: 50%; background: #46c76b; border: 2px solid #fff;
}
body.chat-open .chat-fab img,
body.chat-open .chat-fab .badge-dot { display: none; }
body.chat-open .chat-fab i { display: block; }

.chat-panel {
  position: fixed; right: 22px; bottom: 96px; z-index: 151;
  width: min(390px, calc(100vw - 44px)); height: min(560px, calc(100dvh - 140px));
  background: #fff; border: 1px solid var(--c-line); border-radius: 20px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  display: none; grid-template-rows: auto 1fr auto;
}
body.chat-open .chat-panel { display: grid; animation: chatIn 0.22s ease-out; }
@keyframes chatIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.chat-head {
  background: linear-gradient(135deg, var(--c-primary-900), var(--c-primary));
  color: #fff; padding: 1.1rem 1.3rem; display: flex; align-items: center; gap: 0.8rem;
}
.chat-head img {
  width: 42px; height: 42px; flex: none; border-radius: 50%; object-fit: cover;
  background: #fff; border: 2px solid rgba(255, 255, 255, 0.85);
}
.chat-head > div { flex: 1; min-width: 0; }
.chat-head b { display: block; font-size: 0.98rem; }
.chat-head small { font-size: 0.76rem; color: #a9c9dc; display: flex; align-items: center; gap: 0.35rem; }
.chat-head small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #46c76b; flex: none; }
.chat-head .chat-voce, .chat-head .close { flex: none; border: none; color: #cfe1ec; cursor: pointer; line-height: 1; }
.chat-head .chat-voce {
  width: 32px; height: 32px; border-radius: 50%; font-size: 0.9rem;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.14);
}
.chat-head .chat-voce:hover { background: rgba(255, 255, 255, 0.26); color: #fff; }
.chat-head .chat-voce.is-off { background: none; color: #8fb0c4; }
.chat-head .close { background: none; font-size: 1.3rem; }

.chat-log { padding: 1.2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.9rem; background: var(--c-bg-soft); }
.chat-msg { max-width: 84%; padding: 0.75rem 1rem; border-radius: 16px; font-size: 0.92rem; line-height: 1.5; }
.chat-msg.bot { background: #fff; border: 1px solid var(--c-line); border-bottom-left-radius: 5px; align-self: flex-start; }
.chat-msg.me { background: var(--c-primary); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.chat-msg.bot a { color: var(--c-primary); }
.chat-msg p + p { margin-top: 0.55em; }
.chat-msg ul { margin: 0.4em 0 0 1.1em; }

/* Riga di Rebecca: foto + bolla */
.chat-row { display: flex; align-items: flex-end; gap: 0.5rem; max-width: 90%; align-self: flex-start; }
.chat-row .chat-msg { max-width: 100%; }
.chat-avatar {
  width: 28px; height: 28px; flex: none; border-radius: 50%; object-fit: cover;
  border: 1.5px solid #fff; box-shadow: 0 1px 4px rgba(15, 61, 89, 0.25);
}
.chat-row.is-parlando .chat-avatar { animation: chatParla 1.1s ease-in-out infinite; }
@keyframes chatParla {
  0%, 100% { box-shadow: 0 0 0 0 rgba(70, 199, 107, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(70, 199, 107, 0); }
}

.chat-typing { display: flex; gap: 4px; align-items: center; padding: 0.85rem 1rem; }
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted);
  animation: blink 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* Scelte rapide: una riga scorrevole, restano disponibili per tutta la conversazione */
.chat-quick {
  display: flex; flex-wrap: nowrap; gap: 0.4rem; padding: 0.3rem 1.2rem 0.7rem;
  background: var(--c-bg-soft); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick button {
  font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap; flex: none;
  padding: 0.4rem 0.8rem; border-radius: 999px;
  border: 1.5px solid var(--c-line); background: #fff; color: var(--c-primary);
}
.chat-quick button:hover { border-color: var(--c-accent); }

.chat-form { display: flex; gap: 0.5rem; padding: 0.85rem; border-top: 1px solid var(--c-line); background: #fff; }
.chat-form input {
  flex: 1; font: inherit; font-size: 0.92rem; padding: 0.65rem 0.95rem;
  border: 1.5px solid var(--c-line); border-radius: 999px; background: var(--c-bg-soft);
}
.chat-form input:focus { outline: none; border-color: var(--c-accent); background: #fff; }
.chat-form button {
  width: 42px; height: 42px; flex: none; border: none; border-radius: 50%; cursor: pointer;
  background: var(--c-accent); color: #fff; font-size: 1rem; display: grid; place-items: center;
}
.chat-form button:hover { background: var(--c-accent-700); }
.chat-form button:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-disclaimer { font-size: 0.68rem; color: var(--c-muted); text-align: center; padding: 0 1rem 0.7rem; background: #fff; }

@media (max-width: 520px) {
  .chat-panel { right: 12px; left: 12px; width: auto; bottom: 88px; }
  .chat-fab { right: 16px; bottom: 16px; }
}
