/* Backoffice: token, forme e misure del sito chiosco.cloud (STYLE_GUIDE.md §4–7). Nei componenti solo i token. */
/* Inter variabile, sottoinsieme latino: lo stesso file che next/font genera per il sito (licenza OFL) */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin.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;
}
:root {
  --background: #ffffff;
  --ink: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --cta: #F27329;
  --cta-ink: #1A1206;
  --accent-text: #C63A17;
  --tint-teal: color-mix(in oklab, #6DA0A6 18%, var(--background));
  --tint-gold: color-mix(in oklab, #F2C230 20%, var(--background));
  --tint-orange: color-mix(in oklab, #F27329 14%, var(--background));
  --tint-red: color-mix(in oklab, #F2522E 12%, var(--background));
  --surface: color-mix(in oklab, var(--ink) 3%, var(--background));
  --done: #2A5C62;
  --danger: #A02C0F;
  --filo: inset 0 0 0 1px color-mix(in oklab, var(--ink) 6%, transparent);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-main: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-display: clamp(2rem, 5vw, 2.75rem);
  --text-subhead: 1.5rem;
  --text-title: 1.125rem;
  --text-body: 1rem;
  --text-note: 0.9rem;
  --text-label: 0.85rem;
  --text-fine: 0.8rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #121212;
    --ink: #ffffff;
    --muted: #b3b3b3;
    --line: #333333;
    --accent-text: #F27329;
    --tint-teal: color-mix(in oklab, #6DA0A6 20%, var(--background));
    --tint-gold: color-mix(in oklab, #F2C230 15%, var(--background));
    --tint-orange: color-mix(in oklab, #F27329 16%, var(--background));
    --tint-red: color-mix(in oklab, #F2522E 15%, var(--background));
    --surface: color-mix(in oklab, var(--ink) 4%, var(--background));
    --done: #9CC7CC;
    --danger: #F79A80;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: var(--text-body)/1.5 var(--font-main);
  background: var(--background);
  color: var(--ink);
}
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

header.top {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.brand { font-size: var(--text-title); font-weight: 650; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.brand b { color: var(--accent-text); }
nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
nav a { text-decoration: none; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.who { color: var(--muted); font-size: var(--text-note); }

main { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
main.wide { max-width: 1100px; }
h1 { font-size: var(--text-display); font-weight: 650; line-height: 1.05; letter-spacing: -0.04em; margin: 0 0 20px; }
h2 { font-size: var(--text-subhead); font-weight: 650; line-height: 1.2; letter-spacing: -0.03em; margin: 28px 0 12px; }
.card > h2:first-child, .card > :first-child { margin-top: 0; }

.card { background: var(--surface); box-shadow: var(--filo); border-radius: 24px; padding: 24px; margin: 14px 0; }
.mt { margin-top: 16px; }

form.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: var(--text-note); }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 400; font-size: var(--text-body); min-height: 44px; }
input, select, textarea {
  font: inherit; font-weight: 400; font-size: 16px; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 0;
  box-shadow: inset 0 0 0 1px var(--line); background: var(--background); color: var(--ink); width: 100%;
  transition: box-shadow .2s var(--ease-out);
}
textarea { min-height: 96px; padding: 12px 16px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--cta), 0 0 0 4px color-mix(in oklab, var(--cta) 22%, transparent);
}
input[type="checkbox"], input[type="radio"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--cta); box-shadow: none; }
input[type="color"] { padding: 4px; height: 50px; }
input[type="file"] { padding: 12px 16px; }
select.narrow, input.narrow { max-width: 320px; }
fieldset { border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 14px; padding: 12px 16px; margin: 0; }
legend { font-weight: 600; font-size: var(--text-note); padding: 0 6px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row.wide-cols { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }

button, .button {
  font: inherit; font-weight: 600; letter-spacing: -0.01em; border: 0; border-radius: 999px;
  min-height: 48px; padding: 0 26px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cta); color: var(--cta-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.14), 0 8px 20px -8px rgba(242, 115, 41, 0.7);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background-color .2s var(--ease-out);
}
button:hover:not(:disabled), .button:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.14), 0 12px 24px -8px rgba(242, 115, 41, 0.8);
}
button:active:not(:disabled) { transform: translateY(1px); }
button.secondary, .button.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
button.secondary:hover:not(:disabled), .button.secondary:hover { background: color-mix(in oklab, var(--ink) 5%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
/* pericolo: pillola col filo corallo, così non si confonde con l'arancione dell'azione principale */
button.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
button.danger:hover:not(:disabled) { background: var(--tint-red); box-shadow: inset 0 0 0 1.5px currentColor; }
button.link { background: none; color: var(--accent-text); padding: 0; min-height: 44px; font-weight: 600; box-shadow: none; }
button.link:hover:not(:disabled) { transform: none; box-shadow: none; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
form.inline { display: inline; }
nav form.inline { display: flex; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.flash { padding: 12px 16px; border-radius: 14px; font-size: var(--text-note); }
.flash.error { background: var(--tint-red); color: var(--ink); box-shadow: var(--filo); }
.flash.ok { background: var(--tint-teal); color: var(--ink); box-shadow: var(--filo); }

table { width: 100%; border-collapse: collapse; font-size: var(--text-note); font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: var(--text-label); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.badge.on { color: var(--done); box-shadow: inset 0 0 0 1px currentColor; }
.badge.off { color: var(--danger); box-shadow: inset 0 0 0 1px currentColor; }
.secret {
  font: 600 22px/1.3 ui-monospace, monospace; letter-spacing: .06em; font-variant-numeric: tabular-nums;
  padding: 12px 16px; background: var(--background); box-shadow: inset 0 0 0 1px var(--line); border-radius: 14px; user-select: all;
}
.qr-box { width: 200px; max-width: 100%; }
code { font-family: ui-monospace, monospace; font-size: .92em; }
pre.tema { white-space: pre-wrap; font-size: var(--text-label); max-height: 420px; overflow: auto; background: var(--background); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 16px; border-radius: 14px; }
details.mt summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }

/* Cornici: anteprima su scacchiera, perché il buco è trasparente */
figure.frame { margin: 0; }
.ad-thumb { display: block; width: 120px; height: 68px; object-fit: contain; background: #0008; border-radius: 8px; }
img.frame-thumb { width: 100%; max-height: 220px; object-fit: contain; background: repeating-conic-gradient(#8883 0 25%, transparent 0 50%) 0 0 / 16px 16px; border-radius: 14px; }

/* Anteprima dello schermo nell'editor del tema: colori e carattere arrivano dal tema come variabili */
.screen-preview {
  aspect-ratio: 16 / 9; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 5%; padding: 4%;
  background: var(--p-bg); color: var(--p-text); font-family: var(--p-font);
}
.screen-preview .invite { max-width: 52%; }
.screen-preview .logo { max-height: 3.2em; max-width: 100%; margin-bottom: .4em; }
.screen-preview .event { color: var(--p-accent); font-weight: 700; font-size: clamp(12px, 2.2vw, 22px); }
.screen-preview .big { font-weight: 800; font-size: clamp(14px, 3vw, 32px); line-height: 1.1; }
.screen-preview .qr { width: 28%; aspect-ratio: 1; background: #fff; border-radius: 6%; display: grid; place-items: center; color: #000; font: 700 12px system-ui, sans-serif; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01s !important; }
  button:hover:not(:disabled), button:active:not(:disabled) { transform: none; }
}
