/* OpenMintArt — Wallet modal + dropdown */

.wm-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: hsla(240, 22%, 4%, 0.75);
  backdrop-filter: blur(16px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem;
  overflow-y: auto;
  animation: wmFadeIn 200ms var(--ease);
}
.wm-overlay.open { display: flex; }
@keyframes wmFadeIn { from { opacity: 0; } to { opacity: 1; } }

.wm-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: hsl(245, 28%, 11%);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6), 0 0 40px -10px hsla(265, 90%, 60%, 0.3);
  padding: 1.75rem;
  animation: wmSlideUp 280ms var(--ease);
}
@keyframes wmSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wm-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms;
}
.wm-close:hover { background: hsla(245, 30%, 25%, 0.5); color: var(--text); }

.wm-screen {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}

.wm-logo {
  width: 64px; height: 64px;
  margin: 0 auto;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  background: hsl(245, 28%, 16%);
  border: 1px solid var(--border);
}
.wm-logo.mm { background: linear-gradient(135deg, hsl(28, 100%, 55%), hsl(35, 100%, 50%)); }
.wm-logo.wc { background: linear-gradient(135deg, hsl(217, 91%, 60%), hsl(195, 90%, 50%)); }

.wm-title {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin: 0.25rem 0 0;
}
.wm-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  margin: 0 0 0.5rem;
}
.wm-hint {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  margin: 0;
}
.wm-screen.wm-connect .wm-hint { margin: 0 0 0.5rem; }
.wm-foot {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  margin-top: 0.5rem;
  opacity: 0.7;
}
.wm-mono { font-family: var(--mono); font-size: 0.72rem; }

/* Provider picker */
.wm-current {
  background: hsla(265, 90%, 60%, 0.08);
  border: 1px solid hsla(265, 90%, 60%, 0.25);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0.25rem 0 0.5rem;
}
.wm-current-label {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.wm-current-addr {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.wm-current-addr .wd-avatar {
  width: 32px; height: 32px;
  font-size: 0.85rem;
}
.wm-current-addr-text {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.92rem;
}
.wm-current-addr-provider {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

.wm-provider {
  display: flex;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all 180ms var(--ease);
  text-align: left;
  font-family: var(--font);
}
.wm-provider:hover {
  background: var(--surface-3);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.wm-provider-disconnect {
  margin-top: 0.5rem;
  background: transparent;
  border-color: hsla(0, 80%, 60%, 0.25);
}
.wm-provider-disconnect:hover {
  background: hsla(0, 80%, 50%, 0.08);
  border-color: var(--danger);
}
.wm-prov-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.wm-prov-icon.mm { background: linear-gradient(135deg, hsl(28, 100%, 55%), hsl(35, 100%, 50%)); }
.wm-prov-icon.wc { background: linear-gradient(135deg, hsl(217, 91%, 60%), hsl(195, 90%, 50%)); }
.wm-prov-info { display: flex; flex-direction: column; flex: 1; }
.wm-prov-name { font-weight: 600; font-size: 1rem; }
.wm-prov-desc { color: var(--text-dim); font-size: 0.8rem; }
.wm-prov-arrow { color: var(--text-dim); font-size: 1.2rem; }

/* Vault / account list */
.wm-vault {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.5rem 0;
  /* hidden by default — only shown when a real extension exposes multi-account UX.
     For our mock, the dapp shows a single account (mimics eth_requestAccounts). */
  display: none;
}
.wm-account {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: all 160ms;
  text-align: left;
  font-family: var(--font);
}
.wm-account:hover { background: var(--surface-3); border-color: var(--border-strong); }
.wm-account.selected {
  background: hsla(265, 90%, 60%, 0.15);
  border-color: var(--primary);
}
.wm-account.wm-add {
  border-style: dashed;
  color: var(--text-dim);
}
.wm-acc-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: grid; place-items: center;
  color: var(--bg);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.wm-acc-info { display: flex; flex-direction: column; gap: 0.15rem; }
.wm-acc-label { font-weight: 600; font-size: 0.92rem; }
.wm-acc-addr { color: var(--text-dim); font-size: 0.78rem; font-family: var(--mono); }

/* Error inline */
.wm-error {
  background: hsla(0, 80%, 50%, 0.1);
  border: 1px solid hsla(0, 80%, 60%, 0.4);
  color: var(--danger);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: wmFadeIn 200ms ease;
}
.wm-error-icon { font-size: 1.1rem; flex-shrink: 0; }

/* Inputs */
.wm-input {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  width: 100%;
}
.wm-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(265, 90%, 60%, 0.2);
}

/* Buttons */
.wm-btn {
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms;
}
.wm-btn-primary {
  background: var(--grad-primary);
  color: hsl(240, 30%, 8%);
  border: none;
  font-weight: 600;
}
.wm-btn-primary:hover { filter: brightness(1.1); }
.wm-btn-ghost {
  background: transparent;
  color: var(--text);
}
.wm-btn-ghost:hover { background: var(--surface-2); }

/* Signature screen */
.wm-sign-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.wm-sign-row .wm-btn { flex: 1; }
.wm-msg-details {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
}
.wm-msg-details summary {
  cursor: pointer;
  color: var(--text-dim);
  font-weight: 500;
  user-select: none;
}
.wm-msg {
  margin: 0.5rem 0 0;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
}

/* QR */
.wm-qr {
  width: 180px; height: 180px;
  margin: 0 auto;
  background: white;
  padding: 12px;
  border-radius: var(--radius-sm);
}
.wm-qr svg {
  width: 100%; height: 100%;
  display: block;
}
.wm-qr svg rect { fill: black; }

.wm-wc-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.7rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-dim);
}
.wm-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary-2);
  border-radius: 50%;
  animation: wmSpin 800ms linear infinite;
}
@keyframes wmSpin { to { transform: rotate(360deg); } }

/* ── DROPDOWN (post-connect) ─────────────────────── */
.wd-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: hsl(245, 28%, 10%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 0 30px -10px hsla(265, 90%, 60%, 0.25);
  padding: 1rem;
  z-index: 60;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
.wd-panel.open { opacity: 1; transform: translateY(0) scale(1); }

.wd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.wd-account { display: flex; align-items: center; gap: 0.7rem; }
.wd-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--bg);
  font-weight: 700;
}
.wd-addr { font-family: var(--mono); font-size: 0.92rem; font-weight: 500; }
.wd-balance { color: var(--text-dim); font-size: 0.8rem; font-family: var(--mono); margin-top: 0.15rem; }

.wd-copy {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 160ms;
}
.wd-copy:hover { background: var(--surface-3); color: var(--text); }

.wd-section { margin-bottom: 0.75rem; }
.wd-section:last-child { margin-bottom: 0; }
.wd-section-label {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.wd-networks { display: flex; flex-direction: column; gap: 0.25rem; }
.wd-network {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: all 160ms;
}
.wd-network:hover { background: var(--surface-2); }
.wd-network.active {
  background: hsla(265, 90%, 60%, 0.1);
  border-color: hsla(265, 90%, 60%, 0.3);
}
.wd-net-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.wd-network.active .wd-net-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.wd-net-check { margin-left: auto; color: var(--success); }

.wd-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  text-decoration: none;
  transition: background 160ms;
  margin-bottom: 0.15rem;
}
.wd-link:hover { background: var(--surface-2); color: var(--text); }
.wd-disconnect { color: var(--danger); }
.wd-disconnect:hover { background: hsla(0, 80%, 50%, 0.1); }

.wd-foot {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.wd-pill {
  padding: 0.2rem 0.55rem;
  background: hsla(265, 90%, 60%, 0.1);
  border: 1px solid hsla(265, 90%, 60%, 0.25);
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--primary-2);
  font-family: var(--mono);
}
