@charset "UTF-8";
/* =====================================================================
   1SHOT PROJECT · PANNELLO DISCORD — tema "Varco" (lo stesso di STORIES e SCUOLA)
   Viola #8840B8 + bianco, fondo notte, angoli vivi, portali come decoro.
   Font locali (OFL): Cinzel (titoli), Barlow (testo), JetBrains Mono (etichette).
   Lo stile precedente (inline in index.js) è in backup-stile/.
   ===================================================================== */

@font-face { font-family: "Cinzel"; src: url("fonts/Cinzel-variabile.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-600.woff2") format("woff2"); font-weight: 600 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-variabile.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
/* In Cinzel l'"1" sembra una "I": nei titoli le cifre vengono da Barlow. */
@font-face { font-family: "Cifre"; src: url("fonts/Barlow-600.woff2") format("woff2"); font-weight: 400 900; unicode-range: U+0030-0039; font-display: swap; }

:root {
  --bg: #0d0a12;
  --bg-2: #0a0810;
  --bg-3: #17121f;
  --bg-4: #1e1729;
  --line: #2b2236;
  --line-v: rgba(136,64,184,.32);
  --text: #f2eff6;
  --text-body: #d9d3e3;
  --text-dim: #b3abc0;
  --muted: #8f87a0;
  --accent: #8840B8;
  --accent-hover: #9a52cc;
  --accent-2: #c79bea;
  --accent-3: #e0c6f5;
  --accent-soft: rgba(136,64,184,.16);
  --glow: 0 0 34px rgba(136,64,184,.45);
  --danger: #e06a6a;
  --ok: #5fd68a;
  --radius: 2px;
  --f-title: "Cifre", "Cinzel", Georgia, serif;
  --f-text: "Barlow", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); overflow-x: hidden; } /* così il clip di body non viene propagato alla finestra */
body {
  margin: 0; color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  position: relative; overflow-x: clip; /* il portale sborda a destra: lo taglio al bordo della finestra */
  font-family: var(--f-text); font-size: 16px; font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); text-decoration: none; text-underline-offset: 4px; }
a:hover { color: #fff; }
p { line-height: 1.6; margin: 0 0 12px; }
h1, h2, h3 { margin: 0; line-height: 1.15; color: #fff; font-family: var(--f-title); font-weight: 700; }
b, strong { color: #fff; font-weight: 600; }
::selection { background: rgba(136,64,184,.45); color: #fff; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

/* etichette in maiuscoletto monospazio: il segno di riconoscimento del tema */
.eyebrow, .who, label.lbl, .badge, .pill, th, .ms-count, .card-tag, footer > span {
  font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .18em; font-weight: 500;
}

/* ---------- barra in alto ---------- */
.header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 64px; padding: 0 max(32px, calc((100vw - 1100px) / 2));
  background: var(--bg); border-bottom: 1px solid var(--line-v);
}
.brand { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.brand-1 { font-family: var(--f-title); font-weight: 700; font-size: 19px; letter-spacing: .06em; color: #fff; text-shadow: 0 0 18px rgba(136,64,184,.7); }
.brand-2 { font-family: var(--f-mono); font-size: 11px; letter-spacing: .3em; color: var(--accent-2); }
.brand:hover .brand-1 { text-shadow: 0 0 22px rgba(199,155,234,.9); }
.header nav { display: flex; gap: 6px; align-items: center; }
.nav-link {
  padding: 8px 14px; text-decoration: none; white-space: nowrap;
  font-size: 12.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid transparent; border-radius: var(--radius);
  transition: border-color .15s, background .15s, color .15s;
}
.nav-link:hover { border-color: var(--line-v); background: var(--accent-soft); color: #fff; }
.nav-link.active { color: #fff; border-color: var(--accent); background: var(--accent-soft); }
.nav-link.logout { color: #f0a0a0; }
.nav-link.logout:hover { border-color: rgba(224,106,106,.45); background: rgba(224,106,106,.12); color: #fff; }
.who { font-size: 11px; letter-spacing: .14em; color: var(--accent-2); margin-right: 8px; white-space: nowrap; }

/* ---------- impaginazione ---------- */
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 44px 32px 20px; position: relative; }
/* portale decorativo dietro l'intestazione */
body::before {
  content: ""; position: absolute; top: -130px; right: -160px; width: 560px; height: 560px; border-radius: 50%;
  border: 1px solid rgba(136,64,184,.38); box-shadow: inset 0 0 0 50px rgba(136,64,184,.03), 0 0 0 50px rgba(255,255,255,.015);
  background: radial-gradient(circle, rgba(136,64,184,.22) 0%, rgba(13,10,18,0) 65%);
  pointer-events: none; z-index: -1;
}
.page-heading { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line-v); }
.eyebrow { font-size: 11px; letter-spacing: .28em; color: var(--accent-2); margin: 0 0 10px; }
.page-heading h1 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.05; margin-bottom: 10px; }
.page-heading p:last-child { color: var(--text-dim); font-size: 16px; margin: 0; }

/* ---------- riquadri ---------- */
.card {
  position: relative; background: var(--bg-2); border: 1px solid var(--line-v); border-radius: var(--radius);
  padding: 24px 26px; margin: 0 0 18px;
}
.card h2 { font-size: 21px; margin-bottom: 14px; }
.card.focus { background: rgba(10,8,16,.92); border-color: var(--accent); box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 26px rgba(136,64,184,.2); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* schede della home, col "dorso del volume" come le campagne di Stories */
.tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px;
  padding: 24px 24px 22px 34px; min-height: 170px; text-decoration: none; color: var(--text);
  background: linear-gradient(140deg, #1d1229 0%, #120d19 62%);
  border: 1px solid var(--line-v); border-radius: var(--radius);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px;
  background: linear-gradient(90deg, rgba(136,64,184,.9), rgba(136,64,184,.15));
}
.tile:hover { color: var(--text); border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 26px rgba(136,64,184,.25); }
.card-tag { font-size: 10.5px; letter-spacing: .22em; color: var(--accent-2); }
.tile h2 { font-size: 22px; }
.tile p { color: var(--text-dim); font-size: 14.5px; margin: 0; }
.tile .go { margin-top: auto; font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-2); }
.tile:hover .go { color: #fff; }

/* ---------- accesso (portale centrale, come Stories) ---------- */
body.login::before { display: none; }
body.login main { display: flex; align-items: center; justify-content: center; max-width: none; padding: 24px 16px; overflow: hidden;
  background: radial-gradient(70% 60% at 50% 45%, rgba(136,64,184,.30) 0%, rgba(13,10,18,0) 70%); }
body.login main::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(136,64,184,0) 0deg, rgba(136,64,184,.75) 90deg, rgba(255,255,255,.55) 150deg, rgba(136,64,184,.75) 220deg, rgba(136,64,184,0) 360deg);
  filter: blur(30px); opacity: .55; animation: varco 40s linear infinite;
}
body.login main::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(255,255,255,.22); box-shadow: inset 0 0 90px rgba(136,64,184,.45), 0 0 0 60px rgba(136,64,184,.05);
}
@keyframes varco { to { transform: rotate(360deg); } }
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 390px;
  background: rgba(10,8,16,.92); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 34px 30px 30px; box-shadow: 0 30px 80px rgba(0,0,0,.6), var(--glow);
}
.login-card .brand { margin-bottom: 28px; }
.login-card .brand-1 { font-size: 24px; }
.login-card h1 { font-size: 30px; margin-bottom: 6px; }
.login-card .muted { margin-bottom: 0; }
.login-card .btn { width: 100%; margin-top: 24px; padding: 13px 14px; text-align: center; }

/* ---------- bottoni ---------- */
.btn {
  display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; text-decoration: none;
  font-family: var(--f-text); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 0 22px rgba(136,64,184,.35);
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; box-shadow: var(--glow); }
.btn.ghost { background: transparent; border-color: var(--line-v); color: var(--text); font-weight: 500; box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.btn.danger { background: transparent; border-color: rgba(224,106,106,.45); color: #f0a0a0; font-weight: 500; box-shadow: none; }
.btn.danger:hover { border-color: var(--danger); background: rgba(224,106,106,.12); color: #fff; }
.btn.mini { padding: 6px 11px; font-size: 11px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- moduli ---------- */
label.lbl { display: block; margin: 22px 0 8px; font-size: 10.5px; color: var(--accent-2); }
label.lbl:first-of-type { margin-top: 0; }
input[type=text], input:not([type]), textarea, select {
  width: 100%; padding: 11px 13px; margin: 0;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); outline: none; color: var(--text); font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input:not([type]):focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,64,184,.18); outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 34px; background: var(--bg-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23c79bea' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 13px center; }
select option { background: var(--bg-3); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; flex: none; }

/* scelta dei destinatari: opzioni a riquadro con rombo, come la Scuola */
.radio {
  display: flex; gap: 12px; align-items: center; margin: 14px 0 8px; padding: 12px 13px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-3);
  font-size: 15px; font-weight: 600; transition: background .15s, border-color .15s;
}
.radio:hover { border-color: var(--line-v); }
.radio:has(input:checked) { background: linear-gradient(140deg, #2a1640 0%, #1a1124 70%); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.radio label { cursor: pointer; flex: 1; }

.ms { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--bg-2); }
.ms-list { max-height: 260px; overflow: auto; margin-top: 10px; border-top: 1px solid var(--line-v); padding-top: 6px; }
.ms-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-left: 2px solid transparent; cursor: pointer; font-size: 14.5px; transition: background .15s; }
.ms-item:hover { background: rgba(136,64,184,.07); }
.ms-item:has(input:checked) { background: var(--accent-soft); border-left-color: var(--accent); }
.ms-item small { color: var(--muted); margin-left: auto; font-family: var(--f-mono); font-size: 11.5px; }
.ms-tools { display: flex; gap: 14px; align-items: center; margin-top: 10px; font-size: 13px; }
.ms-tools a { cursor: pointer; }
.ms-count { color: var(--muted); font-size: 10.5px; margin-left: auto; }

.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.toolbar button {
  background: var(--bg-4); border: 1px solid var(--line); color: var(--text-dim); border-radius: var(--radius);
  padding: 6px 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; transition: background .15s, color .15s, border-color .15s;
}
.toolbar button:hover { background: #2a2038; border-color: var(--line-v); color: #fff; }
.inline { display: flex; gap: 8px; align-items: flex-end; }
.inline > div { flex: 1; }
.inline + .inline { margin-top: 8px; }

/* note in fondo ai moduli */
.note { margin: 18px 0 0; padding: 13px 18px; border-left: 2px solid var(--accent); font-size: 14px; color: var(--text-body);
  background: linear-gradient(90deg, rgba(136,64,184,.12), rgba(136,64,184,.03) 70%); }
.note.warn { border-left-color: var(--danger); background: linear-gradient(90deg, rgba(224,106,106,.1), rgba(224,106,106,.02) 70%); }
.note + .note { margin-top: 8px; }

/* ---------- tabelle ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
th { font-size: 10.5px; color: var(--accent-2); border-bottom-color: var(--line-v); white-space: nowrap; user-select: none; }
th[data-sort]:hover { color: #fff; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(136,64,184,.07); }
td.mono { font-family: var(--f-mono); font-size: 12.5px; color: var(--text-dim); }
td.row-actions { text-align: right; white-space: nowrap; }
td.row-actions > * { display: inline-block; vertical-align: middle; margin: 2px 0 2px 6px; }
.pill, .badge {
  display: inline-block; padding: 3px 8px; border-radius: var(--radius); font-size: 10px; letter-spacing: .12em;
  color: var(--accent-3); background: var(--accent-soft); border: 1px solid rgba(136,64,184,.55);
}
.pill.on { color: var(--ok); background: rgba(95,214,138,.08); border-color: rgba(95,214,138,.4); }
.pill.off { color: #f0a0a0; background: rgba(224,106,106,.08); border-color: rgba(224,106,106,.4); }

/* ---------- testi ---------- */
.muted { color: var(--muted); font-size: 14px; }
.ok { color: var(--ok); }
.err { color: var(--danger); }
.search { margin-bottom: 14px; }

/* ---------- piede ---------- */
footer {
  width: 100%; max-width: 1036px; margin: 30px auto 0; padding: 26px 0 32px;
  border-top: 1px solid var(--line-v);
  display: flex; align-items: center; gap: 24px; justify-content: space-between;
  font-size: 12.5px; color: var(--muted);
}
.footer-brand { font-family: var(--f-title); font-size: 18px; font-weight: 700; letter-spacing: .06em; color: #fff; text-shadow: 0 0 18px rgba(136,64,184,.7); }
.footer-brand > span { font-family: var(--f-mono); font-size: 10.5px; font-weight: 400; letter-spacing: .3em; margin-left: 10px; color: var(--accent-2); text-shadow: none; }
footer > span { font-size: 10.5px; letter-spacing: .16em; }
body.login footer { display: none; }

/* ---------- schermi ---------- */
@media (max-width: 800px) {
  .header { flex-wrap: wrap; padding: 10px 22px; gap: 8px 18px; min-height: 0; }
  .header nav { order: 2; width: 100%; overflow-x: auto; }
  .nav-link { flex: 1; text-align: center; font-size: 11px; letter-spacing: .1em; padding: 8px 6px; }
  .who { display: none; }
  main { padding: 30px 22px 16px; }
  body::before { width: 380px; height: 380px; top: -110px; right: -170px; }
  .card { padding: 20px 18px; }
  footer { margin: 20px 22px 0; width: auto; flex-wrap: wrap; gap: 12px; }
  body.login main::before { width: 460px; height: 460px; margin: -230px 0 0 -230px; }
  body.login main::after { width: 380px; height: 380px; margin: -190px 0 0 -190px; }
}
@media (max-width: 480px) {
  main { padding: 26px 16px 12px; }
  .header { padding: 10px 16px; }
  .inline { flex-direction: column; align-items: stretch; }
  td.row-actions { white-space: normal; }
  footer { margin: 20px 16px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
