/* ============================================================
   ChatLibera.net — style.css (pagine pubbliche)
   Mobile-first · tema chiaro/scuro automatico
   Palette storica: arancio #C97A3A + verde salvia #4F7E48
   Aggiunte: blu ardesia #3E5C76 (approfondimenti), notte #1C2326
   ============================================================ */

:root {
  --brand:        #C97A3A;   /* arancio: decorazioni, logo */
  --brand-strong: #9E5A22;   /* arancio scuro: pulsanti e link (contrasto AA) */
  --brand-soft:   #FBEBDD;
  --sage:         #4F7E48;
  --sage-strong:  #3D6437;
  --sage-soft:    #E6EFE3;
  --slate:        #3E5C76;
  --slate-soft:   #E3EBF2;
  --danger:       #A32D2D;
  --danger-soft:  #FBE6E6;

  --bg:           #F7F3EE;
  --surface:      #FFFFFF;
  --surface-alt:  #EFE9E2;
  --text:         #26231F;
  --text-muted:   #6B655D;
  --border:       rgba(38, 35, 31, .12);
  --border-strong:rgba(38, 35, 31, .24);
  --night:        #1C2326;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --pill:      999px;
  --shadow:    0 1px 2px rgba(38,35,31,.06), 0 6px 20px rgba(38,35,31,.07);
  --shadow-lg: 0 18px 50px rgba(38,35,31,.14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-w: 1120px;
  --gutter: 16px;
  --header-h: 64px;
  --ease: .18s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-strong: #E39A5E;
    --brand-soft:   #3A2A1E;
    --sage:         #7FB176;
    --sage-strong:  #9BC893;
    --sage-soft:    #22301F;
    --slate:        #9DB8D0;
    --slate-soft:   #1F2B36;
    --danger:       #F08A8A;
    --danger-soft:  #3A1E1E;
    --bg:           #161B1D;
    --surface:      #1F2629;
    --surface-alt:  #1A2023;
    --text:         #EDE8E2;
    --text-muted:   #A79F95;
    --border:       rgba(237, 232, 226, .12);
    --border-strong:rgba(237, 232, 226, .25);
    --shadow:    0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    --shadow-lg: 0 18px 50px rgba(0,0,0,.4);
  }
}

/* ---- Base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 1rem; line-height: 1.65;
  color: var(--text); background: var(--bg);
}
main { flex: 1; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 750; }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
p  { margin: 0 0 1em; }
a  { color: var(--brand-strong); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--slate); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 680px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: .5rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- Pulsanti -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .65rem 1.25rem; border-radius: var(--pill);
  border: 1.5px solid transparent; font: inherit; font-weight: 650; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background var(--ease), transform var(--ease), border-color var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-strong); color: #fff; }
.btn-primary:hover { background: #864A1A; color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #1C1410; } .btn-primary:hover { background: #F0B07B; color: #1C1410; } }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--text); }
.btn-light { background: #fff; color: var(--sage-strong); }
.btn-light:hover { background: var(--sage-soft); color: var(--sage-strong); }
.btn-sm { min-height: 38px; padding: .45rem 1rem; font-size: .92rem; }
.btn-lg { min-height: 52px; padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ---- Header / navigazione -------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; }
.brand-mark { flex-shrink: 0; }
.brand-text { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; }
.brand-text strong { color: var(--brand); font-weight: 800; }
.brand-text small { font-size: .75em; color: var(--text-muted); font-weight: 500; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; position: relative; transition: transform var(--ease);
}
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after  { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { transform: translateY(-6px) rotate(-45deg); }

.nav-menu {
  position: absolute; top: var(--header-h); left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
  padding: .5rem var(--gutter) 1.25rem; display: none;
}
.nav-menu.is-open { display: block; }
.nav-links { list-style: none; margin: 0 0 1rem; padding: 0; }
.nav-link { display: block; padding: .85rem .25rem; color: var(--text); text-decoration: none; font-weight: 550; border-bottom: 1px solid var(--border); }
.nav-link[aria-current="page"] { color: var(--brand-strong); }
.nav-cta { width: 100%; }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .nav-menu { position: static; display: flex !important; align-items: center; gap: 1.25rem; padding: 0; background: none; border: 0; box-shadow: none; }
  .nav-links { display: flex; gap: .25rem; margin: 0; }
  .nav-link { border: 0; padding: .5rem .8rem; border-radius: var(--pill); }
  .nav-link:hover { background: var(--surface-alt); }
  .nav-link[aria-current="page"] { background: var(--brand-soft); }
  .nav-cta { width: auto; }
}

/* ---- Hero ------------------------------------------------ */
.hero {
  padding: 2.5rem 0 3rem;
  background:
    radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
    radial-gradient(700px 380px at -10% 110%, color-mix(in srgb, var(--sage) 16%, transparent), transparent 70%);
}
.hero-compact { padding-bottom: 2rem; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sage-strong); margin-bottom: .75rem; }
.accent { color: var(--brand-strong); }
.lead { font-size: 1.1rem; color: var(--text-muted); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 .75rem; }
.hero-actions .btn { flex: 1 1 auto; }
.hero-note { font-size: .85rem; color: var(--text-muted); }
@media (min-width: 560px) { .hero-actions .btn { flex: 0 0 auto; } }
@media (min-width: 900px) {
  .hero { padding: 4.5rem 0 5rem; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 3.5rem; }
}

/* Anteprima chat decorativa */
.chat-mock {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 1rem; display: grid; gap: .6rem; max-width: 420px; margin: 0 auto;
}
.chat-mock-bar { display: flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 650; color: var(--text-muted); padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft); }
.bubble { max-width: 85%; padding: .55rem .85rem; border-radius: 16px; font-size: .95rem; background: var(--surface-alt); }
.bubble b { display: block; font-size: .75rem; color: var(--sage-strong); }
.bubble.alt b { color: var(--slate); }
.bubble.me { justify-self: end; background: var(--brand-soft); border-bottom-right-radius: 4px; }
.bubble.me b { color: var(--brand-strong); }
.bubble.them { border-bottom-left-radius: 4px; }
.chat-mock-input { margin-top: .25rem; padding: .65rem .9rem; border: 1px solid var(--border); border-radius: var(--pill); color: var(--text-muted); font-size: .9rem; }

/* ---- Sezioni --------------------------------------------- */
.section { padding: 3rem 0; }
.section-alt { background: var(--surface-alt); }
.section-title { margin-bottom: 1.5rem; }
@media (min-width: 900px) { .section { padding: 4.5rem 0; } }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.step-num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-weight: 800; margin-bottom: .75rem; }
.step p { color: var(--text-muted); margin: 0; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.features { display: grid; gap: 1rem; }
.feature { padding: 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--sage); }
.feature:nth-child(2) { border-top-color: var(--brand); }
.feature:nth-child(3) { border-top-color: var(--slate); }
.feature:nth-child(4) { border-top-color: var(--brand-strong); }
.feature p { color: var(--text-muted); margin: 0; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(4, 1fr); } }

.cta-band { background: var(--sage-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .cta-band { background: #2C4528; } }
.cta-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.cta-inner h2 { color: #fff; margin: 0; }
@media (min-width: 760px) { .cta-inner { flex-direction: row; align-items: center; justify-content: space-between; } }

.rules { display: grid; gap: 1rem; }
.rule { padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--slate); }
.rule-ok { border-left-color: var(--sage); }
.rule-no { border-left-color: var(--danger); }
.rule p { margin: 0; color: var(--text-muted); }
@media (min-width: 760px) { .rules { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .rules { grid-template-columns: repeat(3, 1fr); } }

.page-message { text-align: center; }
.page-message .hero-actions { justify-content: center; }
.page-message .lead { margin-inline: auto; }

/* ---- Card e form ----------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.5rem; }
.form-card { width: 100%; max-width: 460px; justify-self: center; }
.form { display: grid; gap: 1.1rem; }
.field label { display: block; font-weight: 650; margin-bottom: .35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"],
.field input[type="url"], .field input[type="date"], .field input[type="datetime-local"], .field input[type="search"],
.field input[type="file"], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem; font: inherit; font-size: 1rem; /* 16px: evita lo zoom su iOS */
  color: var(--text); background: var(--bg); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--slate); box-shadow: 0 0 0 4px var(--slate-soft); }
.field-help { font-size: .85rem; color: var(--text-muted); margin: .35rem 0 0; }
.field-error { font-size: .88rem; color: var(--danger); margin: .35rem 0 0; font-weight: 550; }
.field-error:empty { display: none; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.field-check { display: grid; grid-template-columns: auto 1fr; gap: .25rem .7rem; align-items: start; }
.field-check input { width: 22px; height: 22px; margin: .15rem 0 0; accent-color: var(--brand-strong); }
.field-check label { font-weight: 450; margin: 0; }
.field-check .field-error { grid-column: 1 / -1; }
.form-note { font-size: .85rem; color: var(--text-muted); text-align: center; margin: 0; }

.alert { padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 550; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--sage-soft); color: var(--sage-strong); }

/* Pagine centrate (ingresso chat, manutenzione, errore) */
.page-center { display: grid; place-items: center; padding: var(--gutter); }
.enter-card { max-width: 420px; text-align: center; display: grid; gap: 1rem; justify-items: center; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand-strong); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Footer ---------------------------------------------- */
.site-footer { background: var(--night); color: #CFC8BF; padding: 2.5rem 0 1rem; margin-top: auto; }
.site-footer a { color: #F0E9E1; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .brand-text { color: #F0E9E1; }
.site-footer .brand-text small { color: #A79F95; }
.footer-grid { display: grid; gap: 2rem; }
.footer-brand p { font-size: .92rem; max-width: 30rem; margin-top: .75rem; }
.footer-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #A79F95; margin-bottom: .75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.site-footer .link-button { color: #F0E9E1; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; color: #A79F95; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }

/* ---- Landing: percorso, etichette, testi, FAQ, collegamenti ---- */
.breadcrumb ol { list-style: none; margin: 0; padding: .9rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem; font-size: .85rem; color: var(--text-muted); }
.breadcrumb li + li::before { content: "›"; margin: 0 .4rem 0 .15rem; color: var(--border-strong); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 550; }

.badges { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.badges li { padding: .3rem .8rem; border-radius: var(--pill); background: var(--sage-soft); color: var(--sage-strong); font-size: .85rem; font-weight: 650; }

.prose-grid { display: grid; gap: 1.25rem; }
.prose-block { padding: 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.prose-block h2 { font-size: 1.25rem; }
.prose-block p { color: var(--text-muted); }
.prose-block p:last-child { margin-bottom: 0; }
@media (min-width: 900px) { .prose-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } }

.faq { display: grid; gap: .75rem; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq-item summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 1rem; min-height: 44px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--brand-strong); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding: 0 1.25rem 1.1rem; margin: 0; color: var(--text-muted); }

.link-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.link-cards a { display: grid; gap: .2rem; padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); transition: border-color var(--ease), transform var(--ease); }
.link-cards a:hover { border-color: var(--brand); transform: translateY(-2px); }
.link-cards strong { color: var(--brand-strong); }
.link-cards span { font-size: .9rem; color: var(--text-muted); }
@media (min-width: 640px) { .link-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .link-cards { grid-template-columns: repeat(4, 1fr); } }

/* ---- Articoli: elenco ------------------------------------- */
.page-head { padding: 2rem 0 1rem; }
.page-head h1 { margin-top: .5rem; }
.section-tight { padding-top: 1rem; }
.chips { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem 0 .5rem; margin-top: 1rem; scrollbar-width: thin; }
.chip { flex: 0 0 auto; padding: .45rem 1rem; min-height: 40px; display: inline-flex; align-items: center; border-radius: var(--pill); border: 1px solid var(--border-strong); color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.chip:hover { border-color: var(--text); }
.chip[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.article-grid { display: grid; gap: 1.25rem; }
@media (min-width: 680px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .article-grid { grid-template-columns: repeat(3, 1fr); } }
.article-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.article-card-img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-card-body { padding: 1.1rem 1.25rem 1.25rem; display: grid; gap: .5rem; align-content: start; }
.article-card h3 { margin: 0; font-size: 1.15rem; }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--brand-strong); }
.article-card p { margin: 0; color: var(--text-muted); }
.tag { justify-self: start; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-decoration: none;
       color: var(--tag, var(--sage)); padding: .2rem .6rem; border-radius: var(--pill); background: color-mix(in srgb, var(--tag, var(--sage)) 14%, transparent); }
@media (prefers-color-scheme: dark) { .tag { color: color-mix(in srgb, var(--tag, var(--sage)) 55%, #fff); } }
.meta-line { font-size: .85rem; color: var(--text-muted); }
.empty { padding: 2rem; text-align: center; color: var(--text-muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; color: var(--text-muted); }

/* ---- Articolo singolo -------------------------------------- */
.article-head { padding-top: 1.5rem; }
.article-head h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin-top: .75rem; }
.article-cover img { width: 100%; border-radius: var(--radius); margin: .5rem 0 1rem; }
.prose { font-size: 1.07rem; padding-bottom: 1rem; }
.prose h2 { margin-top: 2.2rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.prose img { border-radius: var(--radius-sm); }
.prose blockquote { margin: 1.5rem 0; padding: .5rem 1.25rem; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .95em; background: var(--surface-alt); border: 1px solid var(--border); padding: .05rem .35rem; border-radius: 5px; white-space: nowrap; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0 1.75rem; font-size: .98rem; }
@media (max-width: 640px) { .prose table { display: block; overflow-x: auto; } }
.prose caption { text-align: left; font-weight: 650; color: var(--text-muted); padding-bottom: .5rem; }
.prose th, .prose td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose thead th { background: var(--surface-alt); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.prose td:first-child { white-space: nowrap; }
.article-faq { padding-bottom: 2.5rem; }
.section-more { margin: 1.5rem 0 0; text-align: right; font-weight: 650; }

/* ---- Pagine interne: FAQ, form, bacheca --------------------- */
.callout { margin: 2rem 0; }
.callout h2 { margin-top: 0; font-size: 1.3rem; }
.page-head .callout { margin-top: 0; }
.prose .callout { margin: 0 0 2rem; }
.prose .hero-actions { margin-top: 2rem; }
.faq-group { margin-top: 2rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.faq-group h2 { font-size: 1.25rem; padding-bottom: .5rem; border-bottom: 3px solid var(--brand); display: inline-block; }
.faq-answer { padding: 0 1.25rem 1.1rem; color: var(--text-muted); }
.faq-answer ol, .faq-answer ul { margin: 0; padding-left: 1.25rem; }
.faq-answer p:last-child { margin: 0; }

.grid-2, .grid-3 { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 2fr 1fr 2fr; } }
.optional { font-weight: 400; color: var(--text-muted); font-size: .88em; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { font-weight: 650; margin-bottom: .5rem; padding: 0; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; min-height: 40px; padding: .4rem 1rem; border-radius: var(--pill); border: 1.5px solid var(--border-strong); font-weight: 600; font-size: .92rem; transition: background var(--ease), border-color var(--ease); }
.pill input:checked + span { background: var(--sage-soft); border-color: var(--sage); color: var(--sage-strong); }
.pill input:focus-visible + span { outline: 3px solid var(--slate); outline-offset: 2px; }
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field-counter { font-size: .8rem; color: var(--text-muted); text-align: right; margin: .25rem 0 0; }
.field-counter.is-near { color: var(--brand-strong); font-weight: 650; }

.head-row { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
@media (min-width: 760px) { .head-row { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.board { display: grid; gap: 1rem; }
@media (min-width: 900px) { .board { grid-template-columns: 1fr 1fr; } }
.board-msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: grid; gap: .6rem; align-content: start; }
.board-msg h2 { font-size: 1.15rem; margin: .5rem 0 0; }
.board-text { margin: 0; overflow-wrap: anywhere; }
.board-msg footer { border-top: 1px solid var(--border); padding-top: .6rem; margin-top: .25rem; }
.board-note { text-align: center; margin-top: 2rem; color: var(--text-muted); }

/* ---- Schede di /chat/ (Ospite / Iscritto) e password ---- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; padding: .25rem; margin-bottom: 1.25rem; background: var(--surface-alt); border-radius: var(--pill); }
.tabs a { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: var(--pill); font-weight: 650; color: var(--text-muted); text-decoration: none; }
.tabs a[aria-selected="true"] { background: var(--surface); color: var(--brand-strong); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tabs a:focus-visible { outline: 3px solid var(--slate); outline-offset: 2px; }
.tab-extra { margin-top: 1rem; }
.pwd-rules { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .2rem; font-size: .85rem; color: var(--text-muted); }
.pwd-rules li::before { content: "○ "; }
.pwd-rules li.ok { color: var(--sage-strong); }
.pwd-rules li.ok::before { content: "✓ "; }
