/* ============================================================
   flipside — stile
   Palette: cobalto (marchio), gesso (fondo), inchiostro (testo), segnale (rari accenti)
   Font: Bricolage Grotesque, una sola famiglia
   ============================================================ */

@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/bricolage-grotesque-latin-ext-opsz-normal.woff2) format("woff2-variations");
  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;
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/bricolage-grotesque-latin-opsz-normal.woff2) format("woff2-variations");
  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 {
  --cobalt: #2337F5;
  --cobalt-deep: #1626B8;
  --chalk: #EEF0EC;
  --surface: #FFFFFF;
  --ink: #14161F;
  --ink-2: #555A68;
  --line: #D6D9D1;
  --signal: #FF5A1F;
  --ok: #128A4A;
  --err: #C8331B;
  --radius: 14px;
  --ease: cubic-bezier(.16, 1, .3, 1);      /* parte veloce, arriva piano */
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --chalk: #101219;
    --surface: #191C26;
    --ink: #ECEEE8;
    --ink-2: #A3A8B6;
    --line: #2B2F3C;
    --cobalt-deep: #6F7DFF;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--chalk);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.05; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- bottoni ---------- */
.btn {
  --b: var(--cobalt); --t: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.25em;
  font: 600 1rem/1 var(--font);
  color: var(--t); background: var(--b);
  border: 1.5px solid var(--b); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: transform .4s var(--ease), background .2s, box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px var(--b); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .i { width: 1.2em; height: 1.2em; flex: none; }
.btn-ghost { --t: var(--ink); background: transparent; border-color: var(--line); }
.btn-ghost:hover { box-shadow: none; border-color: var(--ink); }
.btn-light { --b: #fff; --t: var(--cobalt); }
.btn-wa { --b: #1FAF55; }
.btn-danger { --b: var(--err); }
.btn-sm { min-height: 38px; padding: .45em .9em; font-size: .92rem; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- logo ---------- */
.brand { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; font-size: 1.35rem; letter-spacing: -.04em; text-decoration: none; }
.brand-mark { width: 1.6rem; height: 1.05rem; position: relative; perspective: 120px; }
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; inset: 0; border-radius: 3px; background: currentColor;
}
.brand-mark::after { background: var(--signal); transform: rotateY(-58deg); transform-origin: right; opacity: .95; }

/* ============================================================
   TESSERA 3D
   ============================================================ */
.fcard {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 85.6 / 54;
  perspective: 1400px;
  --flip: 0deg; --tx: 0deg; --ty: 0deg; --mx: 50%; --my: 30%;
  -webkit-tap-highlight-color: transparent;
}
.fcard[data-flip] { cursor: pointer; }
.fcard.is-flipped { --flip: 180deg; }
.fc-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--ty)) rotateY(calc(var(--flip) + var(--tx)));
  transition: transform .95s var(--ease);
}
.fcard.is-tilting .fc-inner { transition: transform .18s ease-out; }
.fc-face {
  position: absolute; inset: 0;
  border-radius: 4.2cqi;
  overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  color: var(--on, #fff);
  background: var(--c);
  box-shadow:
    0 1px 1px rgba(0,0,0,.08),
    0 12px 24px -10px rgba(0,0,0,.35),
    0 34px 60px -28px color-mix(in oklab, var(--c), #000 35%);
}
.fc-back { transform: rotateY(180deg); display: flex; flex-direction: column; padding: 6.5cqi 7cqi; }
.fc-front { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.5cqi; padding: 8cqi; }

.fcard[data-finish="sfumato"] .fc-face {
  background: linear-gradient(135deg, color-mix(in oklab, var(--c), #fff 22%) 0%, var(--c) 48%, color-mix(in oklab, var(--c), #000 30%) 100%);
}
.fcard[data-finish="carta"] .fc-face {
  background:
    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='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--c);
  box-shadow:
    inset 0 0 0 .5cqi color-mix(in oklab, var(--c), #fff 12%),
    0 1px 1px rgba(0,0,0,.08),
    0 12px 24px -10px rgba(0,0,0,.35),
    0 34px 60px -28px color-mix(in oklab, var(--c), #000 35%);
}
.fc-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.38), rgba(255,255,255,0) 55%);
  mix-blend-mode: soft-light;
  opacity: .9;
}
.fc-logo { position: relative; max-width: 58%; max-height: 52%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 .4cqi .8cqi rgba(0,0,0,.18)); }
.fc-mono { position: relative; font-weight: 800; font-size: 20cqi; line-height: 1; letter-spacing: -.05em; }
.fc-company { position: relative; font-weight: 600; font-size: 4.4cqi; letter-spacing: .01em; opacity: .92; text-align: center; max-width: 90%; }
.fc-head { position: relative; display: flex; flex-direction: column; gap: .4cqi; margin-bottom: 2cqi; }
.fc-who { font-size: 6.4cqi; line-height: 1.05; font-weight: 700; letter-spacing: -.02em; }
.fc-role, .fc-org { font-size: 3.6cqi; opacity: .8; line-height: 1.25; }
.fc-rows { position: relative; list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; gap: 1.5cqi; font-size: 3.45cqi; line-height: 1.2; }
.fc-back:has(.fc-qr) .fc-rows { max-width: calc(100% - 25cqi); }
.fc-rows li { display: flex; align-items: center; gap: 2cqi; min-width: 0; }
.fc-rows li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-rows .i { width: 3.9cqi; height: 3.9cqi; flex: none; opacity: .85; }
.fc-qr {
  position: absolute; right: 6cqi; bottom: 6cqi;
  width: 21cqi; aspect-ratio: 1; padding: 1.4cqi;
  background: #fff; border-radius: 2cqi;
}
.fc-qr svg { width: 100%; height: 100%; display: block; }

/* ============================================================
   LANDING
   ============================================================ */
.nav { position: absolute; inset: 0 0 auto; z-index: 10; padding-top: max(1rem, env(safe-area-inset-top)); color: #fff; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.nav-links { display: flex; align-items: center; gap: .5rem; }
.nav-links a:not(.btn) { color: #fff; text-decoration: none; font-weight: 600; padding: .6em .8em; }

.hero {
  position: relative; overflow: hidden;
  background: var(--cobalt); color: #fff;
  padding: calc(7rem + env(safe-area-inset-top)) 0 0;
  isolation: isolate;
}
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; position: relative; z-index: 2; }
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 5.6rem); font-weight: 800; letter-spacing: -.045em; line-height: .95; margin-bottom: .35em; max-width: 11ch; }
.hero-lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 34ch; opacity: .92; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.8rem 0 1.2rem; }
.hero-cta .btn-ghost { --t: #fff; border-color: rgba(255,255,255,.4); }
.hero-cta .btn-ghost:hover { border-color: #fff; }
.hero-note { font-size: .95rem; opacity: .75; margin: 0; }
.hero-stage { position: relative; height: clamp(340px, 42vw, 520px); }
.hero-stage .fcard { position: absolute; width: min(100%, 440px); }
.hero-stage .s1 { right: 2%; top: 4%; transform: rotate(7deg); opacity: .85; width: min(78%, 360px); }
.hero-stage .s2 { left: -2%; bottom: 8%; transform: rotate(-9deg); opacity: .9; width: min(72%, 330px); }
.hero-stage .main { left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; }
.hero-hint { position: absolute; left: 50%; bottom: -1.2rem; transform: translateX(-50%); display: inline-flex; align-items: center; gap: .4em; font-size: .9rem; opacity: .8; white-space: nowrap; z-index: 4; }
.hero-hint .i { width: 1.1em; height: 1.1em; }
.hero-word {
  position: relative; z-index: 1;
  font-weight: 800; letter-spacing: -.07em; line-height: .75;
  font-size: clamp(6rem, 24vw, 22rem);
  color: var(--cobalt-deep);
  color: color-mix(in oklab, var(--cobalt), #000 22%);
  margin: 3rem 0 0; padding: 0 0 0 .02em;
  white-space: nowrap; user-select: none;
  transform: translateY(.12em);
}

/* ingresso orchestrato: la tessera arriva, si gira una volta, si ferma */
@media (prefers-reduced-motion: no-preference) {
  .hero-stage .main { animation: drop 1.1s var(--ease) both .15s; }
  .hero-stage .s1 { animation: drift1 1.4s var(--ease) both; }
  .hero-stage .s2 { animation: drift2 1.4s var(--ease) both .05s; }
  .hero h1, .hero-lead, .hero-cta, .hero-note { animation: rise .9s var(--ease) both; }
  .hero-lead { animation-delay: .08s; } .hero-cta { animation-delay: .16s; } .hero-note { animation-delay: .22s; }
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -30%) rotate(-14deg) scale(.86); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes drift1 { from { opacity: 0; transform: rotate(18deg) translate(30px, -20px); } }
@keyframes drift2 { from { opacity: 0; transform: rotate(-20deg) translate(-30px, 20px); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.band { padding: clamp(4rem, 9vw, 7.5rem) 0; }
.band h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); max-width: 16ch; }
.band-lead { font-size: 1.2rem; color: var(--ink-2); max-width: 46ch; }

/* tre passi: è davvero una sequenza */
.steps { list-style: none; padding: 0; margin: 3rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px solid var(--ink); counter-reset: s; }
.steps li { padding: 1.6rem 1.6rem 0 0; counter-increment: s; }
.steps li + li { padding-left: 1.6rem; border-left: 1.5px solid var(--line); }
.steps li::before { content: counter(s); display: block; font-weight: 800; font-size: 3.4rem; line-height: 1; letter-spacing: -.05em; color: var(--cobalt); margin-bottom: 1rem; }
.steps h3 { font-size: 1.4rem; }
.steps p { color: var(--ink-2); margin: 0; }

/* prova dal vivo */
.try { background: var(--surface); border-block: 1px solid var(--line); }
.try-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.try-stage { position: relative; padding: 2rem 0; }
.try-stage .fcard { max-width: 460px; margin-inline: auto; }
.swatches { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.6rem 0 1rem; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--s); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); transition: transform .4s var(--ease); }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { font: 600 .95rem var(--font); color: var(--ink-2); background: none; border: 0; border-radius: 999px; padding: .5em 1em; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--chalk); }
.try-name { margin-top: 1.2rem; width: 100%; max-width: 360px; }

/* cosa fa */
.does { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem 4rem; margin-top: 3rem; }
.does div { display: grid; grid-template-columns: 2.6rem 1fr; gap: .2rem 1rem; }
.does .i { width: 2.6rem; height: 2.6rem; padding: .55rem; border-radius: 50%; background: color-mix(in oklab, var(--cobalt), transparent 88%); color: var(--cobalt); grid-row: span 2; }
.does h3 { font-size: 1.25rem; margin: .35rem 0 .2rem; }
.does p { color: var(--ink-2); margin: 0; }

/* wallet */
.wallet { background: var(--ink); color: var(--chalk); overflow: hidden; }
@media (prefers-color-scheme: dark) { .wallet { background: #050609; } }
.wallet .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.wallet .band-lead { color: color-mix(in oklab, var(--chalk), transparent 30%); }
.wallet-stack { position: relative; height: 300px; }
.wallet-stack .fcard { position: absolute; width: min(100%, 360px); left: 50%; transform: translateX(-50%); }
.wallet-stack .fcard:nth-child(1) { top: 0; }
.wallet-stack .fcard:nth-child(2) { top: 56px; }
.wallet-stack .fcard:nth-child(3) { top: 112px; }
.pill { display: inline-block; font-weight: 600; font-size: .9rem; padding: .35em .85em; border-radius: 999px; background: var(--signal); color: #fff; margin-bottom: 1rem; }

/* cosa non è */
.isnt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2.5rem; }
.isnt p { margin: 0; font-size: 1.15rem; }
.isnt b { display: block; font-size: 1.5rem; letter-spacing: -.02em; text-decoration: line-through; text-decoration-color: var(--signal); text-decoration-thickness: 3px; margin-bottom: .3rem; }

/* domande */
.faq { margin-top: 2.5rem; border-top: 1.5px solid var(--ink); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.25rem 2.5rem 1.25rem 0; font-weight: 600; font-size: 1.15rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .4rem; top: 50%; width: 12px; height: 12px; border-right: 2px solid; border-bottom: 2px solid; transform: translateY(-70%) rotate(45deg); transition: transform .4s var(--ease); }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: var(--ink-2); padding-bottom: 1.25rem; margin: 0; max-width: 64ch; }

.final { background: var(--cobalt); color: #fff; text-align: left; }
.final h2 { max-width: 14ch; }
.footer { padding: 2.5rem 0 calc(2.5rem + env(safe-area-inset-bottom)); font-size: .95rem; color: var(--ink-2); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer a { color: var(--ink-2); }

/* ============================================================
   APP (accesso, dashboard, editor)
   ============================================================ */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in oklab, var(--chalk), transparent 12%); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.topbar .brand { color: var(--cobalt); }
@media (prefers-color-scheme: dark) { .topbar .brand { color: var(--ink); } }
.topbar nav { display: flex; align-items: center; gap: .25rem; }
.topbar nav a:not(.btn) { text-decoration: none; font-weight: 600; color: var(--ink-2); padding: .55em .75em; border-radius: 8px; }
.topbar nav a[aria-current="page"] { color: var(--ink); }
.page { padding: 2.5rem 0 5rem; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0; }

.flash { padding: .9rem 1.1rem; border-radius: 10px; margin-bottom: 1.5rem; font-weight: 600; background: color-mix(in oklab, var(--ok), transparent 86%); color: var(--ok); }
.flash.err { background: color-mix(in oklab, var(--err), transparent 88%); color: var(--err); }
@media (prefers-color-scheme: dark) { .flash { color: #5fd79a; } .flash.err { color: #ff8a73; } }

/* accesso */
.auth { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--cobalt); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.auth-side .brand { color: #fff; }
.auth-side .fcard { width: min(100%, 400px); margin: 2rem auto; }
.auth-side p { font-size: 1.25rem; max-width: 26ch; margin: 0; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.auth-box { width: min(100%, 420px); }
.auth-box h1 { font-size: 2.2rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1.5px solid var(--line); margin-bottom: 1.8rem; }
.tabs a { text-decoration: none; font-weight: 700; padding: .7rem .2rem; margin-right: 1.2rem; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--cobalt); }

/* campi */
.field { display: block; margin-bottom: 1.1rem; }
.field > span { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.field small { display: block; color: var(--ink-2); font-size: .85rem; margin-top: .3rem; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel], .field input[type=url], .field textarea, .field select {
  width: 100%; font: 400 1rem var(--font); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px;
  padding: .75em .9em; min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 4px color-mix(in oklab, var(--cobalt), transparent 82%); }
.field .err-msg { color: var(--err); font-size: .88rem; margin-top: .3rem; display: block; font-weight: 600; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: 1.2rem; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--cobalt); flex: none; }
.slug-row { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.slug-row:focus-within { border-color: var(--cobalt); box-shadow: 0 0 0 4px color-mix(in oklab, var(--cobalt), transparent 82%); }
.slug-row span { padding: .75em 0 .75em .9em; color: var(--ink-2); white-space: nowrap; display: flex; align-items: center; font-size: .95rem; }
.slug-row input { border: 0 !important; box-shadow: none !important; padding-left: .15em !important; min-width: 0; }
.slug-status { font-size: .88rem; font-weight: 600; margin-top: .3rem; display: block; min-height: 1.2em; }
.slug-status.ok { color: var(--ok); } .slug-status.no { color: var(--err); }

/* dashboard */
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 2.5rem 2rem; }
.deck-item .fcard { margin-bottom: 1rem; }
.deck-item h2 { font-size: 1.2rem; margin: 0 0 .15rem; letter-spacing: -.01em; }
.deck-meta { text-decoration: none; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; color: var(--ink-2); margin-bottom: .9rem; }
.deck-meta b { color: var(--ink); }
.deck-meta:hover span { text-decoration: underline; }
.deck-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.empty { border: 2px dashed var(--line); border-radius: 18px; padding: 3rem 2rem; text-align: center; max-width: 560px; margin: 2rem auto; }
.empty h2 { font-size: 1.6rem; }
.empty p { color: var(--ink-2); }

/* statistiche tessera */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 2rem; overflow: hidden; }
.stats div { padding: 1.1rem 1.2rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.stats b { display: block; font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; }
.stats span { color: var(--ink-2); font-size: .92rem; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 70px; padding: 0 0 .5rem; }
.spark i { flex: 1; background: var(--cobalt); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.editor-preview { position: sticky; top: 90px; }
.editor-preview .fcard { max-width: 480px; margin: 0 auto 1rem; }
.preview-tools { display: flex; justify-content: center; gap: .5rem; }
.fieldset { border: 0; padding: 0; margin: 0 0 2rem; }
.fieldset legend { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: 1rem; padding: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.colors { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.colors .swatch { width: 38px; height: 38px; }
.color-input { width: 44px; height: 44px; border: 0; padding: 0; background: none; cursor: pointer; }
.pick { display: flex; flex-wrap: wrap; gap: .5rem; }
.pick-item { position: relative; }
.pick-item input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pick-item span { display: inline-block; padding: .5em .95em; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .92rem; color: var(--ink-2); background: var(--surface); transition: background .2s, color .2s, border-color .2s; }
.pick-item input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--chalk); }
.pick-item input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
.pick-item input:disabled + span { opacity: .4; }
.pick-item.is-empty span { border-style: dashed; }
.mail-state { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.mail-state i { width: 12px; height: 12px; border-radius: 50%; background: #9AA0AC; flex: none; }
.mail-state.ok i { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ok), transparent 80%); }
.logo-drop { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; transition: border-color .2s; }
.logo-drop:hover, .logo-drop.over { border-color: var(--cobalt); }
.logo-drop img { width: 64px; height: 64px; object-fit: contain; background: var(--chalk); border-radius: 8px; padding: 6px; }
.logo-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.save-bar { position: sticky; bottom: 0; background: color-mix(in oklab, var(--chalk), transparent 8%); backdrop-filter: blur(10px); padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: .75rem; flex-wrap: wrap; z-index: 5; }

/* modale QR */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.5rem; background: rgba(8, 10, 18, .72); backdrop-filter: blur(6px); }
.modal[hidden] { display: none; }
.modal-box { background: #fff; color: #14161F; border-radius: 22px; padding: 1.75rem; width: min(100%, 380px); text-align: center; animation: pop .5s var(--ease); }
.modal-box h2 { font-size: 1.4rem; }
.modal-qr { width: 100%; aspect-ratio: 1; margin: 1rem 0 1.25rem; }
.modal-qr svg { width: 100%; height: 100%; }
.modal-box .btn-ghost { --t: #14161F; border-color: #D6D9D1; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(10px); } }

.toast { position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom)); transform: translate(-50%, 150%); background: var(--ink); color: var(--chalk); padding: .8rem 1.2rem; border-radius: 999px; font-weight: 600; z-index: 200; transition: transform .5s var(--ease); }
.toast.on { transform: translate(-50%, 0); }

/* ============================================================
   PAGINA PUBBLICA DELLA TESSERA
   ============================================================ */
.public {
  min-height: 100svh;
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in oklab, var(--c), transparent 55%), transparent 70%),
    color-mix(in oklab, var(--c), #07080d 86%);
  color: #F2F3EF;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(2rem + env(safe-area-inset-top)) 1.25rem calc(2rem + env(safe-area-inset-bottom));
}
.public-card { width: min(100%, 460px); margin: 1rem 0 .75rem; }
.public-hint { display: inline-flex; align-items: center; gap: .4em; font-size: .9rem; opacity: .7; margin-bottom: 1.8rem; background: none; border: 0; color: inherit; font-family: inherit; cursor: pointer; }
.public-hint .i { width: 1.1em; height: 1.1em; }
.public-actions { width: min(100%, 460px); display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.public-actions .btn.wide { grid-column: 1 / -1; min-height: 56px; font-size: 1.05rem; }
.act { min-width: 0; }
.act { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .85rem .3rem; border-radius: 16px; text-decoration: none; color: #F2F3EF; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); font-size: .82rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .2s, transform .4s var(--ease); }
.act:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); }
.act .i { width: 1.5rem; height: 1.5rem; }
.billing { width: min(100%, 460px); margin-top: 1.75rem; padding: 1.25rem 1.25rem 1rem; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.billing h2 { font-size: 1.15rem; margin-bottom: .8rem; }
.billing dl { margin: 0; }
.billing dl div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .75rem; padding: .45rem 0; border-top: 1px solid rgba(255,255,255,.08); }
.billing dt { opacity: .65; font-size: .92rem; }
.billing dd { margin: 0; min-width: 0; }
.billing dd button { all: unset; cursor: pointer; font-weight: 600; overflow-wrap: anywhere; border-radius: 4px; }
.billing dd button:hover { text-decoration: underline; }
.billing dd button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.billing-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.billing .btn-ghost { --t: #F2F3EF; border-color: rgba(255,255,255,.25); }
.billing-hint { font-size: .82rem; opacity: .55; margin: .75rem 0 0; }
@media (max-width: 400px) { .billing dl div { grid-template-columns: 1fr; gap: .1rem; } }
.public-note { width: min(100%, 460px); margin-top: 1.5rem; font-size: .98rem; opacity: .85; text-align: center; }
.public-social { display: flex; gap: .6rem; justify-content: center; margin-top: 1.25rem; }
.public-social a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #F2F3EF; }
.public-social .i { width: 1.3rem; height: 1.3rem; }
.public-foot { margin-top: auto; padding-top: 2.5rem; font-size: .88rem; opacity: .65; text-align: center; }
.public-foot a { color: inherit; }
.public .btn-light { --t: color-mix(in oklab, var(--c), #000 25%); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero .wrap, .try-grid, .wallet .wrap, .editor, .auth { grid-template-columns: 1fr; }
  .hero { padding-top: calc(6rem + env(safe-area-inset-top)); }
  .hero-stage { height: 320px; margin-top: 1rem; }
  .hero-word { margin-top: 2.5rem; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 1.6rem 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .does, .isnt { grid-template-columns: 1fr; }
  .editor-preview { position: relative; top: 0; order: -1; }
  .auth-side { padding: 2rem 1.5rem; }
  .auth-side .fcard { width: min(100%, 300px); margin: 1.5rem auto .5rem; }
  .auth-side p { display: none; }
  .wallet-stack { height: 250px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nav-links a:not(.btn) { display: none; }
  .topbar nav a.hide-sm { display: none; }
  .act { font-size: .76rem; padding: .8rem .2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
