/* ==========================================================================
   TagNFC - design system
   ========================================================================== */
:root {
    --bg: #070b18;
    --bg-2: #0b1124;
    --surface: rgba(255, 255, 255, .045);
    --surface-2: rgba(255, 255, 255, .075);
    --line: rgba(148, 163, 255, .16);
    --text: #eef2ff;
    --muted: #a5b4d8;
    --cyan: #22d3ee;
    --violet: #8b5cf6;
    --pink: #f472b6;
    --accent: var(--cyan);
    --grad: linear-gradient(120deg, var(--cyan), var(--violet));
    --radius: 18px;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
    --font: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .02em; }
.muted, .text-muted { color: var(--muted) !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Pulsanti ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font: 600 .95rem/1 var(--font); padding: .8rem 1.2rem; border-radius: 999px;
    border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    color: var(--text); background: transparent; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 1rem 1.7rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--grad); color: #04101f; box-shadow: 0 10px 30px -10px rgba(34, 211, 238, .55); }
.btn-primary:hover { box-shadow: 0 14px 38px -8px rgba(139, 92, 246, .7); }
.btn-outline { border-color: var(--line); background: var(--surface); backdrop-filter: blur(10px); }
.btn-outline:hover { border-color: var(--cyan); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-accent { background: var(--accent); color: #04101f; box-shadow: 0 10px 30px -12px var(--accent); }
.chip-btn {
    display: inline-flex; align-items: center; gap: .45rem; font: 600 .85rem var(--font);
    padding: .6rem .95rem; border-radius: 999px; color: var(--text); cursor: pointer;
    background: rgba(10, 16, 36, .65); border: 1px solid var(--line); backdrop-filter: blur(12px);
    transition: border-color .2s, transform .2s, background .2s;
}
.chip-btn:hover { border-color: var(--cyan); transform: translateY(-1px); }
.chip-btn-accent { background: var(--grad); color: #04101f; border-color: transparent; }

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .8rem; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface); font-size: .78rem; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.2rem;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(34, 211, 238, .7); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(34, 211, 238, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); } }

/* ---------- Brand + topbar ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--text); text-decoration: none !important; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #04101f; box-shadow: 0 6px 20px -6px rgba(34, 211, 238, .7); }
.topbar {
    position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .9rem clamp(1rem, 4vw, 3rem); transition: background .3s, border-color .3s, padding .3s; border-bottom: 1px solid transparent;
}
.topbar.solid { background: rgba(7, 11, 24, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom-color: var(--line); padding-block: .65rem; }
.topnav { display: flex; gap: 1.6rem; }
.topnav a { color: var(--muted); font-weight: 500; font-size: .93rem; }
.topnav a:hover { color: var(--text); text-decoration: none; }
.topactions { display: flex; gap: .5rem; align-items: center; }
.topactions .btn { padding: .65rem 1.05rem; font-size: .88rem; }

/* ---------- Landing: sfondo + canvas ---------- */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
.bg-aurora {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60rem 36rem at 85% -10%, rgba(139, 92, 246, .28), transparent 60%),
        radial-gradient(48rem 30rem at -10% 30%, rgba(34, 211, 238, .18), transparent 60%),
        radial-gradient(50rem 30rem at 60% 110%, rgba(244, 114, 182, .12), transparent 60%),
        var(--bg);
}
main, .site-footer { position: relative; z-index: 1; }

.hero {
    position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    align-items: center; padding: 7rem clamp(1.2rem, 6vw, 5rem) 5rem; touch-action: pan-y; cursor: grab;
}
.hero.dragging { cursor: grabbing; }
.hero-copy { max-width: 640px; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); font-weight: 800; letter-spacing: -.035em; margin-bottom: .35em; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 56ch; }
.lead strong { color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.cta-row.center { justify-content: center; }
.hero-stats { list-style: none; padding: 0; margin: 2.4rem 0 0; display: flex; gap: 2rem; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; letter-spacing: -.02em; }
.hero-stats span { color: var(--muted); font-size: .85rem; }
.hero-controls { position: absolute; right: clamp(1.2rem, 6vw, 5rem); bottom: 4.2rem; display: flex; gap: .6rem; z-index: 6; }
.hint { position: absolute; right: clamp(1.2rem, 6vw, 5rem); bottom: 2.2rem; margin: 0; font-size: .78rem; color: var(--muted); opacity: .8; }
.scroll-cue { position: absolute; left: 50%; bottom: 1.2rem; width: 26px; height: 42px; border: 2px solid var(--line); border-radius: 14px; transform: translateX(-50%); }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--cyan); animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* Hotspot */
.hotspot { position: fixed; left: 0; top: 0; z-index: 8; width: 38px; height: 38px; padding: 0; border: 0; background: transparent; cursor: pointer; will-change: transform; transition: opacity .25s; }
.hotspot.hidden { opacity: 0; pointer-events: none; }
.hotspot span { position: absolute; inset: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(34, 211, 238, .35), 0 0 18px rgba(34, 211, 238, .9); }
.hotspot::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; border: 2px solid var(--cyan); animation: hs 2s infinite; }
@keyframes hs { 0% { transform: scale(.55); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.hotspot.active span { background: var(--cyan); }
.hotspot:focus-visible { outline-offset: 0; }
.info-card {
    position: fixed; z-index: 9; left: clamp(1rem, 4vw, 3rem); bottom: 1.6rem; width: min(340px, calc(100vw - 2rem)); padding: 1.1rem 1.2rem;
    background: rgba(10, 16, 36, .82); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(16px);
    opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .25s, transform .25s; box-shadow: var(--shadow);
}
.info-card.show { opacity: 1; transform: none; pointer-events: auto; }
.info-card h3 { font-size: 1.05rem; margin-bottom: .35rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.info-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.info-close { position: absolute; top: .4rem; right: .6rem; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
body.tapping .hero-copy { opacity: .35; transition: opacity .4s; }

/* Fallback senza WebGL */
.tag-fallback { display: none; grid-column: 2; justify-self: center; }
.no-webgl .tag-fallback { display: block; }
.no-webgl .hotspot, .no-webgl .hero-controls, .no-webgl .hint { display: none; }
.fallback-tag { width: 230px; height: 300px; border-radius: 44px; display: grid; place-items: center; align-content: center; gap: .8rem; color: var(--cyan);
    background: linear-gradient(145deg, #13204a, #060a1c); border: 2px solid var(--violet); box-shadow: 0 0 60px rgba(139, 92, 246, .45); }
.fallback-tag b { color: var(--text); font-size: 1.6rem; }

/* ---------- Sezioni ---------- */
.section { position: relative; padding: clamp(5rem, 11vh, 8rem) clamp(1.2rem, 6vw, 5rem); min-height: 80svh; display: flex; flex-direction: column; justify-content: center; }
.section-narrow { max-width: 900px; margin-inline: auto; width: 100%; }
.section-head { max-width: 640px; margin-bottom: 2.4rem; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 3.1rem); font-weight: 800; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; max-width: 1000px; margin-left: auto; width: min(100%, 700px); grid-template-columns: 1fr; }
.steps .card { padding: 1.5rem 1.6rem; position: relative; overflow: hidden; }
.step-n { position: absolute; right: 1.2rem; top: .6rem; font-size: 3.2rem; font-weight: 800; letter-spacing: -.04em; color: rgba(139, 92, 246, .22); }
.steps h3 { font-size: 1.25rem; }
.steps p { color: var(--muted); margin: 0; max-width: 46ch; }
.grid-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; width: min(100%, 820px); }
#funzioni .grid-features, #sicurezza .grid-features { margin-left: 0; }
#funzioni .section-head, #funzioni .grid-features { margin-right: auto; }
.grid-features.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.feature { padding: 1.4rem; transition: transform .25s, border-color .25s; }
.feature:hover { transform: translateY(-4px); border-color: rgba(34, 211, 238, .5); }
.feature h3 { font-size: 1.08rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
.feature-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; margin-bottom: 1rem; color: var(--cyan);
    background: linear-gradient(145deg, rgba(34, 211, 238, .16), rgba(139, 92, 246, .16)); border: 1px solid var(--line); }
.block-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; max-width: 640px; margin-left: auto; }
.block-cloud li { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(10px); font-weight: 500; }
.block-cloud svg { color: var(--cyan); }
#blocchi .section-head { margin-left: auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; margin-bottom: .7rem; backdrop-filter: blur(10px); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; color: var(--cyan); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .8rem 0 0; color: var(--muted); }
.cta-band { min-height: 60svh; align-items: center; }
.cta-card { text-align: center; padding: clamp(2rem, 5vw, 3.5rem); max-width: 760px; width: 100%; background: linear-gradient(145deg, rgba(34, 211, 238, .10), rgba(139, 92, 246, .14)); }
.cta-card h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 800; }
.cta-card p { color: var(--muted); max-width: 50ch; margin-inline: auto; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 2rem clamp(1.2rem, 6vw, 5rem); border-top: 1px solid var(--line); background: rgba(7, 11, 24, .8); backdrop-filter: blur(10px); color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 1.2rem; }

/* Rivelazione allo scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
html:not(.webgl-ready) .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } * { animation: none !important; scroll-behavior: auto !important; } }

/* ---------- Login / registrazione ---------- */
.auth-wrap { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; padding: 2rem 1rem; }
.auth-card { width: min(440px, 100%); padding: clamp(1.5rem, 4vw, 2.2rem); }
.auth-card h1 { font-size: 1.7rem; margin-bottom: .3rem; }
.auth-sub { color: var(--muted); margin-bottom: 1.4rem; }
.auth-foot { color: var(--muted); font-size: .95rem; }
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .4rem; font-size: .88rem; color: var(--muted); font-weight: 500; }
.field small { font-weight: 400; opacity: .8; }
.field input {
    width: 100%; font: 500 1rem var(--font); color: var(--text); background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1rem; transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .2); }
.field input.invalid { border-color: #f87171; }
.field-error, .validation-message { color: #fca5a5; font-size: .82rem; }
.form-error { background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .4); color: #fecaca; padding: .75rem 1rem; border-radius: 12px; font-size: .92rem; }
.form-ok { background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .4); color: #a7f3d0; padding: .9rem 1rem; border-radius: 12px; font-size: .95rem; display: grid; gap: .4rem; }
.form-ok p { margin: 0; }
.check { display: flex; gap: .6rem; align-items: center; color: var(--muted); font-size: .92rem; }
.check input { accent-color: var(--cyan); width: 18px; height: 18px; }

/* ---------- Pagina pubblica ---------- */
.pp-bg { position: fixed; inset: 0; z-index: -1; background:
    radial-gradient(50rem 30rem at 50% -8%, color-mix(in srgb, var(--accent, #22d3ee) 28%, transparent), transparent 62%),
    radial-gradient(40rem 26rem at 100% 100%, rgba(139, 92, 246, .16), transparent 60%), var(--bg); }
.pp-state { max-width: 480px; margin: 18vh auto 0; padding: 2.4rem 2rem; text-align: center; display: grid; gap: .6rem; justify-items: center; }
.pp-state svg { color: var(--cyan); }
.pp-state h1 { font-size: 1.6rem; margin: .4rem 0 0; }
.pp-state p { color: var(--muted); margin: 0; }
.lost-contact { color: var(--text) !important; font-weight: 700; font-size: 1.15rem; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2); }
.pp { --accent: #22d3ee; max-width: 520px; margin: 0 auto; padding: clamp(1.6rem, 6vw, 3rem) 1.1rem 2rem; display: grid; gap: 1.4rem; }
.pp-head { text-align: center; display: grid; justify-items: center; gap: .15rem; }
.pp-avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent), 0 20px 40px -14px var(--accent); margin-bottom: .9rem; }
.pp-initials { display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; color: #04101f; background: linear-gradient(135deg, var(--accent), #fff 220%); }
.pp-name { font-size: 1.85rem; font-weight: 800; margin: 0; }
.pp-headline { color: var(--accent); font-weight: 600; margin: .1rem 0 0; }
.pp-bio { color: var(--muted); max-width: 40ch; margin: .6rem 0 0; }
.pp-actions { display: flex; gap: .6rem; margin-top: 1.1rem; flex-wrap: wrap; justify-content: center; }
.pp-list { display: grid; gap: .65rem; }
.tile { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text) !important;
    text-decoration: none !important; backdrop-filter: blur(10px); transition: transform .18s, border-color .18s, background .18s; }
a.tile:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--surface-2); }
.tile-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tile-body { flex: 1; min-width: 0; display: grid; }
.tile-label { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tile-value { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-text .tile-icon { align-self: flex-start; }
.tile-text-value { white-space: pre-line; overflow-wrap: anywhere; }
.tile-go { color: var(--muted); }
.tile-action { border: 0; background: var(--surface-2); color: var(--text); border-radius: 10px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.tile-action.done { background: var(--accent); color: #04101f; }
.tile-private { border-style: dashed; opacity: .75; }
.pp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.pp-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); display: block; transition: transform .2s; }
.pp-gallery a:hover img { transform: scale(1.02); }
.pp-foot { text-align: center; font-size: .82rem; }
.pp-foot a { color: var(--muted); }
.btn.done { background: var(--accent); color: #04101f; }

/* ---------- Area riservata ---------- */
.area-appbar { backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.area-appbar .brand { margin-left: .4rem; }
.area-drawer { border-right: 1px solid var(--line) !important; }
.area-main { background: radial-gradient(50rem 28rem at 90% -10%, rgba(139, 92, 246, .14), transparent 60%), radial-gradient(40rem 24rem at 0% 20%, rgba(34, 211, 238, .08), transparent 60%), var(--bg); min-height: 100vh; }
.mud-paper { border: 1px solid var(--line); background: var(--surface) !important; backdrop-filter: blur(10px); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, .25), transparent 70%); }
.stat-sub { font-size: 1rem; color: var(--muted); font-weight: 500; }
.onboard { background: linear-gradient(145deg, rgba(34, 211, 238, .08), rgba(139, 92, 246, .12)) !important; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; height: 150px; }
.bar-col { height: 100%; display: flex; align-items: flex-end; }
.bar { width: 100%; min-height: 3px; border-radius: 4px 4px 2px 2px; background: var(--grad); opacity: .9; }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-top: .4rem; }
.qr-box { display: inline-block; background: #fff; padding: 10px; border-radius: 16px; line-height: 0; }
.tag-card { transition: border-color .2s; }
.tag-card:hover { border-color: rgba(34, 211, 238, .5); }
.editor-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.editor-avatar-empty { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.upload-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border: 1px dashed var(--cyan); border-radius: 12px; color: var(--cyan); cursor: pointer; font-weight: 600; font-size: .9rem; position: relative; transition: background .2s; }
.upload-btn:hover { background: rgba(34, 211, 238, .08); }
.upload-wide { width: 100%; justify-content: center; padding: 1rem; margin-bottom: .8rem; }
.upload-btn:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .15s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); }
.block-zone { min-height: 12px; display: grid; gap: .5rem; }
.block-row { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.block-row.block-private { border-style: dashed; opacity: .8; }
.block-handle { cursor: grab; color: var(--muted); display: grid; place-items: center; touch-action: none; }
.block-icon { color: var(--cyan); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(34, 211, 238, .1); flex: none; }
.block-main { flex: 1; min-width: 0; display: grid; }
.block-title { font-weight: 600; font-size: .95rem; }
.block-value { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-actions { display: flex; flex-wrap: nowrap; }
.block-edit { flex: 1; min-width: 0; }
.select-item { display: inline-flex; align-items: center; gap: .6rem; }
.preview-sticky { position: sticky; top: 84px; }
.phone-frame { position: relative; width: min(340px, 100%); margin: 0 auto; border-radius: 42px; padding: 12px; background: linear-gradient(145deg, #1b2547, #0a1022); border: 1px solid var(--line); box-shadow: var(--shadow), 0 0 80px rgba(139, 92, 246, .18); }
.phone-notch { position: absolute; z-index: 2; top: 20px; left: 50%; width: 90px; height: 22px; border-radius: 12px; background: #04070f; transform: translateX(-50%); }
.phone-screen { border-radius: 32px; overflow: hidden auto; height: min(640px, 74vh); background: var(--bg); position: relative; }
.phone-screen .pp { padding-top: 3.4rem; --accent: var(--accent); pointer-events: none; }
.pp-preview { zoom: .92; }

#blazor-error-ui { background: #7f1d1d; color: #fff; bottom: 0; display: none; left: 0; padding: .7rem 1.25rem; position: fixed; width: 100%; z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
#blazor-error-ui a { color: #fff; text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .topnav { display: none; }
    .hero { grid-template-columns: 1fr; align-items: end; padding-top: 6rem; padding-bottom: 6.5rem; min-height: 100svh; }
    .hero-copy { text-align: center; margin-inline: auto; }
    .hero-copy .lead { margin-inline: auto; }
    .hero-copy .cta-row, .hero-stats { justify-content: center; }
    .hero-stats { gap: 1.4rem; }
    .hero h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); }
    .hero-controls { right: 50%; transform: translateX(50%); bottom: 4.5rem; }
    .hint { display: none; }
    .scroll-cue { display: none; }
    .tag-fallback { grid-column: 1; margin-bottom: 1.5rem; }
    .section { min-height: auto; padding-block: 4.5rem; }
    .steps, .block-cloud { margin-left: 0; }
    .info-card { bottom: 5.5rem; left: 50%; transform: translate(-50%, 10px); }
    .info-card.show { transform: translate(-50%, 0); }
    .preview-sticky { position: static; margin-top: 1rem; }
}
@media (max-width: 480px) {
    .topactions .btn-ghost { display: none; }
    .block-actions .mud-icon-button { padding: 4px; }
}

/* ---------- Schermata di caricamento dell'area interattiva ---------- */
#boot-splash { position: fixed; inset: 0; z-index: 3000; display: grid; place-content: center; justify-items: center; gap: 1rem; background: var(--bg); color: var(--muted); transition: opacity .25s; }
#boot-splash.done { opacity: 0; pointer-events: none; }
.boot-ring { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--cyan); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
