/* GC Security Service — design system condiviso (sito, area staff, pannello admin) */
@import url("https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;800;900&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap");

:root {
  --ink: #0b1220;
  --ink-2: #111a2c;
  --ink-3: #18243a;
  --line: #243149;
  --line-soft: rgba(255, 255, 255, 0.07);
  --paper: #f3efe7;
  --paper-2: #e7e1d5;
  --muted: #8d98ab;
  --text: #e9edf3;
  --signal: #d9452f;
  --signal-2: #b8361f;
  --brass: #c9a45c;
  --ok: #3fae7a;
  --wa: #25d366;
  --radius: 14px;
  --radius-lg: 22px;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --bar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  background: var(--ink);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* grana fissa, non interattiva */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- marchio ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; display: block; flex-shrink: 0;
  border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 0.08em; }
.brand-text span { font-size: 9px; letter-spacing: 0.32em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 20px;
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.2s ease, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-signal { background: var(--signal); color: #fff; }
.btn-signal:hover { background: var(--signal-2); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: #fff; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.btn-wa { background: var(--wa); color: #0b2b18; }
.btn-danger { background: rgba(217, 69, 47, 0.12); color: #ff8a77; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--ink-3); color: var(--text); position: relative;
}
.icon-btn svg { width: 20px; height: 20px; }
.dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 2px var(--ink-3); }

/* ---------- form ---------- */
.field { display: block; }
.field > span { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; font-size: 16px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.18); }
.input[readonly] { opacity: 0.6; }
.input.code { font-family: var(--mono); letter-spacing: 0.3em; text-transform: uppercase; }
textarea.input { resize: vertical; min-height: 80px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: grid; gap: 14px; }
.form-error { color: #ff8a77; font-size: 13px; font-weight: 600; margin: 0; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }

/* ---------- bottom bar stile TikTok ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--bar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(11, 18, 32, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; padding: 6px 0; text-decoration: none;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted);
  transition: color 0.2s;
}
.tab svg { width: 24px; height: 24px; transition: transform 0.2s; }
.tab.active { color: var(--text); }
.tab.active svg { transform: translateY(-1px); }
.tab:active svg { transform: scale(0.88); }
/* pulsante centrale "+" a doppio colore come TikTok */
.tab-plus { display: grid; place-items: center; background: none; border: 0; padding: 0; text-decoration: none; }
.tab-plus i {
  position: relative; width: 52px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  box-shadow: -4px 0 0 var(--brass), 4px 0 0 var(--signal);
  transition: transform 0.15s;
}
.tab-plus:active i { transform: scale(0.92); }
.tab-plus svg { width: 22px; height: 22px; }
.tab-plus.wa i { background: var(--wa); color: #0b2b18; }
.has-tabbar { padding-bottom: calc(var(--bar-h) + var(--safe-b) + 16px); }

/* ---------- sheet / modali ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(5, 9, 17, 0.72);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.2s ease;
}
.sheet {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  background: var(--ink-2); border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px 22px calc(26px + var(--safe-b));
  animation: rise 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet::before { content: ""; display: block; width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 16px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h3 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: 0.01em; line-height: 1; }
.close-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ink-3); color: var(--muted); font-size: 20px; line-height: 1; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 20px; }
  .sheet { border-radius: var(--radius-lg); border-bottom: 1px solid var(--line); }
  .sheet::before { display: none; }
}
.action-list { display: grid; gap: 8px; }
.action {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink);
  transition: border-color 0.2s, transform 0.15s;
}
.action:hover { border-color: var(--muted); }
.action:active { transform: scale(0.99); }
.action .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ink-3); flex: none; }
.action .ic svg { width: 22px; height: 22px; }
.action b { display: block; font-size: 15px; }
.action small { color: var(--muted); font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 90; transform: translateX(-50%);
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 13.5px;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: drop 0.25s ease;
}

.code-box {
  font-family: var(--mono); font-weight: 600; font-size: 28px; letter-spacing: 0.22em; text-align: center;
  padding: 20px 10px; border-radius: var(--radius); background: var(--paper); color: var(--ink); user-select: all;
}
.notice { font-size: 13px; padding: 12px 14px; border-radius: 12px; background: rgba(201, 164, 92, 0.1); color: #e8cf9b; border: 1px solid rgba(201, 164, 92, 0.25); margin: 0; }

/* ---------- app (staff / admin) ---------- */
.app-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 12px;
  background: rgba(11, 18, 32, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.app-main { position: relative; z-index: 2; max-width: 560px; margin: 0 auto; padding: 20px 18px; }
.view { animation: fade 0.25s ease; }
.view-title { font-family: var(--display); font-weight: 900; font-size: 44px; line-height: 0.95; margin: 4px 0 6px; letter-spacing: 0.005em; }
.view-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); }
.card { background: var(--ink-2); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 18px; }
.card + .card, .card + .section-label, .section-label + .card { margin-top: 14px; }
.card h4 { margin: 0; font-size: 15px; }
.card p { margin: 2px 0 0; }
.section-label { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 2px 10px; }
.section-label h5 { margin: 0; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.section-label button { background: none; border: 0; color: var(--brass); font-size: 13px; font-weight: 600; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick button {
  text-align: left; border: 1px solid var(--line-soft); background: var(--ink-2); border-radius: var(--radius-lg);
  padding: 16px; display: grid; gap: 22px; transition: border-color 0.2s, transform 0.15s;
}
.quick button:active { transform: scale(0.98); }
.quick button:hover { border-color: var(--line); }
.quick svg { width: 24px; height: 24px; }
.quick b { font-size: 14.5px; display: block; }
.quick small { color: var(--muted); font-size: 12px; }
.quick .hot { background: var(--signal); border-color: var(--signal); color: #fff; }
.quick .hot small { color: rgba(255, 255, 255, 0.78); }

.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin: 14px 0 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-family: var(--mono); font-size: 13px; }
.cal span { padding: 7px 0; border-radius: 9px; color: #c3cad6; }
.cal .past { color: #4d5a70; }
.cal .today { background: var(--paper); color: var(--ink); font-weight: 600; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; background: var(--ink-2); border-radius: 999px; border: 1px solid var(--line-soft); margin-bottom: 16px; }
.segmented button { border: 0; background: none; padding: 9px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button.on { background: var(--paper); color: var(--ink); }

.list { display: grid; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius);
  background: var(--ink-2); border: 1px solid var(--line-soft); width: 100%; text-align: left;
  transition: border-color 0.2s;
}
button.item:hover { border-color: var(--line); }
.thumb { width: 52px; height: 52px; border-radius: 11px; object-fit: cover; background: var(--ink-3); flex: none; }
.ext { width: 52px; height: 52px; border-radius: 11px; display: grid; place-items: center; background: var(--ink-3); color: var(--brass); font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; flex: none; }
.item b { display: block; font-size: 14px; font-weight: 600; }
.item small { color: var(--muted); font-size: 12px; }
.item .mini { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; flex: none; text-decoration: none; }
.item .mini:hover { background: var(--ink-3); color: var(--text); }
.item .mini svg { width: 19px; height: 19px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 17px; background: var(--paper); color: var(--ink); flex: none; }
.avatar.off { background: var(--ink-3); color: var(--muted); }
.tag { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; padding: 3px 8px; border-radius: 999px; background: var(--ink-3); color: var(--muted); }
.tag.red { background: rgba(217, 69, 47, 0.15); color: #ff8a77; }
.tag.green { background: rgba(63, 174, 122, 0.15); color: #7fd6ab; }

.empty { text-align: center; padding: 38px 20px; border: 1px dashed var(--line); border-radius: var(--radius-lg); color: var(--muted); }
.empty svg { width: 34px; height: 34px; margin: 0 auto 10px; opacity: 0.7; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

.skeleton { height: 72px; border-radius: var(--radius); background: linear-gradient(90deg, var(--ink-2) 0%, var(--ink-3) 50%, var(--ink-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }

.dl { display: grid; gap: 0; }
.dl div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.dl div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; text-align: right; font-weight: 600; }

.progress { height: 4px; border-radius: 4px; background: var(--ink-3); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--brass); transition: width 0.2s; }
.progress.err i { background: var(--signal); }
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.search .input { padding: 11px 14px; font-size: 15px; }
.search select.input { width: auto; flex: none; }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 16px; transition: background 0.2s, border-color 0.2s; }
.dropzone.over { border-color: var(--brass); background: rgba(201, 164, 92, 0.06); }
.up-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.up-grid button { border: 0; border-radius: 14px; padding: 14px 6px; display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 600; background: var(--ink-3); }
.up-grid button:first-child { background: var(--paper); color: var(--ink); }
.up-grid svg { width: 24px; height: 24px; }

.preview { position: fixed; inset: 0; z-index: 80; background: rgba(5, 9, 17, 0.95); display: grid; place-items: center; padding: 16px; animation: fade 0.2s; }
.preview img { max-height: 92vh; border-radius: 10px; }

/* ---------- animazioni ---------- */
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes drop { from { transform: translate(-50%, -12px); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
