/* ZENVARA theme — gnosis-inspired teal, distinct layout from legacy gold UI */
:root {
  --zv-bg: #021a18;
  --zv-bg-2: #04201e;
  --zv-accent: #2dd4bf;
  --zv-glow: #0d9488;
  --zv-accent-rgb: 45, 212, 191;
  --zv-text: #ffffff;
  --zv-muted: #99f6e4;
  --zv-card: rgba(6, 44, 42, 0.65);
  --zv-border: rgba(13, 148, 136, 0.35);
  --zv-font: "Sora", "Segoe UI", sans-serif;
  --zv-mono: "JetBrains Mono", ui-monospace, monospace;
}

html, body.tw, body.panel-body {
  background: radial-gradient(1200px 600px at 20% -10%, rgba(45, 212, 191, 0.12), transparent 55%),
              radial-gradient(900px 500px at 90% 10%, rgba(13, 148, 136, 0.18), transparent 50%),
              var(--zv-bg) !important;
  color: var(--zv-text);
  font-family: var(--zv-font);
}

body.tw .tw-aurora span {
  background: radial-gradient(circle, rgba(var(--zv-accent-rgb), 0.35), transparent 70%) !important;
}

body.tw .tw-nav,
body.tw .tw-nav__inner {
  background: rgba(2, 26, 24, 0.85) !important;
  border-color: var(--zv-border) !important;
  backdrop-filter: blur(14px);
}

body.tw .tw-brand__text,
body.tw .tw-brand__text em {
  color: var(--zv-text) !important;
  font-style: normal;
}
body.tw .tw-brand__text em { color: var(--zv-accent) !important; }

body.tw .tw-btn--primary,
body.tw .tw-btn--base,
.auth-btn,
.btn--base-two,
.btn-primary {
  background: linear-gradient(135deg, var(--zv-accent), var(--zv-glow)) !important;
  border: none !important;
  color: #04201e !important;
  box-shadow: 0 0 24px rgba(var(--zv-accent-rgb), 0.35);
  border-radius: 12px !important;
  font-weight: 700;
}

body.tw .tw-btn--ghost,
.auth-btn--ghost {
  border: 1px solid var(--zv-accent) !important;
  color: var(--zv-muted) !important;
  background: transparent !important;
  border-radius: 12px !important;
}

body.tw .tw-grad,
body.tw .tw-block__k,
body.tw a.tw-link {
  color: var(--zv-accent) !important;
  background: none !important;
  -webkit-text-fill-color: var(--zv-accent) !important;
}

body.tw .tw-card,
body.tw .tw-fact,
body.tw .tw-table-wrap,
body.tw .tw-note,
.panel-card,
.admin-card,
.auth-card,
.stat-card {
  background: var(--zv-card) !important;
  border: 1px solid var(--zv-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.05), 0 20px 50px rgba(0, 0, 0, 0.35) !important;
  color: var(--zv-text) !important;
}

body.tw .tw-table th {
  color: var(--zv-muted) !important;
  border-color: var(--zv-border) !important;
}
body.tw .tw-table td,
.table {
  border-color: rgba(13, 148, 136, 0.2) !important;
  color: var(--zv-text) !important;
}

body.tw .tw-toc a,
body.tw .tw-nav__links a,
body.tw .tw-lead,
.text-secondary {
  color: var(--zv-muted) !important;
}

.panel-shell,
.panel-sidebar,
.panel-topbar {
  background: rgba(2, 26, 24, 0.96) !important;
  border-color: var(--zv-border) !important;
}

.panel-sidebar a,
.panel-nav a {
  color: var(--zv-muted) !important;
}
.panel-sidebar a.is-active,
.panel-nav a.is-active,
.panel-sidebar a:hover {
  color: var(--zv-accent) !important;
  background: rgba(45, 212, 191, 0.08) !important;
}

.form-control, .auth-field input, .auth-field select {
  background: rgba(4, 32, 30, 0.9) !important;
  border: 1px solid var(--zv-border) !important;
  color: var(--zv-text) !important;
  border-radius: 10px !important;
}

.badge.bg-success { background: var(--zv-glow) !important; }
.badge.bg-secondary { background: #134e4a !important; }

body.tw .tw-footer,
.auth-copyright {
  color: var(--zv-muted) !important;
  border-color: var(--zv-border) !important;
}

/* ---------- Decentralized protocol visuals ---------- */
.zv-hero-decentral {
  position: relative;
  overflow: hidden;
}

.zv-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

.zv-mesh__line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.45), transparent);
  transform-origin: left center;
  animation: zv-line-drift 14s var(--ease, ease-in-out) infinite;
}

.zv-mesh__line--a { top: 28%; left: 8%; width: 42%; animation-delay: 0s; }
.zv-mesh__line--b { top: 58%; left: 38%; width: 48%; animation-delay: -4s; transform: rotate(-12deg); }
.zv-mesh__line--c { top: 72%; left: 12%; width: 36%; animation-delay: -7s; transform: rotate(8deg); }

.zv-mesh__node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--zv-accent);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15), 0 0 18px rgba(45, 212, 191, 0.55);
  animation: zv-node-breathe 3.6s ease-in-out infinite;
}

.zv-mesh__node--pulse {
  animation: zv-node-pulse 2.4s ease-out infinite;
}

@keyframes zv-line-drift {
  0%, 100% { opacity: 0.35; filter: blur(0); }
  50% { opacity: 0.85; filter: blur(0.2px); }
}

@keyframes zv-node-breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.35); opacity: 1; }
}

@keyframes zv-node-pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.55); }
  70% { box-shadow: 0 0 0 18px rgba(45, 212, 191, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}

.zv-protocol-vis {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  margin-inline: auto;
  display: grid;
  place-items: center;
}

.zv-protocol-vis__ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px dashed rgba(45, 212, 191, 0.35);
  animation: zv-spin-slow 48s linear infinite;
}

.zv-protocol-vis__ring span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--zv-accent);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.6);
}

.zv-protocol-vis__ring span:nth-child(1) { top: -5px; left: 50%; margin-left: -5px; }
.zv-protocol-vis__ring span:nth-child(2) { bottom: 18%; right: -5px; background: #5eead4; }
.zv-protocol-vis__ring span:nth-child(3) { bottom: -5px; left: 28%; background: #99f6e4; }

.zv-protocol-vis__hub {
  position: relative;
  z-index: 2;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: radial-gradient(circle at 40% 30%, rgba(45, 212, 191, 0.22), rgba(2, 26, 24, 0.95) 70%);
  border: 1px solid rgba(45, 212, 191, 0.45);
  box-shadow: 0 0 40px rgba(13, 148, 136, 0.35), inset 0 0 30px rgba(45, 212, 191, 0.08);
  animation: zv-hub-glow 4s ease-in-out infinite;
}

.zv-protocol-vis__hub img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.zv-protocol-vis__hub strong {
  font-family: var(--zv-font);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
}

.zv-protocol-vis__hub small {
  color: var(--zv-muted);
  font-family: var(--zv-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.zv-protocol-vis__sat {
  position: absolute;
  z-index: 3;
  min-width: 78px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(4, 32, 30, 0.88);
  border: 1px solid rgba(45, 212, 191, 0.35);
  backdrop-filter: blur(10px);
  text-align: center;
  animation: zv-sat-float 5.5s ease-in-out infinite;
}

.zv-protocol-vis__sat em {
  display: block;
  font-style: normal;
  font-family: var(--zv-mono);
  font-size: 0.65rem;
  color: var(--zv-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.zv-protocol-vis__sat b {
  font-size: 0.95rem;
  color: var(--zv-accent);
}

.zv-protocol-vis__sat--1 { top: 6%; left: 4%; animation-delay: 0s; }
.zv-protocol-vis__sat--2 { top: 10%; right: 0; animation-delay: -1.2s; }
.zv-protocol-vis__sat--3 { bottom: 14%; left: 0; animation-delay: -2.4s; }
.zv-protocol-vis__sat--4 { bottom: 8%; right: 4%; animation-delay: -3.1s; }

@keyframes zv-spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes zv-hub-glow {
  0%, 100% { box-shadow: 0 0 28px rgba(13, 148, 136, 0.3), inset 0 0 24px rgba(45, 212, 191, 0.06); }
  50% { box-shadow: 0 0 48px rgba(45, 212, 191, 0.45), inset 0 0 36px rgba(45, 212, 191, 0.12); }
}

@keyframes zv-sat-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.zv-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  counter-reset: none;
}

.zv-step {
  position: relative;
  padding: 22px 20px 24px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(6, 44, 42, 0.55), rgba(2, 26, 24, 0.4));
  border: 1px solid rgba(13, 148, 136, 0.28);
  overflow: hidden;
}

.zv-step::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--zv-accent), transparent);
  opacity: 0.7;
  transform: scaleX(0.4);
  transform-origin: left;
  transition: transform 0.45s ease;
}

.zv-step:hover::after { transform: scaleX(1); }

.zv-step__n {
  display: inline-block;
  margin-bottom: 12px;
  font-family: var(--zv-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--zv-accent);
}

.zv-step h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.zv-step p {
  margin: 0;
  color: var(--zv-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

@media (max-width: 960px) {
  .zv-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .zv-steps { grid-template-columns: 1fr; }
  .zv-protocol-vis { max-width: 320px; }
  .zv-protocol-vis__sat { min-width: 68px; padding: 8px 10px; }
  .zv-protocol-vis__hub { width: 132px; height: 132px; }
}
