/* ==================================================
   SCAVEZZON ID — Viewer
   File: public/css/viewer.css
   Stili base, componenti, layout responsive e footer.
   ================================================== */
:root {
  --bg: #000;
  --ink: #fff;
  --muted: rgba(255,255,255,.72);
  --line: rgba(255,255,255,.16);
  --line-strong: rgba(255,255,255,.26);
  --card: #0b0b0b;
  --well: #0f0f0f;
  --input: #0e0e0e;
  --gloss: rgba(255,255,255,.08);
  --gloss-2: rgba(255,255,255,.12);
  --accent: #fff;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-outer: 0 14px 46px rgba(0,0,0,.65);
  --shadow-inner: inset 0 0 44px rgba(255,255,255,.06);
}

/* Auto-LIGHT se il sistema è chiaro e l'utente NON ha forzato dark */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff;
    --ink: #000000;
    --muted: rgba(0,0,0,.65);
    --line: rgba(0,0,0,.10);
    --line-strong: rgba(0,0,0,.20);
    --card: #f7f7f7;
    --well: #f0f0f0;
    --input: #f5f5f5;
    --accent: #000;
    --shadow-outer: 0 8px 26px rgba(0,0,0,.10);
    --shadow-inner: inset 0 0 26px rgba(0,0,0,.03);
  }
}

/* Forza DARK manuale */
html[data-theme="dark"] {
  --bg: #000;
  --ink: #fff;
  --muted: rgba(255,255,255,.72);
  --line: rgba(255,255,255,.16);
  --line-strong: rgba(255,255,255,.26);
  --card: #0b0b0b;
  --well: #0f0f0f;
  --input: #0e0e0e;
  --accent: #fff;
  --shadow-outer: 0 14px 46px rgba(0,0,0,.65);
  --shadow-inner: inset 0 0 44px rgba(255,255,255,.06);
}

/* Forza LIGHT manuale */
html[data-theme="light"] {
  --bg: #ffffff;
  --ink: #000000;
  --muted: rgba(0,0,0,.65);
  --line: rgba(0,0,0,.10);
  --line-strong: rgba(0,0,0,.20);
  --card: #f7f7f7;
  --well: #f0f0f0;
  --input: #f5f5f5;
  --accent: #000;
  --shadow-outer: 0 8px 26px rgba(0,0,0,.10);
  --shadow-inner: inset 0 0 26px rgba(0,0,0,.03);
}

/* ---------- Base ---------- */
*,*::before,*::after{ box-sizing:border-box; }
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;   /* ← blocca il movimento laterale */
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Layout due colonne ---------- */
.verify-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 18px 18px;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 24px;
  align-items: stretch;
}

@media (max-width:1024px) {
  .verify-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* ---------- Nav + Toggle tema ---------- */
.nav-home {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 18px;
  margin-bottom: -6px;
  background: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,0));
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* in modalità chiara alleggeriamo il gradiente */
html[data-theme="light"] .nav-home {
  background: linear-gradient(to bottom,
  rgba(255,255,255,.96),
  rgba(255,255,255,0)
  );
}

/* Testo pulsanti più leggibile in modalità chiara */
html[data-theme="light"] .grad-txt {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: #111;
  color: #111;
  text-shadow: none;
}

.home-link {
  color: var(--ink);
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: inline-block;
  background: transparent;
  box-shadow: none;
}

.home-link:hover {
  background: rgba(0,0,0,.06);
  border-color: var(--line-strong);
}

/* Toggle tema ☾ / ☀︎ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
  box-shadow: none;
}

.theme-toggle:hover {
  background: rgba(0,0,0,.06);
}

/* Icone come testo monocromatico (no emoji colorate) */
.theme-icon {
  font-family: "Segoe UI Symbol","Noto Sans Symbols","Apple Symbols",system-ui,sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  text-shadow: none;
  filter: grayscale(1);
}

/* Mostra ☾ in dark / default */
html:not([data-theme]) .theme-icon-moon,
html[data-theme="dark"] .theme-icon-moon {
  display: inline;
}

html:not([data-theme]) .theme-icon-sun,
html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

/* Mostra ☀︎ in light */
html[data-theme="light"] .theme-icon-moon {
  display: none;
}

html[data-theme="light"] .theme-icon-sun {
  display: inline;
}

/* ---------- Pannelli ---------- */
.left-panel,
.right-panel {
  background: linear-gradient(180deg, var(--card), var(--well));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-outer), var(--shadow-inner);
  padding: 18px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- Brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-title {
  margin: 0;
  font-size: clamp(22px,2.3vw,30px);
  letter-spacing: .02em;
}

.brand-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

/* Messaggio info sotto al brand */
#infoMessageLeft.info-left {
  margin-top: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: 
  linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)),
  var(--card);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  padding: 8px 10px;
  color: var(--ink);
  font-size: 0.90rem;
  line-height: 1.25;
  /* effetto "scheda che si apre" */
  transform-origin: top;
  animation: infoDrop .18s ease-out;
  transition: opacity .32s ease, transform .32s ease;
}

#infoMessageLeft.info-left.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
}

@keyframes infoDrop {
  from{ transform: translateY(-6px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

/* ---------- Scheda form ---------- */
.form-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  background: 
  linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)),
  var(--card);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
}

.section-title {
  margin: 6px 0 6px;
  font-weight: 800;
}

/* ---------- Form ---------- */
#tokenForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#contractSelect,
#modelDisplay,
#tokenId,
#frameNumber {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--input);
  color: var(--ink);
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: border-color .18s, box-shadow .18s, background .18s;
}

#modelDisplay {
  min-height: 46px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  cursor: default;
  line-height: 1.25;
}

.model-display-base {
  font-weight: 500;
  letter-spacing: 0.01em;
}

.model-display-mod {
  font-weight: 400;
  opacity: .78;
  margin-left: 14px;
  margin-right: 5px;
}

.model-display-name {
  font-weight: 800;
  letter-spacing: 0.01em;
}

/* Nasconde davvero il select originale */
#contractSelect {
  display: block;
}

.hidden-select {
  display: none !important;
}

/* Il box modello resta visibile ma non deve essere apribile manualmente */
#contractSelect.is-readonly {
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
}

#contractSelect:focus,
#tokenId:focus,
#frameNumber:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,255,255,.14), inset 0 1px 0 rgba(255,255,255,.08);
}

.inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width:560px) {
  .inputs-row{ grid-template-columns:1fr; }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#previewButton,
#propertyButton {
  width: 100%;
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .18s, transform .06s, border-color .18s, background .18s, box-shadow .18s;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  color: #000;
  background: linear-gradient(180deg, #ffffff, #e9e9e9);
  border-color: #fff;
  box-shadow: 
  0 12px 26px rgba(0,0,0,.16),
  inset 0 0 0 1px rgba(0,0,0,.06);
}

.btn.primary:hover {
  filter: brightness(1.03);
}

.btn.ghost {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

.btn.ghost:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.02));
}

.btn.small {
  padding: 8px 10px;
  font-size: .8rem;
}

/* ---------- Card NFT (destra) ---------- */
.nft-card {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--well));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-outer), var(--shadow-inner);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow: hidden;
}

.nft-inner {
  width: 100%;
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* niente "respiro" */
.nft-card.breathing{ animation:none !important; }

/* griglia interna */
.nft-flex {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: start;
  flex: 1 1 auto;
}

@media (max-width:900px) {
  .nft-flex{ grid-template-columns:1fr; }
}

/* media box */
.nft-media {
  display: none;
  width: 100%;
  height: auto;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)), var(--well);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 44px rgba(255,255,255,.06), 0 0 0 1px rgba(255,255,255,.04);
}

.nft-media.has-media {
  display: block;
}

.nft-media model-viewer {
  width: 100%;
  height: 100%;
  display: block;
}

.nft-media:empty {
  display: none;
}

/* L’immagine riempie tutto il box, senza bordo interno */
.nft-media.has-media img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  filter: brightness(1.08) contrast(1.08) saturate(1.12);
}

.nft-media.has-media video {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain; /* mantiene proporzioni */
  object-position: center;
  image-rendering: auto;
  filter: brightness(1.08) contrast(1.08) saturate(1.12);
}

/* titoli sotto media */
.title-under-media {
  display: none;
  text-align: center;
  margin-top: 8px;
}

#titlePrimary {
  font-weight: 900;
  font-size: clamp(18px,2.1vw,26px);
  letter-spacing: .01em;
}

#titleSecondary {
  margin-top: 2px;
  color: var(--muted);
  font-size: .95rem;
}

/* specifiche */
.nft-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.spec-vertical {
  display: grid;
  gap: 10px;
  grid-auto-rows: min-content;
  overflow: auto;
}

.spec {
  display: block;
  padding: 8px 2px;
  border-bottom: 1px dashed var(--line);
}

.spec:last-child {
  border-bottom: none;
}

.spec-k {
  display: block;
  font-size: .78rem;
  letter-spacing: .06em;
  opacity: .65;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.spec-v {
  display: block;
  font-weight: 850;
  font-size: 1rem;
  color: var(--ink);
}

/* ---------- Placeholder: media e logo centrale ---------- */
#nftPlaceholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  opacity: 1;
  pointer-events: none;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* Placeholder immagine: logo completo senza ritagli */
img#nftPlaceholder {
  object-fit: contain;
  transform: scale(0.70) !important;
  transform-origin: center;
}

.hidden {
  display: none !important;
}

/* ---------- Footer ---------- */
.verify-footer {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
}

.verify-footer__by {
  font-size: .75rem;
  letter-spacing: .02em;
}

.verify-footer a {
  color: var(--ink);
  font-weight: 900;
  border-bottom: 1px solid transparent;
}

.verify-footer a:hover {
  border-bottom-color: var(--ink);
}

/* ---------- Social footer ---------- */
.social-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 6px;
}

.social-footer__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

.social-footer__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.social-footer__icon:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0,0,0,.45);
  border-color: var(--accent);
  background: var(--well);
}

/* ---------- Overlay video ---------- */
#introVideoOverlay {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)), var(--well);
  box-shadow: inset 0 0 44px rgba(255,255,255,.06), 0 0 0 1px rgba(255,255,255,.04);
  z-index: 2;
  pointer-events: auto;
  object-fit: contain;
}

@media (min-width:900px) {
  #introVideoOverlay {
    top: 50%;
    transform: translate(-50%, -50%);
    max-height: calc(100% - 40px);
  }
}

/* ---------- Info button ---------- */
.brand {
  position: relative;
  padding-right: 52px;
}

.info-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  color: #000;
  background: #fff;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0,0,0,.25), inset 0 0 0 1px rgba(0,0,0,.10);
  text-decoration: none;
  transition: transform .08s, filter .18s, box-shadow .18s, background .18s;
}

.info-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0,0,0,.30), inset 0 0 0 1px rgba(0,0,0,.12);
}

.info-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width:560px) {
  .brand{ padding-right:44px; }
  .info-btn {
    width: 30px;
    height: 30px;
    font-size: 16px;
    top: 8px;
    right: 8px;
  }
}

/* ---------- Layout responsive: tablet ---------- */
@media (min-width:601px) and (max-width:1024px) {
  #resultCard:not(.has-result) {
    width: 100%;
    min-height: 420px;
    flex: none;
    overflow: hidden;
  }
  #resultCard:not(.has-result) .nft-inner {
    padding: 0;
  }
  #resultCard:not(.has-result) .nft-flex {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 420px;
    margin: 0;
    padding: 0;
    gap: 0;
  }
  #resultCard:not(.has-result) #nftPlaceholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
  }
  /* Logo completo senza ritagli */
  #resultCard:not(.has-result) img#nftPlaceholder {
    object-fit: contain;
    object-position: center;
  }
}

/* ---------- Layout responsive: smartphone ---------- */
@media (max-width:600px) {
  #resultCard:not(.has-result) {
    width: 100%;
    min-height: 25vh;
    flex: none;
    overflow: hidden;
  }
  #resultCard:not(.has-result) .nft-inner {
    padding: 0 !important;
  }
  #resultCard:not(.has-result) .nft-flex {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 130px;
    margin: 0;
    padding: 0;
    gap: 0;
  }
  #resultCard:not(.has-result) #nftContainer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
  }
  #resultCard:not(.has-result) #nftPlaceholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    opacity: 1;
    object-fit: cover;
    object-position: center;
    transform: none;
  }
  /* Logo completo senza ritagli */
  #resultCard:not(.has-result) img#nftPlaceholder {
    object-fit: contain;
    object-position: center;
  }
  #resultCard:not(.has-result) .nft-media {
    display: none;
  }
  #resultCard.has-result {
    min-height: unset;
  }
}

/* ---------- QR actions ---------- */
.mobile-only {
  display: none;
}

@media (max-width:768px) {
  .mobile-only {
    display: block;
  }
}

.qr-actions {
  display: none;
  margin-top: 4px;
  gap: 8px;
}

.qr-actions .btn {
  flex: 1;
  text-align: center;
}

@media (max-width:768px) {
  .qr-actions {
    display: flex;
  }
}

/* ---------- QR overlay ---------- */
.qr-reader.hidden {
  display: none;
}

.qr-reader {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.qr-reader-inner {
  width: 90vw;
  max-width: 420px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-outer), var(--shadow-inner);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#qrReader {
  width: 100%;
  min-height: 260px;
}

/* ---------- Gradiente testo ---------- */
.grad-txt {
  background: linear-gradient(135deg, #fff 0%, #dcdcdc 55%, #c7c7c7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 0 10px rgba(255,255,255,.12), 0 0 18px rgba(255,255,255,.10);
}

.btn:hover .grad-txt {
  filter: brightness(1.06);
}

/* ---------- Hint tooltip ---------- */
.hint {
  margin-top: 6px;
  max-width: 520px;
}

.hint-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
  border: none;
  background: transparent;
}

.hint-toggle .arrow {
  display: inline-block;
  width: 14px;
  text-align: center;
  transition: transform .18s;
  font-size: .8rem;
}

.hint-bubble {
  display: none;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  box-shadow: 0 12px 26px rgba(0,0,0,.35);
  line-height: 1.5;
  font-size: .8rem;
  color: var(--muted);
}

.hint-bubble strong {
  font-weight: 700;
}

.hint-bubble.is-visible {
  display: block;
}

/* ---------- Focus visibile ---------- */
:where(button,[type="button"],select,input,a):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* STOLEN banner (viewer) */
#nftContainer {
  position: relative;
}

.badge-stolen {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  z-index: 5;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  border-radius: 0;
  background: rgba(185,35,35,.25);
  border-top: 1px solid rgba(255,80,80,.65);
  border-bottom: 1px solid rgba(255,80,80,.65);
  border-left: 0;
  border-right: 0;
  color: #ff8b8b;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: .38em;
  text-transform: uppercase;
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  box-shadow: none;
  text-shadow: 0 0 12px rgba(255,70,70,.22);
}

/* Input dentro spec (per MINT / compilazione) */
.spec-input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  color: inherit;
  padding: 0;
}

.spec-input::placeholder {
  opacity: .6;
}

@media (max-width:600px) {
  .spec {
    padding: 6px 0;
  }
  .spec-v {
    font-size: .98rem;
  }
}

.iconSvg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.iconImg {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
  /* tema light: normale */
  filter: none;
}

/* tema dark: forzo l’icona a bianco (funziona bene se l’icona è scura/monocromatica) */
html[data-theme="dark"] .iconImg {
  filter: brightness(0) invert(1);
}

/* Messaggio in alto a destra su telefono orizzontale e tablet */
@media (min-width: 601px) and (max-width: 1024px) {
  #resultCard:not(.has-result) .nft-flex {
    position: relative;
  }
  #resultCard:not(.has-result) .nft-side {
    position: absolute;
    top: 10px;
    right: 12px;
    left: auto;
    bottom: auto;
    z-index: 3;
    width: auto;
    max-width: 45%;
  }
  #resultCard:not(.has-result) #notFoundMessage {
    margin: 0 !important;
    text-align: right;
    line-height: 1.25;
  }
}

/* NOT FOUND: solo testo, niente box */
#notFoundMessage {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  /* stile testo */
  color: var(--muted) !important;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  margin-top: 12px;
}

@media (max-width:600px) {
  #resultCard:not(.has-result) .nft-flex {
    position: relative;
    min-height: 130px;
  }
  #resultCard:not(.has-result) .nft-side {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    z-index: 2;
  }
  #resultCard:not(.has-result) #notFoundMessage {
    margin: 0 !important;
    text-align: center;
    line-height: 1.2;
  }
}

/* MOBILE: quattro pulsanti compatti, icona sopra e testo sotto */
@media (max-width: 600px) {
  .qr-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
  }
  .qr-actions .btn {
    min-width: 0;
    width: 100%;
    min-height: 66px;
    padding: 7px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    line-height: 1;
  }
  .qr-actions .btn > i {
    display: block;
    margin: 0;
    font-size: 18px;
    line-height: 1;
  }
  .qr-actions .iconSvg {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .qr-actions .iconImg {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
  }
  .qr-action-label {
    display: block;
    font-size: 9px;
    font-weight: 750;
    line-height: 1.05;
    white-space: nowrap;
  }
}

/* ==================================================
   STORE BUTTONS FOOTER
   Override isolato: non modifica il resto del sito
   ================================================== */
.verify-footer .download-app {
  width: 100%;
  margin: 18px 0 14px;
  text-align: center;
}

.verify-footer .download-app__title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.verify-footer .download-app__subtitle {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.verify-footer .store-buttons {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.verify-footer .store-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  max-width: 160px !important;
  padding: 0;
  margin: 0;
  border: 0 !important;
  border-bottom: 0 !important;
  background: transparent;
  text-decoration: none !important;
}

.verify-footer .store-buttons a:hover {
  border: 0 !important;
  border-bottom: 0 !important;
  text-decoration: none !important;
}

.verify-footer .store-buttons img {
  display: block;
  width: auto !important;
  height: 42px !important;
  max-width: 160px !important;
  max-height: 42px !important;
  margin: 0;
  padding: 0;
  object-fit: contain;
  transition: 
  transform 0.2s ease,
  opacity 0.2s ease;
}

.verify-footer .store-buttons a:hover img {
  transform: scale(1.04);
  opacity: 0.9;
}

@media (max-width: 600px) {
  .verify-footer .store-buttons {
    gap: 8px;
  }
  .verify-footer .store-buttons a {
    max-width: 140px !important;
  }
  .verify-footer .store-buttons img {
    height: 38px !important;
    max-width: 140px !important;
    max-height: 38px !important;
  }
}

/* ---------- Tooltip social ---------- */
.tooltip {
  position: relative;
}

.social-footer__icon.tooltip {
  position: relative;
  overflow: visible;
}

.social-footer__icon.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  white-space: nowrap;
  background: #111827;
  color: #fff;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  transition: opacity .18s ease,
  transform .18s ease;
}

.social-footer__icon.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Intestazione scheda ricerca e logo contratto ---------- */
.search-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-card-header .section-title {
  margin: 0;
}

.search-card-logo {
  width: 55px;
  height: 55px;
  object-fit: contain;
  margin-right: 15px;
  /* Logo nero per tema chiaro */
  content: url("/img/fronte_contratto.png");
}

/* Logo bianco per tema scuro manuale */
html[data-theme="dark"] .search-card-logo {
  content: url("/img/fronte_contratto2.png");
}

/* Tema automatico del dispositivo */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .search-card-logo {
    content: url("/img/fronte_contratto2.png");
  }
}
