/* AFT 4 — Sito pubblico — Stili */

/* Font locali — Lora (display) + Poppins (body) */
@font-face { font-family: 'Lora'; src: url('fonts/Lora-Variable.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('fonts/Lora-Italic-Variable.ttf') format('truetype'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Light.ttf') format('truetype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Bold.ttf') format('truetype'); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  --navy:   #12304a;
  --teal:   #1a6b72;
  --gold:   #c9973a;
  --cream:  #f7f3ed;
  --white:  #ffffff;
  --mist:   #e8eff4;
  --slate:  #4a6070;
  --text:   #1c2b35;
  --border: #d4dde5;
  --red:    #c0392b;
  --green:  #1a7a4a;

  --font-display: 'Lora', Georgia, serif;
  --font-body:    'Poppins', 'Segoe UI', sans-serif;

  --radius:     10px;
  --shadow-sm:  0 1px 4px rgba(18,48,74,.07);
  --shadow-md:  0 4px 16px rgba(18,48,74,.11);
  --shadow-lg:  0 12px 36px rgba(18,48,74,.15);
  --transition: .2s ease;
  --container:  1280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-body); color: var(--text); background: var(--cream); line-height: 1.65; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img  { max-width: 100%; display: block; }
a    { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--navy); }

/* ── ACCESSIBILITY ──────────────────────────────────────── */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; z-index: 9999; background: var(--navy); color: #fff; padding: .75rem 1.5rem; font-size: 1rem; text-decoration: none; }
.skip-link:focus { position: fixed; left: 50%; transform: translateX(-50%); top: 0; width: auto; height: auto; outline: 3px solid var(--gold); border-radius: 0 0 6px 6px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.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; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── LAYOUT ─────────────────────────────────────────────── */
.container { width: min(var(--container), 100%); margin-inline: auto; padding-inline: 2rem; }

/* ── HEADER ─────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 24px rgba(18,48,74,.25);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-block: .75rem; gap: 1.5rem; }

.brand { display: flex; align-items: center; gap: .875rem; text-decoration: none; }
.brand-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  border: 2px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.brand-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: #fff; line-height: 1.2; display: block; letter-spacing: -.01em; }
.brand-name:hover { color: #fff; }
.brand-sub  { font-size: .7rem; color: rgba(255,255,255,.45); letter-spacing: .06em; font-weight: 300; text-transform: uppercase; display: block; }

.main-nav ul { list-style: none; display: flex; gap: .125rem; }
.main-nav a {
  display: block; padding: .5rem .875rem;
  color: rgba(255,255,255,.7); text-decoration: none;
  font-size: .875rem; font-weight: 500; letter-spacing: .01em;
  border-radius: 6px; transition: all var(--transition);
}
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.main-nav a.active { border-bottom: 2px solid var(--gold); border-radius: 6px 6px 0 0; }
.nav-btn-auth { background: var(--gold) !important; color: var(--navy) !important; border-radius: 6px !important; font-weight: 700 !important; padding: .45rem 1rem !important; border-bottom: none !important; letter-spacing: .02em; }
.nav-btn-auth:hover { background: #d9a741 !important; color: var(--navy) !important; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .5rem; border-radius: 6px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  background:
    linear-gradient(160deg, rgba(18,48,74,.92) 0%, rgba(26,107,114,.85) 100%),
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(255,255,255,.018) 40px, rgba(255,255,255,.018) 41px);
  color: #fff;
  padding: 2.5rem 0 3rem;
  position: relative;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.25rem;
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 600; line-height: 1.15; letter-spacing: -.02em;
  margin-bottom: 1.25rem;
}
.hero h1 em { color: var(--gold); font-style: italic; }
.hero-desc { font-size: 1.05rem; color: rgba(255,255,255,.75); max-width: 50ch; margin-bottom: 2rem; line-height: 1.7; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
.stat-box {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  text-align: center; backdrop-filter: blur(8px);
}
.stat-num { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1; margin-bottom: .375rem; }
.stat-lbl { font-size: .78rem; color: rgba(255,255,255,.6); letter-spacing: .04em; font-weight: 500; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.5rem; border-radius: 6px;
  font-family: var(--font-body); font-size: .875rem; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer;
  transition: all var(--transition); letter-spacing: .02em;
}
.btn-gold    { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #d9a741; color: var(--navy); }
.btn-ghost   { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }
.btn-navy    { background: var(--navy); color: #fff; }
.btn-navy:hover { background: #1a3f5e; color: #fff; }
.btn-sm { padding: .5rem 1rem; font-size: .8rem; }

/* ── SECTIONS ────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-alt { background: var(--mist); }
.sec-hdr { text-align: center; max-width: 60ch; margin-inline: auto; margin-bottom: 3rem; }
.sec-eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: .75rem; }
.sec-hdr h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 600; color: var(--navy); margin-bottom: .75rem; }
.sec-hdr p  { color: var(--slate); font-size: .95rem; }
.sec-rule { width: 60px; height: 3px; background: linear-gradient(90deg, var(--teal), var(--gold)); border-radius: 3px; margin: 1.25rem auto 0; }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert { padding: 1rem 1.5rem; border-radius: var(--radius); font-size: .9rem; border-left: 4px solid; }
.alert-error { background: #fdf2f2; color: var(--red); border-color: var(--red); }
.alert-info  { background: #eef6fb; color: var(--navy); border-color: var(--teal); }

/* ── MEDICI GRID ─────────────────────────────────────────── */
.medici-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }
.medico-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.25rem; text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: all var(--transition); box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.medico-card:hover { border-color: var(--teal); box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--text); }
.medico-card.referente-aft { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,151,58,.2), var(--shadow-sm); position: relative; overflow: hidden; }
.medico-card.referente-aft:hover { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,151,58,.3), var(--shadow-md); }
.medico-card.referente-aft::before { content: 'REFERENTE AFT'; position: absolute; top: 22px; right: -42px; width: 150px; text-align: center; background: var(--gold); color: #fff; font-size: .55rem; font-weight: 700; letter-spacing: .07em; padding: .25rem 0; transform: rotate(45deg); pointer-events: none; }
.medico-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  color: #fff; font-family: var(--font-display); font-size: 1.35rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; border: 2px solid var(--gold); flex-shrink: 0;
}
.medico-nome { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--navy); margin-bottom: .25rem; line-height: 1.3; }
.medico-spec { font-size: .72rem; color: var(--slate); margin-bottom: .5rem; letter-spacing: .02em; }
.medico-indirizzo { font-size: .72rem; color: var(--slate); margin-bottom: .5rem; }
.medico-orari-tag { font-size: .72rem; color: var(--teal); font-weight: 600; margin-top: auto; letter-spacing: .02em; }

/* ── ORARI MODAL ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(18,48,74,.6); backdrop-filter: blur(4px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform var(--transition);
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  color: #fff;
  padding: 1.5rem 2rem; border-radius: var(--radius) var(--radius) 0 0;
  display: flex; align-items: center; gap: 1.25rem;
}
.modal-avatar {
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.15);
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: #fff;
}
.modal-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.modal-subtitle { font-size: .78rem; color: rgba(255,255,255,.55); margin-top: .25rem; }
.modal-close {
  background: rgba(255,255,255,.1); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,.25); }
.modal-body { padding: 1.5rem 2rem 2rem; }

.orari-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.orari-table th {
  text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--white); padding: .65rem 1rem;
  background: var(--navy);
}
.orari-table td { padding: .75rem 1rem; border-bottom: 1px solid #f0f4f7; color: var(--text); vertical-align: middle; }
.orari-table tr:last-child td { border-bottom: none; }
.orari-table tr:hover td { background: var(--mist); }
.giorno-label { font-weight: 600; color: var(--navy); min-width: 100px; }
.orario-slot { font-variant-numeric: tabular-nums; }
.note-orario { font-size: .75rem; color: var(--slate); font-style: italic; }

.orario-pill {
  display: inline-block;
  background: var(--mist);
  color: var(--teal);
  font-size: .82rem; font-weight: 600;
  padding: .3rem .75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.slot-vuoto { color: #b0bec5; font-size: 1rem; }

.modal-note-box {
  display: flex; align-items: flex-start; gap: .625rem;
  background: var(--mist); border-radius: 8px;
  padding: .875rem 1rem; margin-top: 1.25rem;
  font-size: .8rem; color: var(--slate); line-height: 1.55;
}
.modal-note-icon { font-size: .9rem; flex-shrink: 0; margin-top: .05rem; }
.modal-prenota-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-top: 1.25rem; padding: .7rem 1.25rem;
  background: var(--teal); color: #fff; border-radius: 8px;
  font-size: .875rem; font-weight: 600; text-decoration: none;
  transition: background .2s ease;
}
.modal-prenota-btn:hover { background: #155a60; color: #fff; }

.modal-contatti {
  margin-bottom: 1.25rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.modal-contatti-row {
  display: flex; align-items: flex-start; gap: .875rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--mist);
  background: var(--white);
}
.modal-contatti-row:last-child { border-bottom: none; }
.modal-contatti-row:first-child { background: #f0f7f8; }
.studio-sep {
  background: var(--navy);
  color: rgba(255,255,255,.7);
  font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: .35rem 1rem;
}
.cont-ico { font-size: .95rem; flex-shrink: 0; margin-top: .1rem; width: 20px; text-align: center; }
.cont-info { display: flex; flex-direction: column; gap: .1rem; }
.cont-label { font-size: .65rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--slate); }
.cont-valore { font-size: .88rem; color: var(--navy); font-weight: 500; line-height: 1.4; }

.medico-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.info-chip { background: var(--mist); border-radius: 6px; padding: .75rem 1rem; }
.info-chip-label { font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); margin-bottom: .25rem; }
.info-chip-val { font-size: .85rem; color: var(--navy); font-weight: 500; }
.info-chip-val a { color: var(--teal); text-decoration: none; }

/* ── NEWS ────────────────────────────────────────────────── */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.news-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: .625rem;
}
.news-card.urgente { border-color: var(--red); background: #fdf7f7; }
.news-card.evidenza { border-color: var(--gold); }
.news-card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--navy); }
.news-card p  { font-size: .875rem; color: var(--slate); }
.news-badge {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: .25rem .625rem; border-radius: 100px;
}
.badge-news    { background: #e8f4f5; color: var(--teal); }
.badge-avviso  { background: #fff3e0; color: #b26a00; }
.badge-urgente { background: #fde8e8; color: var(--red); }
.news-meta { font-size: .75rem; color: var(--border); margin-top: auto; }

/* ── URGENZE ─────────────────────────────────────────────── */
.urgenze-box {
  background: linear-gradient(135deg, var(--navy) 0%, #1a4a6a 100%);
  border-radius: var(--radius); padding: 2.5rem 3rem;
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.urgenze-box h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin-bottom: .5rem; }
.urgenze-box p  { color: rgba(255,255,255,.65); font-size: .9rem; }
.urgenze-nums { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.num-chip {
  border-radius: var(--radius); padding: 1rem 1.5rem; min-width: 160px;
  text-align: center;
}
.chip-gold { background: rgba(201,151,58,.15); border: 1px solid rgba(201,151,58,.4); }
.chip-red  { background: rgba(192,57,43,.15);  border: 1px solid rgba(192,57,43,.4); }
.num-chip .lbl { display: block; font-size: .72rem; color: rgba(255,255,255,.6); margin-bottom: .5rem; line-height: 1.4; }
.num-chip a { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: -.02em; display: block; }
.chip-gold a { color: var(--gold); }
.chip-red  a { color: #e57373; }

/* ── INFO CARDS ──────────────────────────────────────────── */
.info-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-sm); }
.info-card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--navy); margin-bottom: 1rem; }
.info-row { display: flex; gap: 1rem; padding: .625rem 0; border-bottom: 1px solid var(--mist); align-items: flex-start; }
.info-row:last-child { border-bottom: none; }
.info-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); min-width: 80px; padding-top: .125rem; }

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer { background: var(--navy); color: rgba(255,255,255,.65); padding: 3.5rem 0 2rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-col h4 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: .875rem; }
.footer-col p, .footer-col li { font-size: .83rem; line-height: 1.75; }
.footer-col ul { list-style: none; }
.footer-col a { color: rgba(255,255,255,.55); text-decoration: none; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem; font-size: .78rem; text-align: center; }
.footer-bottom a { color: rgba(255,255,255,.45); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* ── PROSPETTO ORARI MODAL ───────────────────────────────── */
.modal-overlay-wide {
  position: fixed; inset: 0; background: rgba(18,48,74,.65); backdrop-filter: blur(4px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 1.25rem; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay-wide.open { opacity: 1; pointer-events: all; }
.modal-box-wide {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: min(1160px, 100%); max-height: 92vh; overflow-y: auto;
  transform: translateY(20px); transition: transform var(--transition);
  display: flex; flex-direction: column;
}
.modal-overlay-wide.open .modal-box-wide { transform: translateY(0); }

.prospetto-wrap { overflow-x: auto; padding: 0 1.5rem 1.5rem; }
.prospetto-table {
  width: 100%; border-collapse: collapse;
  font-size: .78rem; font-family: var(--font-body);
}
.prospetto-table thead tr:first-child th {
  background: var(--navy); color: #fff;
  padding: .6rem .75rem; text-align: center;
  font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  position: sticky; top: 0; z-index: 2;
}
.prospetto-table thead tr:first-child th:first-child {
  text-align: left; min-width: 165px; position: sticky; left: 0; z-index: 3; background: var(--navy);
}
.prospetto-table tbody tr:nth-child(even) td { background: #f7fbfc; }
.prospetto-table tbody tr:nth-child(odd)  td { background: var(--white); }
.prospetto-table tbody tr:hover td { background: #e4f1f3 !important; }
.prospetto-table td {
  padding: .5rem .6rem; border-bottom: 1px solid var(--border); border-right: 1px solid #edf2f5;
  vertical-align: middle; text-align: center;
}
.prospetto-table td:first-child {
  text-align: left; font-weight: 600; color: var(--navy); font-size: .8rem;
  white-space: nowrap; padding-left: .875rem;
  position: sticky; left: 0; z-index: 1;
  box-shadow: inset 0 0 0 999px inherit;
}
.prospetto-table tbody tr:nth-child(even) td:first-child { background: #f7fbfc; }
.prospetto-table tbody tr:nth-child(odd)  td:first-child { background: var(--white); }
.prospetto-table tbody tr:hover td:first-child { background: #e4f1f3 !important; }
.prospetto-table td:last-child { border-right: none; }

.p-pill {
  display: inline-block; background: var(--mist); color: var(--teal);
  font-size: .72rem; font-weight: 600; padding: .2rem .45rem;
  border-radius: 5px; border: 1px solid var(--border);
  font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.4;
}
.p-pill + .p-pill { margin-top: 2px; }
.p-pill.pomeriggio { color: var(--navy); background: #f0ede7; border-color: #d9d2c4; }
.p-vuoto { color: #c8d5de; font-size: .9rem; }
.p-appo { font-size: .63rem; color: var(--slate); font-style: italic; display: block; margin-top: 1px; }

.prospetto-legend {
  display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center;
  padding: .75rem 1.5rem; border-top: 1px solid var(--border);
  font-size: .75rem; color: var(--slate);
}
.legend-item { display: flex; align-items: center; gap: .375rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-dot.mat  { background: var(--mist); border: 1px solid var(--border); }
.legend-dot.pom  { background: #f0ede7; border: 1px solid #d9d2c4; }

/* ── AREA RISERVATA MODAL ────────────────────────────────── */
.modal-overlay-auth {
  position: fixed; inset: 0; background: rgba(18,48,74,.7); backdrop-filter: blur(5px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay-auth.open { opacity: 1; pointer-events: all; }
.modal-box-auth {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: min(440px, 100%); transform: translateY(20px); transition: transform var(--transition);
}
.modal-overlay-auth.open .modal-box-auth { transform: translateY(0); }
.auth-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  color: #fff; padding: 1.75rem 2rem 1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.auth-header-icon {
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.auth-header-text { flex: 1; }
.auth-header-text h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin-bottom: .2rem; }
.auth-header-text p { font-size: .78rem; color: rgba(255,255,255,.55); }
.auth-body { padding: 2rem; }
.auth-notice {
  display: flex; align-items: flex-start; gap: .625rem;
  background: #f0f7f8; border: 1px solid var(--border); border-left: 3px solid var(--teal);
  border-radius: 6px; padding: .875rem 1rem; margin-bottom: 1.5rem;
  font-size: .8rem; color: var(--slate); line-height: 1.55;
}
.auth-notice-icon { font-size: .9rem; flex-shrink: 0; margin-top: .05rem; }
.auth-field { margin-bottom: 1.25rem; }
.auth-field label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); margin-bottom: .5rem; }
.auth-field input {
  width: 100%; padding: .75rem 1rem;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-family: var(--font-body); font-size: .9rem; color: var(--text);
  background: var(--white); transition: border-color var(--transition), box-shadow var(--transition);
}
.auth-field input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(26,107,114,.12); }
.auth-field input::placeholder { color: #b0bec5; }
.auth-submit {
  width: 100%; padding: .85rem 1rem; margin-top: .5rem;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff; border: none; border-radius: 7px;
  font-family: var(--font-body); font-size: .95rem; font-weight: 600;
  cursor: pointer; letter-spacing: .02em;
  transition: opacity var(--transition), transform var(--transition);
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.auth-submit:hover { opacity: .9; transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); }
.auth-footer { padding: 1rem 2rem 1.5rem; text-align: center; font-size: .75rem; color: var(--slate); border-top: 1px solid var(--mist); }

/* ── PAGE SECTIONS (SPA) ─────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb { background: var(--white); border-bottom: 1px solid var(--border); padding: .625rem 0; font-size: .82rem; }
.breadcrumb .container { display: flex; align-items: center; gap: .5rem; }
.breadcrumb a { color: var(--teal); text-decoration: none; }
.breadcrumb span[aria-current] { color: var(--slate); }

/* ── SEARCH & FILTER ─────────────────────────────────────── */
.search-bar {
  max-width: 420px; margin: 0 auto 2.5rem;
  position: relative;
}
.search-bar input {
  width: 100%; padding: .75rem 1rem .75rem 2.75rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: var(--font-body); font-size: .9rem; color: var(--text);
  background: var(--white); transition: border-color var(--transition);
}
.search-bar input:focus { border-color: var(--teal); outline: none; }
.search-bar::before {
  content: '🔍'; position: absolute; left: .875rem; top: 50%; transform: translateY(-50%);
  font-size: .85rem; pointer-events: none;
}

/* ── COOKIE BANNER ───────────────────────────────────────── */
#aft-cookie-banner {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  width: min(700px, calc(100% - 3rem));
  background: var(--navy); color: rgba(255,255,255,.85);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-lg); z-index: 300;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  border-top: 3px solid var(--gold);
}
#aft-cookie-banner p { font-size: .82rem; flex: 1; line-height: 1.6; }
#aft-cookie-banner a { color: var(--gold); }
.cookie-actions { display: flex; gap: .75rem; align-items: center; flex-shrink: 0; }
.cookie-actions a { font-size: .78rem; color: rgba(255,255,255,.55); text-decoration: none; }
#aft-cookie-accept { background: var(--gold); color: var(--navy); border: none; padding: .5rem 1.25rem; border-radius: 6px; font-weight: 700; font-size: .82rem; cursor: pointer; }

/* ── CARTA DEI SERVIZI ───────────────────────────────────── */
.carta-layout { display:grid; grid-template-columns:240px 1fr; gap:2.5rem; align-items:start; }
.carta-sidebar { position:sticky; top:80px; }
.carta-toc { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm); }
.carta-toc-head { background:var(--navy); color:rgba(255,255,255,.9); padding:.75rem 1rem; font-size:.72rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; border-bottom:2px solid var(--gold); }
.carta-toc a { display:block; padding:.6rem 1rem; font-size:.8rem; color:var(--slate); text-decoration:none; border-bottom:1px solid var(--mist); transition:background .2s,color .2s,padding-left .2s; }
.carta-toc a:last-child { border-bottom:none; }
.carta-toc a:hover { background:var(--mist); color:var(--navy); padding-left:1.375rem; }
.carta-toc a.toc-active { background:var(--mist); color:var(--teal); font-weight:600; border-left:3px solid var(--teal); }
.carta-meta { margin-top:1rem; background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:1rem; font-size:.78rem; color:var(--slate); box-shadow:var(--shadow-sm); text-align:center; line-height:1.7; }
.carta-meta strong { color:var(--navy); }
.carta-intro-banner { background:linear-gradient(135deg,var(--navy) 0%,var(--teal) 100%); color:#fff; border-radius:var(--radius); padding:2rem 2.5rem; margin-bottom:1.75rem; border-left:4px solid var(--gold); }
.carta-intro-banner h2 { font-family:var(--font-display); font-size:1.6rem; font-weight:600; margin-bottom:.25rem; letter-spacing:-.01em; }
.carta-intro-banner .sub { font-size:.78rem; color:rgba(255,255,255,.55); letter-spacing:.06em; text-transform:uppercase; margin-bottom:1rem; font-weight:600; }
.carta-intro-banner p { font-size:.92rem; color:rgba(255,255,255,.82); line-height:1.7; }
.carta-block { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); margin-bottom:1.5rem; box-shadow:var(--shadow-sm); overflow:hidden; }
.carta-block-head { display:flex; align-items:center; gap:.875rem; padding:1rem 1.5rem; background:var(--mist); border-bottom:1px solid var(--border); }
.carta-block-icon { width:34px; height:34px; background:var(--navy); border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:.95rem; }
.carta-block-head h3 { font-family:var(--font-display); font-size:1.1rem; font-weight:600; color:var(--navy); }
.carta-block-body { padding:1.5rem; }
.carta-block-body p { font-size:.875rem; color:var(--slate); line-height:1.75; margin-bottom:.875rem; }
.carta-block-body p:last-child { margin-bottom:0; }
.carta-block-body p strong { color:var(--text); }
.carta-block-body p em { font-style:italic; }
.carta-block-body a { color:var(--teal); }
.norma-item { background:var(--mist); border-left:3px solid var(--teal); padding:.875rem 1.125rem; margin-bottom:.75rem; border-radius:0 6px 6px 0; font-size:.85rem; color:var(--slate); line-height:1.7; }
.norma-item:last-child { margin-bottom:0; }
.norma-item strong { color:var(--navy); }
.carta-ul { list-style:none; margin:.5rem 0 .75rem; }
.carta-ul li { position:relative; padding:.625rem .75rem .625rem 1.75rem; font-size:.875rem; color:var(--slate); line-height:1.7; border-bottom:1px solid var(--mist); }
.carta-ul li:last-child { border-bottom:none; }
.carta-ul li::before { content:''; position:absolute; left:.625rem; top:1.05rem; width:5px; height:5px; border-radius:50%; background:var(--teal); }
.carta-ul li em { font-style:italic; }
.carta-ul li strong { color:var(--text); }
.carta-warn { background:#fff8e1; border:1px solid #f5c842; border-radius:8px; padding:.875rem 1.125rem; margin-top:1.25rem; font-size:.85rem; color:#7a5c00; line-height:1.65; }
.carta-warn strong { color:#5a4000; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .carta-layout { grid-template-columns: 1fr; }
  .carta-sidebar { position: static; }
}
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(4,1fr); }
  .stat-box { padding: .875rem; }
  .stat-num { font-size: 1.4rem; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--navy); border-top: 1px solid rgba(255,255,255,.1); padding: 1rem; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: .25rem; }
  .nav-toggle { display: flex; }
  .urgenze-box { flex-direction: column; text-align: center; padding: 2rem 1.5rem; }
  .urgenze-nums { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .medico-info-grid { grid-template-columns: 1fr; }
  .modal-header { padding: 1.25rem 1.5rem; }
  .modal-body { padding: 1.25rem 1.5rem 1.5rem; }
  .container { padding-inline: 1rem; }
  #cont-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .hero-stats { grid-template-columns: repeat(2,1fr); }
  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 3rem 0; }
  .medici-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .875rem; }
}

/* ── MODAL ANNUNCI MEDICO ──────────────────────────────────────── */
/*
 * Il pannello è fixed e si posiziona a destra del modal-box centrato (560px):
 *   left = 50vw + 280px (metà modal) + 16px (gap)
 *   top  = 50vh, centrato verticalmente
 * Su schermi < 1200px il pannello non ha spazio e viene nascosto.
 */
.modal-annunci-panel {
  display: none;
  position: fixed;
  z-index: 201;
  left: calc(50% + 280px + 16px);
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--white);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-annunci-panel.visible { display: block; }
.modal-annunci-hdr {
  padding: 1.1rem 1.25rem .9rem;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
  color: var(--gold); text-align: center;
  border-bottom: 1px solid rgba(201,151,58,.25);
}
.modal-annunci-bdy { padding: 1rem; }
.modal-annuncio-item { margin-bottom: .65rem; }
.modal-annuncio-item:last-child { margin-bottom: 0; }
.modal-annuncio-titolo { font-weight: 600; font-size: .875rem; color: var(--navy); margin-bottom: .3rem; line-height: 1.4; }
.modal-annuncio-testo { font-size: .8rem; color: var(--slate); line-height: 1.6; margin-bottom: .3rem; }
.modal-annuncio-meta { font-size: .7rem; color: var(--slate); }
/* Schermo troppo stretto per avere il pannello a fianco */
@media (max-width: 1199px) { .modal-annunci-panel { display: none !important; } }
