:root {
  --bg: #F4F8FC;
  --bg-soft: #E8F1FA;
  --surface: #FFFFFF;
  --panel: #FFFFFF;
  --line: #D4E4F4;
  --text: #0F2B4A;
  --muted: #4A6A8A;
  --muted-2: #8AA4BE;
  --brand: #1565C0;
  --brand-2: #0A1F3C;
  --brand-mid: #1E3A5F;
  --cyan: #4ECEF5;
  --cyan-soft: rgba(78, 206, 245, 0.14);
  --ok: #059669;
  --ok-bg: rgba(5, 150, 105, 0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 28px rgba(10, 31, 60, 0.08);
  --shadow-sm: 0 1px 3px rgba(10, 31, 60, 0.08);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --container: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(21, 101, 192, 0.08), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(78, 206, 245, 0.08), transparent 50%),
    linear-gradient(180deg, #F7FAFD, var(--bg));
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color .2s ease; }
a:hover { color: #0d4a94; }
button, .card-art, .nav-item { cursor: pointer; }
:focus-visible {
  outline: 2px solid rgba(21, 101, 192, 0.55);
  outline-offset: 2px;
}

.view { display: none; min-height: 100vh; }
.view.active { display: block; }

.brand-row { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-row.compact { margin-bottom: 28px; }
.brand-logo {
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  object-fit: contain;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.brand-logo.sm { width: 36px; height: 40px; }
.brand-name {
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--brand-2);
}
.brand-tag { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ——— LOGIN ——— */
.login-shell {
  min-height: calc(100vh - 280px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.login-panel {
  padding: clamp(32px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
}
.login-panel h1 {
  font-weight: 700;
  font-size: clamp(1.85rem, 3.5vw, 2.55rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--brand-2);
}
.lede { color: var(--muted); margin: 0 0 28px; line-height: 1.55; font-size: 1.02rem; }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, textarea:focus {
  outline: none;
  border-color: rgba(21, 101, 192, 0.55);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(21, 101, 192, 0.22);
}
.btn.primary:hover { background: #1257a8; }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--bg-soft); border-color: #b9cfe3; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 18px; }
.hint.center { text-align: center; margin-top: 4px; }

.login-visual {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(10, 31, 60, 0.88), rgba(21, 101, 192, 0.55)),
    url("assets/og.jpg") center/cover;
  display: grid;
  place-items: center;
  min-height: 100%;
}
.login-visual-inner { position: relative; z-index: 1; padding: 32px; }
.login-card-float {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: 0 20px 50px rgba(10, 31, 60, 0.28);
  display: grid;
  gap: 8px;
  min-width: 280px;
  max-width: 340px;
}
.login-card-float strong {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-2);
}
.login-card-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
}
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(21, 101, 192, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }

/* ——— APP SHELL ——— */
#view-app.active {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.sidebar {
  background: var(--brand-2);
  color: #B8D0E8;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar .brand-name { color: #F0F7FF; }
.sidebar .brand-tag { color: #8AA4BE; }
.sidebar .brand-logo { border-color: transparent; }
.nav { display: grid; gap: 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  color: #8AA4BE;
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s ease, color .2s ease;
}
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #F0F7FF;
}
.nav-item.active {
  background: rgba(78, 206, 245, 0.14);
  color: #F0F7FF;
}
.sidebar-foot { margin-top: auto; padding-top: 16px; }
.sidebar-foot .btn.ghost {
  width: 100%;
  color: #B8D0E8;
  border-color: rgba(255, 255, 255, 0.14);
}
.sidebar-foot .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.app-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}
.main {
  flex: 1;
  padding: 24px clamp(16px, 3vw, 36px) 8px;
  max-width: 1200px;
  width: 100%;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.topbar h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  color: var(--brand-2);
}
.muted { color: var(--muted); margin: 6px 0 0; font-size: 0.95rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-dot {
  font-size: 12px;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid rgba(5, 150, 105, 0.2);
  padding: 6px 10px;
  border-radius: 999px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #2D8AC9);
  font-weight: 700; font-size: 12px; color: #fff;
}

.page { display: none; animation: fade .22s ease; }
.page.active { display: block; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat span { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat strong {
  font-size: 1.85rem;
  margin-top: 8px;
  display: block;
  letter-spacing: -0.03em;
  color: var(--brand-2);
}
.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.panel h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--brand-2);
}
.panel.accent {
  background:
    linear-gradient(180deg, rgba(21, 101, 192, 0.05), transparent 55%),
    var(--surface);
  border-color: #c5daf0;
}
.timeline, .steps, .checklist {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}
.timeline li, .steps li, .checklist li { margin-bottom: 8px; }
.timeline strong, .steps strong { color: var(--text); }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
.check input { width: auto; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--ok-bg);
  border: 1px solid rgba(5, 150, 105, 0.22);
  color: var(--text);
}
.result.hidden { display: none; }

.passport-card .body-sm { color: var(--muted); line-height: 1.55; font-size: 0.92rem; }
.kv { display: grid; gap: 10px; margin: 16px 0; }
.kv > div {
  display: flex; justify-content: space-between; gap: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.kv dt { color: var(--muted); font-size: 0.92rem; }
.kv dd { margin: 0; font-weight: 500; }
.chain-box { display: grid; gap: 10px; margin-bottom: 16px; }
.chain-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--line); color: var(--muted); font-size: 0.92rem;
}
.chain-row strong { color: var(--text); font-weight: 600; }

.ar-hero p { color: var(--muted); line-height: 1.6; }
.ar-preview { display: grid; align-content: start; gap: 12px; }
.ar-photo {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0f172a;
}
.ar-photo img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
.hud {
  position: absolute;
  left: 18px; top: 18px;
  display: grid; gap: 5px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10, 31, 60, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #F0F7FF;
  backdrop-filter: blur(8px);
  opacity: .45;
  transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
  max-width: min(70%, 240px);
  pointer-events: none;
}
.ar-preview.live .hud { opacity: 1; transform: none; }
.hud-line { font-size: 10px; letter-spacing: .14em; color: var(--cyan); font-weight: 700; }
.hud-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.hud-meta { color: #cbd5e1; font-size: 12px; }
.hud-hash { color: #7DDCF8 !important; }
.hud-hint { margin-top: 6px; font-size: 11px; color: #93c5fd; }

.catalog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card-art {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.card-art:hover {
  border-color: #b7d0e8;
  box-shadow: var(--shadow);
}
.card-art .thumb {
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: #dbe7f3;
}
.pp-thumb {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin: 10px 0 12px;
  display: block;
  border: 1px solid var(--line);
}
.card-art .body { padding: 14px 16px 16px; }
.card-art h4 { margin: 0 0 4px; font-size: 1rem; color: var(--brand-2); }
.card-art p { margin: 0; color: var(--muted); font-size: 13px; }
.card-art .mono { margin-top: 6px; display: inline-block; }

/* ——— FOOTER (allineato a dropchain.it) ——— */
.site-footer {
  background: var(--brand-2);
  color: #B8D0E8;
  padding-top: 40px;
  margin-top: auto;
}
.login-footer { margin-top: 0; }
.dc-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.dc-footer {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dc-footer__logo {
  display: block;
  height: 42px;
  width: auto;
  background: #fff;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 10px;
}
.dc-footer__brand-desc {
  font-size: 0.9rem;
  color: #8AA4BE;
  line-height: 1.6;
  margin: 0 0 8px;
}
.dc-footer__heading {
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.dc-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dc-footer__links li { margin-bottom: 0.5rem; }
.dc-footer__links a {
  color: #8AA4BE;
  font-size: 0.9rem;
  transition: color .2s ease;
}
.dc-footer__links a:hover { color: var(--cyan); }
.dc-footer__contact-line { margin-top: 0.7rem; }
.dc-footer__contact-line:first-of-type { margin-top: 1.1rem; }
.dc-footer__contact-line a {
  color: var(--cyan);
  font-size: 0.9rem;
}
.dc-footer__contact-line a:hover { color: #fff; }
.dc-footer__pec-label { color: #8AA4BE; margin-right: 4px; font-size: 0.9rem; }
.dc-footer__address {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  line-height: 1.5;
}
.dc-footer__muted { color: #8AA4BE; font-size: 0.85rem; }
.dc-footer__funds {
  display: flex;
  justify-content: center;
  padding: 18px 24px 8px;
}
.dc-footer__funds img {
  display: block;
  width: min(420px, 72vw);
  height: auto;
  opacity: 0.95;
}
.dc-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0 22px;
  font-size: 0.85rem;
  color: #8AA4BE;
}
.dc-footer__legal { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.dc-footer__legal a { color: #8AA4BE; font-size: 0.85rem; }
.dc-footer__legal a:hover { color: var(--cyan); }

/* ——— FOOTER COMPATTO (post-login / SaaS) ——— */
.app-footer {
  padding-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.app-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 14px 0;
  font-size: 0.8rem;
  color: #8AA4BE;
}
.app-footer__left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.app-footer__copy { color: #B8D0E8; font-weight: 500; }
.app-footer__sep { opacity: 0.5; }
.app-footer__meta { color: #8AA4BE; font-size: 0.75rem; }
.app-footer__links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.app-footer__links a {
  color: #8AA4BE;
  font-size: 0.8rem;
  transition: color .15s ease;
}
.app-footer__links a:hover { color: var(--cyan); }

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .login-shell, #view-app.active, .grid-2, .stats, .catalog, .form-grid, .dc-footer {
    grid-template-columns: 1fr;
  }
  .login-visual { min-height: 240px; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  #view-app.active { display: block; }
  .nav { grid-template-columns: 1fr 1fr; }
  .dc-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
  .dc-footer__funds img { width: min(340px, 88vw); }
  .app-footer__row {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
  .app-footer__left { justify-content: center; }
  .app-footer__links { justify-content: center; }
}

@media (max-width: 640px) {
  .nav { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .catalog { grid-template-columns: 1fr; }
}
