/* MiPropongo: pagine del sito (home, elenco, note). Stessi colori e caratteri del simulatore. */
:root {
  --bg: #f1f3f6; --surface: #ffffff; --surface2: #f6f7f9; --ink: #141a22; --muted: #566171; --line: #d6dbe3;
  --map: #e7ebf0; --accent: #d1156c; --accent-soft: #fbe2ee; --on-accent: #ffffff; --warn-bg: #fff4dc; --warn-ink: #6b4300;
  --m1: #e3000f; --m2: #12984a; --m3: #e8b800; --m4: #1d4f9f; --m5: #8e44a3; --fsline: #6b7380;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --text: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1116; --surface: #151b23; --surface2: #1a212b; --ink: #e8ecf1; --muted: #98a3b3; --line: #29323f;
    --map: #0f151c; --accent: #ff5aa8; --accent-soft: #3a1829; --on-accent: #1b0611; --warn-bg: #33270d; --warn-ink: #f0cf8a;
    --m3: #ffd42e; --m4: #5b8fe6; --m5: #b878cf; --fsline: #8b93a0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--text); }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; text-wrap: balance; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)); }
.muted { color: var(--muted); } .small { font-size: 13.5px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { min-height: 50px; padding: 10px 22px; font-size: 17px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* intestazione */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-weight: 700; font-size: 25px; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.logo .lm { color: var(--on-accent); background: var(--accent); border-radius: 7px; padding: 0 5px; margin-right: 2px; }
.top nav { display: flex; gap: 18px; margin-right: auto; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }

/* home */
.hero { padding: 48px 0 28px; max-width: 760px; }
.hero h1 { font-size: clamp(40px, 7vw, 64px); font-weight: 700; }
.lead { font-size: 19px; color: var(--muted); margin: 14px 0 22px; }
section { margin-bottom: 40px; }
.sh { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin: 28px 0 16px; }
.sh h2 { font-size: 30px; } .sh h1 { font-size: 40px; }
.sh .seg { margin: 0; display: flex; gap: 6px; align-items: center; color: var(--muted); }
.sh .seg a { text-decoration: none; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.sh .seg a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; }

/* schede */
.cards { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; position: relative; transition: border-color .12s, box-shadow .12s; }
.card:hover { border-color: var(--muted); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.cl { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.mini { display: block; width: 100%; aspect-ratio: 1.6; background: var(--map); border-bottom: 1px solid var(--line); }
.mini polyline, .mini polygon { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.mini #rete polyline, .mini use { stroke-width: 1.4; opacity: .55; }
.mini .m6 { stroke: var(--accent); stroke-width: 3.5; }
.mini .st circle { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
#rete polyline { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
#rete .r-m1 { stroke: var(--m1); } #rete .r-m2 { stroke: var(--m2); } #rete .r-m3 { stroke: var(--m3); }
#rete .r-m4 { stroke: var(--m4); } #rete .r-m5 { stroke: var(--m5); } #rete .r-fs { stroke: var(--fsline); stroke-dasharray: 4 3; }
.pos { position: absolute; top: 10px; left: 10px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: 700 16px/28px var(--display); text-align: center; }
.cb { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cb h3 { font-size: 21px; }
.ck { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 4px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); }
.ck div { text-align: center; } .ck dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ck dd { margin: 0; font: 700 18px/1.2 var(--display); } .ck small { font: 500 11px var(--text); color: var(--muted); }
.cv { margin: auto 0 0; padding-top: 6px; color: var(--muted); } .cv b { color: var(--accent); font: 700 20px var(--display); }
.pag { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 8px 0 24px; }
.pag a:last-child { justify-self: end; }

/* note */
.prose { max-width: 720px; padding: 36px 0; }
.prose h1 { font-size: 40px; margin-bottom: 16px; }
.prose li { margin: 8px 0; }
.prose h2 { font-size: 26px; margin: 28px 0 8px; }
mark { background: var(--warn-bg); color: var(--warn-ink); padding: 0 4px; border-radius: 4px; }
.warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 12px 14px; }

/* piè di pagina */
.foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; padding: 18px 0; margin-top: 24px; }
.foot p { margin: 4px 0; } .foot a { color: inherit; }

@media (max-width: 720px) {
  .top .wrap { gap: 8px 14px; padding-top: 8px; padding-bottom: 8px; }
  .top nav { order: 3; width: 100%; gap: 16px; overflow-x: auto; }
  .top .btn { margin-left: auto; min-height: 38px; padding: 6px 12px; font-size: 14px; }
  .hero { padding-top: 28px; } .lead { font-size: 17px; }
}

/* pannello di moderazione */
.admin .top .wrap { gap: 14px; } .admin .esci { margin-left: auto; }
.login { max-width: 360px; margin: 12vh auto; display: flex; flex-direction: column; gap: 10px; }
.login h1 { font-size: 34px; } .login input { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); color: var(--ink); font: inherit; }
.atabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0 16px; }
.atabs a { text-decoration: none; color: var(--ink); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; }
.atabs a span { color: var(--muted); margin-left: 4px; }
.atabs a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } .atabs a[aria-current] span { color: inherit; }
.ok { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; }
.alist { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 12px; }
.arow { display: grid; grid-template-columns: 240px minmax(0, 1fr) auto; gap: 16px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.arow .mini { border-radius: 8px; border: 1px solid var(--line); }
.ainfo h3 { font-size: 22px; } .ainfo h3 a { color: inherit; } .ainfo p { margin: 6px 0; }
.ainfo .ck { grid-template-columns: repeat(5, minmax(0, 90px)); justify-content: start; }
.aact { display: flex; flex-direction: column; gap: 8px; } .aact form { margin: 0; } .aact .btn { width: 100%; justify-content: center; }
.tag { font: 600 12px var(--text); background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
@media (max-width: 760px) { .arow { grid-template-columns: 1fr; } .aact { flex-direction: row; } .ainfo .ck { grid-template-columns: repeat(5, 1fr); } }

/* finestra di conferma del pannello */
.adlg { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; max-width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.adlg::backdrop { background: rgba(10, 16, 24, .38); }
.adlg h2 { font-size: 24px; } .adlg p { margin: 10px 0 16px; }

/* confronto: casella sulle schede, barra in basso, pagina di confronto */
.card .cmp { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.card .cmp input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.card .cmp:has(input:disabled) { opacity: .5; cursor: default; }
.card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.cmpbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.12); padding: 10px 0 max(10px, env(safe-area-inset-bottom, 0px)); }
.cmpbar .wrap { display: flex; align-items: center; gap: 10px; }
.cmpbar .cn { margin-right: auto; } .cmpbar .cn b { color: var(--accent); font: 700 20px var(--display); }
.cmpbar .btn.off { opacity: .45; pointer-events: none; }
body.has-cmpbar { padding-bottom: 72px; }
.cmpw .sh h1 { font-size: 40px; }
.cmpmap { display: block; width: 100%; aspect-ratio: 1.6; background: var(--map); border: 1px solid var(--line); border-radius: 14px; }
.cmpmap .cmpl { fill: none; stroke-width: 4; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.cmpmap .cmps { fill: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.cmpmap use { opacity: .5; }
.tblx { overflow-x: auto; margin: 16px 0 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cmpt tbody tr:last-child th, .cmpt tbody tr:last-child td { border-bottom: 0; }
.cmpt { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); font-variant-numeric: tabular-nums; }
.cmpt th, .cmpt td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.cmpt thead th { text-align: left; font: 600 18px/1.2 var(--display); min-width: 150px; }
.cmpt thead th a { color: var(--ink); text-decoration: none; } .cmpt thead th small { display: block; font: 400 12.5px var(--text); color: var(--muted); margin-top: 3px; }
.cmpt thead th small a { color: var(--accent); }
.cmpt .sw { display: block; width: 36px; height: 10px; margin-bottom: 6px; } .cmpt .sw line { stroke-width: 4; stroke-linecap: round; }
.cmpt tbody th { text-align: left; font-weight: 500; } .cmpt tbody th small { color: var(--muted); font-weight: 400; }
.cmpt td.best { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.cmph { font-size: 24px; margin: 24px 0 6px; }
.cmpt tbody th, .cmpt thead td { position: sticky; left: 0; background: var(--surface); z-index: 1; }
@media (max-width: 720px) {
  .cmpt { font-size: 14px; }
  .cmpt th, .cmpt td { padding: 8px 9px; }
  .cmpt tbody th { min-width: 108px; max-width: 120px; font-size: 13px; box-shadow: 1px 0 0 var(--line); }
  .cmpt thead th { min-width: 120px; font-size: 16px; }
  .cmpbar .cn { font-size: 14px; }
}
/* su computer (con mouse) la casella «Confronta» compare passando sulla scheda; resta visibile se è selezionata
   o se ha il focus da tastiera. Sui touch screen resta sempre visibile. */
@media (hover: hover) and (pointer: fine) {
  .card .cmp { opacity: 0; transition: opacity .12s; }
  .card:hover .cmp, .card .cmp:focus-within, .card.picked .cmp, body.has-cmpbar .card .cmp { opacity: 1; }
}
