/* ── Font (locale: la pagina deve reggere anche con il Wi-Fi della fiera) ── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../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;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--bg-dot) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--text-h);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease;
}

button,
input {
  font-family: inherit;
}

button {
  -webkit-appearance: none;
  appearance: none;
}

[hidden] {
  display: none !important;
}

/* Il badge "demo" compare solo con ?demo */
html:not(.is-demo) [data-demo-only] {
  display: none !important;
}

/* ── Viste ─────────────────────────────────────────────────── */
.view {
  display: none;
  position: fixed;
  inset: 0;
}

.view.active {
  display: block;
}

.view-center.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.view-scroll {
  overflow-y: auto;
  scrollbar-width: thin;
}

/* ── Logo (nero nel file: lo si colora col filtro, come nel linktree) ── */
.logo {
  display: block;
  filter: brightness(0) invert(1);
  user-select: none;
  -webkit-user-drag: none;
}

:root:not(.dark) .logo {
  filter: brightness(0);
}

/* ── Card in vetro ─────────────────────────────────────────── */
.card {
  background: var(--face-bg);
  border: 1px solid var(--face-border);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-radius: 24px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-eyebrow);
}

.muted {
  color: var(--text-sub);
}

/* ── Pulsanti ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 150ms ease, transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.btn:focus {
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid #4db8ff;
  outline-offset: 3px;
}

.btn-primary {
  background: #0a66c2;
  color: #fff;
  box-shadow: 0 4px 18px rgba(10, 102, 194, 0.28);
}

.btn-primary:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.btn-primary:active {
  filter: brightness(0.95);
  transform: translateY(0);
}

.btn-ghost {
  background: var(--ghost-bg);
  border-color: var(--ghost-border);
  color: var(--text-h);
}

.btn-ghost:hover {
  background: var(--ghost-hover);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.10);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--err);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.18);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-lg {
  padding: 15px 26px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  padding: 4px 2px;
  color: var(--text-sub);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.btn-link:hover {
  color: var(--text-h);
}

.btn-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.btn.is-loading .btn-spinner {
  display: block;
}

.btn.is-loading .btn-label-busy-hide {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pulsanti icona (tema, audio, schermo intero) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  color: var(--toggle-color);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.icon-btn:hover {
  background: var(--toggle-hover);
  color: var(--text-h);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* Icone a due stati: il CSS mostra quella giusta */
.dark [data-icon="sun"],
:root:not(.dark) [data-icon="moon"],
.is-muted [data-icon="sound"],
:root:not(.is-muted) [data-icon="muted"],
.is-fullscreen [data-icon="expand"],
:root:not(.is-fullscreen) [data-icon="shrink"] {
  display: none;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.1em 0.45em;
  border-radius: 0.35em;
  border: 1px solid currentColor;
  font-family: inherit;
  font-size: 0.72em;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  opacity: 0.6;
}

/* ── Moduli (stessi del linktree) ──────────────────────────── */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--form-label);
  margin-bottom: 6px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--input-color);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms ease, background 150ms ease;
  color-scheme: light;
}

.dark .form-input {
  color-scheme: dark;
}

.form-input::placeholder {
  color: var(--input-ph);
}

.form-input:focus {
  border-color: var(--input-focus-bdr);
  background: var(--input-focus-bg);
}

/* ── Messaggi ──────────────────────────────────────────────── */
.msg-error,
.msg-warn,
.msg-ok {
  font-size: 13px;
  line-height: 1.5;
  border-radius: 10px;
  padding: 10px 13px;
}

.msg-error {
  color: var(--err);
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.msg-warn {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.msg-ok {
  color: var(--text-h);
  background: var(--area-on-bg);
  border: 1px solid var(--area-on-border);
}

/* ── Loader (dal linktree) ─────────────────────────────────── */
#pageLoader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--bg);
  transition: opacity 350ms ease;
}

#pageLoader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(10, 102, 194, 0.15);
  border-top-color: #0a66c2;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.dark .loader-spinner {
  border-color: rgba(77, 184, 255, 0.20);
  border-top-color: #4db8ff;
}

/* ── Dialog di conferma (dal privacy dialog del linktree) ──── */
.pd-wrap {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 200ms ease;
}

.pd-sheet {
  position: relative;
  width: 460px;
  max-width: 90vw;
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--dropdown-bg);
  border: 1px solid var(--dropdown-border);
  border-radius: 20px;
  box-shadow: 0 12px 56px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: scale(0.95);
  transition: transform 200ms ease, opacity 200ms ease;
}

.pd-wrap.pd-visible .pd-overlay,
.pd-wrap.pd-visible .pd-sheet {
  opacity: 1;
}

.pd-wrap.pd-visible .pd-sheet {
  transform: scale(1);
}

.pd-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-h);
}

.pd-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-sub);
}

.pd-body strong {
  color: var(--text-h);
}

.pd-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.pd-actions .btn {
  flex: 1;
  padding: 13px;
}

.pd-actions .btn:last-child {
  flex: 1.5;
}

/* ── Coriandoli ────────────────────────────────────────────── */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 800;
  pointer-events: none;
}
