/* ── Font (Plus Jakarta Sans, servito in locale da static/fonts, licenza OFL) ── */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Palette ─────────────────────────────────────────────────────── */
:root {
  --bg:           #f3f5f9;
  --surface:      #ffffff;
  --ink:          #0f172a;
  --muted:        #475569;
  --line:         #e2e8f0;
  --accent:       #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft:  #dbeafe;
  --navy:         #0f172a;
  --navy-2:       #1e293b;
  --alert:        #fb923c;
  --alert-ink:    #431407;
  --amber:        #92400e;
  --radius:       16px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Header (due livelli: strumenti + schede, uguale su ogni pagina) ── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-bar, .app-schede {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.app-bar {
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px 14px;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
}
.app-brand:hover { color: var(--ink); }
.app-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-search {
  flex: 1 1 260px;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}
.app-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.app-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 9px 16px 9px 40px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.app-search input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,78,216,.18); }

.app-nuovo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.app-nuovo:hover, .app-nuovo.active { background: var(--accent-hover); color: #fff; }

.app-icona {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.app-icona:hover, .app-icona.active { color: var(--ink); background: var(--bg); }
.app-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--alert);
  color: var(--alert-ink);
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.app-account { position: relative; flex: none; }
.app-account summary {
  list-style: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.app-account summary::-webkit-details-marker { display: none; }
.app-account.active summary, .app-account[open] summary { box-shadow: 0 0 0 3px var(--accent-soft); }
.app-account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 230px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15,23,42,.16);
  padding: 6px;
  z-index: 10;
}
.app-account-chi {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.app-account-chi span { color: var(--muted); font-size: 12px; }
.app-account-menu a, .app-account-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.app-account-menu a:hover, .app-account-menu button:hover { background: var(--bg); color: var(--ink); }
.app-account-menu form { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.app-account-menu button { color: #b91c1c; }

.app-schede {
  display: flex;
  gap: 4px;
  font-weight: 600;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.app-schede a {
  padding: 13px 14px 11px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  transition: color .12s, border-color .12s;
}
.app-schede a:hover { color: var(--ink); border-bottom-color: var(--line); }
.app-schede a.active { color: var(--accent); border-bottom-color: var(--accent); }
.app-schede-n { color: #9a3412; font-weight: 700; }

/* Percorso (Alfabeto › N › Napoli) */
.percorso { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-weight: 600; margin: 4px 0 10px; }
.percorso a { color: var(--muted); }
.percorso a:hover { color: var(--ink); }
.percorso [aria-current] { color: var(--ink); }

.alert-app { border: 0; border-radius: 14px; }
.alert-info { background: var(--accent-soft); color: #1e3a8a; }

.utenti-nuovo { margin-bottom: 20px; }
.utenti-azioni .form-select { width: auto; }

.app-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px 56px;
}

/* ── Dashboard: hero ─────────────────────────────────────────────── */
.hero {
  background: var(--navy);
  color: #f8fafc;
  border-radius: 20px;
  padding: 20px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  margin-bottom: 28px;
}
.hero-main { flex: 0 1 auto; }
.hero-label {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.hero-totale {
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin-top: 2px;
  white-space: nowrap;
}

/* Le quattro statistiche stanno su una sola riga */
.hero-stats { flex: 1 1 520px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: var(--navy-2);
  border-radius: 14px;
  padding: 10px 14px;
  color: #f8fafc;
}
a.stat:hover { color: #fff; background: #334155; }
.stat-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.stat-lbl { color: #cbd5e1; font-size: 13px; }
.stat-alert, a.stat-alert:hover { background: var(--alert); color: var(--alert-ink); }
.stat-alert .stat-lbl { color: var(--alert-ink); font-weight: 600; }
a.stat-alert:hover { filter: brightness(1.05); }

/* ── Dashboard: sezioni ──────────────────────────────────────────── */
.dash-section { margin-bottom: 28px; }
.dash-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.dash-head h2, .panel h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.dash-head span { color: var(--muted); }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.tile {
  --t-bg: #e2e8f0; --t-fg: #1e293b;
  background: var(--t-bg);
  color: var(--t-fg);
  border-radius: 18px;
  padding: 18px 20px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .12s, box-shadow .12s;
}
.tile:hover { color: var(--t-fg); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.tile-nome { font-size: 15px; font-weight: 700; }
.tile-foot { display: flex; align-items: baseline; justify-content: space-between; }
.tile-num { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.tile-pct { font-size: 13px; font-weight: 600; opacity: .85; }

/* Colori per categoria (tile e pallino nella pagina del tag) */
[data-tema="geografia"], [data-tema="città"] { --t-bg: #dbeafe; --t-fg: #1e3a8a; }
[data-tema="diritto"], [data-tema="politica"] { --t-bg: #ede9fe; --t-fg: #4c1d95; }
[data-tema="storia"]     { --t-bg: #ffedd5; --t-fg: #7c2d12; }
[data-tema="arte"]       { --t-bg: #fce7f3; --t-fg: #831843; }
[data-tema="religione"]  { --t-bg: #fef3c7; --t-fg: #78350f; }
[data-tema="matematica"] { --t-bg: #ccfbf1; --t-fg: #134e4a; }
[data-tema="cibo"]       { --t-bg: #dcfce7; --t-fg: #14532d; }

.dash-row { display: flex; flex-wrap: wrap; gap: 20px; }
.panel {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 24px;
}
.panel h2 { font-size: 16px; margin-bottom: 16px; }
.panel-gram { flex: 1 1 340px; }
.panel-alfabeto { flex: 2 1 480px; min-width: 0; }

.barre { display: flex; flex-direction: column; gap: 14px; }
.barra { color: var(--ink); }
.barra:hover { color: var(--accent); }
.barra-lbl { display: flex; justify-content: space-between; font-weight: 600; }
.barra-track { display: block; height: 10px; background: var(--line); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.barra-track span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.alfabeto { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.lettera { border-radius: 12px; padding: 8px 0; text-align: center; transition: transform .12s; }
a.lettera:hover { transform: translateY(-2px); }
.lettera-l { display: block; font-weight: 800; font-size: 16px; }
.lettera-n { display: block; font-size: 11px; font-weight: 600; }
.lettera-alto,  a.lettera-alto:hover  { background: var(--accent); color: #fff; }
.lettera-medio, a.lettera-medio:hover { background: #bfdbfe; color: #1e3a8a; }
.lettera-basso, a.lettera-basso:hover { background: #e8f0ff; color: #1e3a8a; }
.lettera-vuota { background: #f1f5f9; color: #64748b; }

/* ── Pagine elenco ───────────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 8px 0 18px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.page-head span { color: var(--muted); }
.tag-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--t-fg, var(--accent)); }

.back-link { display: inline-block; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.back-link:hover { color: var(--ink); }

.lettera-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border-radius: 14px;
  margin-bottom: 20px;
}
.lettera-btn {
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 .5rem;
  font-size: 13px;
  font-weight: 700;
  border-radius: 9px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
.lettera-btn:hover { background: var(--bg); color: var(--ink); }
.lettera-btn.active { background: var(--accent); color: #fff; }
.lettera-btn.disabled { opacity: .35; pointer-events: none; }

.griglia-segni {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.card-segno {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 76px;
  color: var(--ink);
  overflow: hidden;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.card-segno:hover {
  color: var(--ink);
  border-color: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15,23,42,.07);
}
.card-segno-nome { font-weight: 700; font-size: 15px; }
.card-segno-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Dettaglio / esercizio ───────────────────────────────────────── */
.titolo-segno { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.video-segno, #segno-video {
  width: 100%;
  max-height: 520px;
  background: #000;
  border-radius: var(--radius);
}

.video-dettaglio { max-height: 80vh; }
.video-azioni { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.video-tagliato {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  padding: 3px 10px;
  border-radius: 99px;
}
@media (min-width: 992px) {
  .col-dettaglio-video { flex: 0 0 auto; width: 70%; }
  .col-dettaglio-info  { flex: 0 0 auto; width: 30%; }
}

/* ── Nuovo segno: registrazione ──────────────────────────────────── */
.recorder {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  background: var(--navy);
  border-radius: 12px;
  overflow: hidden;
}
.recorder-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.recorder-video[hidden] { display: none; }
.recorder-live { transform: scaleX(-1); }   /* anteprima a specchio, la registrazione no */
.recorder-vuoto {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #94a3b8;
  font-weight: 600;
  text-align: center;
  padding: 16px;
}
.recorder-vuoto[hidden] { display: none; }
.recorder-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  font-weight: 800;
  color: #fff;
  background: rgba(15,23,42,.35);
}
.recorder-countdown[hidden] { display: none; }
.recorder-timer {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15,23,42,.75);
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.recorder-timer[hidden] { display: none; }
.recorder-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: lampeggia 1s infinite; }
@keyframes lampeggia { 50% { opacity: .3; } }
.recorder-azioni { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.recorder-azioni .form-select { width: auto; max-width: 260px; }
.recorder-file { color: var(--accent); font-weight: 600; text-decoration: none; }
.recorder-file:focus-within { outline: 2px solid var(--accent); }

/* ── Taglio video (static/taglio.js) ─────────────────────────────── */
.taglio-slider { position: relative; height: 36px; }
.taglio-track {
  position: absolute;
  left: 0; right: 0; top: 12px;
  height: 12px;
  background: var(--line);
  border-radius: 99px;
}
.taglio-sel { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 99px; opacity: .85; }
.taglio-pos { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; }
.taglio-slider input[type=range] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.taglio-slider input[type=range]::-webkit-slider-runnable-track { background: none; height: 36px; }
.taglio-slider input[type=range]::-moz-range-track { background: none; }
.taglio-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 18px; height: 30px; margin-top: 3px;
  border-radius: 6px;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(15,23,42,.25);
  cursor: ew-resize;
}
.taglio-slider input[type=range]::-moz-range-thumb {
  pointer-events: auto;
  width: 14px; height: 26px;
  border-radius: 6px;
  background: var(--surface);
  border: 2px solid var(--accent);
  cursor: ew-resize;
}
.taglio-slider input[type=range]:focus-visible::-webkit-slider-thumb { outline: 3px solid rgba(29,78,216,.35); }
.taglio-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.taglio-testo { font-weight: 600; font-variant-numeric: tabular-nums; }

.btn-tag {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--bg);
  --bs-btn-hover-border-color: #cbd5e1;
  border-radius: 999px;
}
.btn-check:checked + .btn-tag { background: var(--accent-soft); border-color: var(--accent-soft); color: #1e3a8a; }
.btn-check:checked + .btn-tag[data-tema] {
  background: var(--t-bg, #e2e8f0);
  border-color: var(--t-bg, #e2e8f0);
  color: var(--t-fg, #1e293b);
}

.btn-danger {
  --bs-btn-bg: #dc2626;
  --bs-btn-border-color: #dc2626;
  --bs-btn-hover-bg: #b91c1c;
  --bs-btn-hover-border-color: #b91c1c;
}

.card {
  border: 0 !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}
.card-body { padding: 20px 22px; }

/* ── Cestino ─────────────────────────────────────────────────────── */
.alert-cestino { background: #ffedd5; color: #7c2d12; border: 0; border-radius: 14px; }
.alert-cestino a { color: #7c2d12; font-weight: 700; text-decoration: underline; }
.cestino-lista { display: flex; flex-direction: column; gap: 8px; }
.cestino-riga {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 16px;
}
.cestino-nome { font-weight: 700; font-size: 15px; color: var(--ink); }
.cestino-info { color: var(--muted); font-size: 13px; }
.cestino-azioni { display: flex; gap: 8px; margin-left: auto; }
.btn-outline-danger {
  --bs-btn-color: #b91c1c;
  --bs-btn-border-color: #fecaca;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #dc2626;
  --bs-btn-hover-border-color: #dc2626;
}

/* ── Badge ───────────────────────────────────────────────────────── */
.badge { font-weight: 600; }
.badge.bg-primary   { background-color: var(--accent-soft) !important; color: #1e3a8a !important; }
.badge.bg-primary a { color: #1e3a8a; }
.badge.bg-secondary { background-color: #f1f5f9 !important; color: #334155 !important; }
.badge.bg-secondary a { color: #334155; }
.badge.bg-info      { background-color: #dcfce7 !important; color: #14532d !important; }
.badge.bg-warning, .badge.bg-warning.text-dark { background-color: #fef3c7 !important; color: var(--amber) !important; }
.badge.bg-danger    { background-color: #ffedd5 !important; color: #9a3412 !important; }
.badge.bg-light     { background-color: rgba(255,255,255,.8) !important; color: var(--muted) !important; }
.card-segno .badge  { font-size: .65rem; vertical-align: middle; }

/* ── Pulsanti ────────────────────────────────────────────────────── */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-bg: var(--accent-hover);
  --bs-btn-active-border-color: var(--accent-hover);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
}
.btn-outline-secondary {
  --bs-btn-color: var(--ink);
  --bs-btn-bg: var(--surface);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: var(--bg);
  --bs-btn-hover-border-color: #cbd5e1;
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-bg: var(--bg);
}
.btn-outline-info {
  --bs-btn-color: #14532d;
  --bs-btn-border-color: #bbf7d0;
  --bs-btn-hover-color: #14532d;
  --bs-btn-hover-bg: #dcfce7;
  --bs-btn-hover-border-color: #86efac;
  --bs-btn-active-color: #14532d;
  --bs-btn-active-bg: #dcfce7;
}
.btn-warning, .btn-outline-warning {
  --bs-btn-bg: #fef3c7;
  --bs-btn-color: var(--amber);
  --bs-btn-border-color: #fcd34d;
  --bs-btn-hover-bg: #fde68a;
  --bs-btn-hover-color: var(--amber);
  --bs-btn-hover-border-color: #f59e0b;
  --bs-btn-active-color: var(--amber);
  --bs-btn-active-bg: #fde68a;
}
.btn-outline-warning { --bs-btn-bg: transparent; }

/* ── Form ────────────────────────────────────────────────────────── */
.form-control, .form-select { border-color: var(--line); border-radius: 10px; }
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,.18);
}
.list-group { border-radius: 12px; }

/* ── Misc ────────────────────────────────────────────────────────── */
.text-muted { color: var(--muted) !important; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Login ───────────────────────────────────────────────────────── */
.login-box {
  max-width: 380px;
  margin: 12vh auto 0;
  padding: 32px 28px;
  background: var(--surface);
  border-radius: 20px;
  text-align: center;
}
.login-box h1 { font-size: 22px; font-weight: 800; }
.login-box .back-link { margin-bottom: 0; }
.app-main .account-box { max-width: 440px; background: var(--surface); border-radius: 20px; padding: 28px; }
.app-main .account-box h1 { font-size: 22px; font-weight: 800; }
.auth-form { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-top: 16px; }
.auth-form .form-label { font-weight: 600; margin: 8px 0 0; }
.auth-form .btn { margin-top: 14px; padding: 10px; }
.input-codice {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.requisiti { list-style: none; padding: 0; margin: 6px 0 4px; font-size: 13px; color: var(--muted); }
.requisiti li { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.requisiti li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
}
.requisiti li.ok { color: #166534; }
.requisiti li.ok::before { background: #16a34a; border-color: #16a34a; box-shadow: inset 0 0 0 2px #fff; }
.auth-passi { text-align: left; color: var(--muted); padding-left: 20px; }
.qr-mfa { display: flex; justify-content: center; }
.qr-mfa svg { width: 200px; height: 200px; }
.segreto-mfa { margin-top: 8px; word-spacing: .2em; }
.segreto-mfa code { color: var(--ink); font-size: 14px; }

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .app-bar { flex-wrap: wrap; padding-left: 16px; padding-right: 10px; }
  .app-brand { margin-right: auto; }
  .app-search { order: 5; flex-basis: 100%; max-width: none; margin-right: 6px; }
  .app-schede { padding-left: 8px; padding-right: 8px; }
  /* "Nuovo segno" diventa un pulsante flottante */
  .app-nuovo {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 90;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 18px;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(29,78,216,.4);
  }
  .app-nuovo svg { width: 24px; height: 24px; }
  .app-nuovo span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .app-main { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 18px 18px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .griglia-segni { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
