/* The shared wallet panel (js/wallet-flow.js). Each site sets the --wf-*
   variables in its own stylesheet; buttons use that site's .btn. */

.wf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  /* Clears sticky headers when scrolled into view. */
  scroll-margin: 96px 0 24px;
}

.wf-qr-frame {
  display: grid;
  place-items: center;
  width: 264px;
  max-width: 100%;
  aspect-ratio: 1;
  padding: 12px;
  box-sizing: border-box;
  /* QR codes must stay dark-on-light to scan, whatever the page theme. */
  background: #fff;
  border: 1px solid var(--wf-border, #dadada);
  border-radius: var(--wf-radius, 8px);
}

.wf-qr-frame--empty {
  background: var(--wf-surface, #f6f8fa);
}

.wf-qr {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.wf-hint,
.wf-validity {
  margin: 0;
  color: var(--wf-muted, #5f5f5f);
  font-size: 14px;
}

.wf-validity {
  font-size: 13px;
}

.wf-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  text-align: left;
  color: var(--wf-text, #1a1a1a);
  font-weight: 700;
  font-size: 15px;
}

.wf-spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid var(--wf-border, #dadada);
  border-top-color: var(--wf-accent, #1179b6);
  border-radius: 50%;
  animation: wf-spin 0.9s linear infinite;
}

.wf-spinner--lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

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

@media (prefers-reduced-motion: reduce) {
  .wf-spinner { animation-duration: 2.5s; }
}

/* A phone can't scan its own screen: lead with the button that opens the
   wallet app, and shrink the QR to a fallback for the second-device case. */
.wf-open {
  display: none;
}

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  .wf-open {
    display: flex;
    order: -1;
  }
  .wf-qr-frame:not(.wf-qr-frame--empty) {
    width: 180px;
  }
}

.wf-link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--wf-muted, #5f5f5f);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.wf-link:hover {
  color: var(--wf-text, #1a1a1a);
}

.wf--problem {
  align-items: stretch;
  text-align: left;
}

.wf-problem-title {
  margin: 0;
  color: var(--wf-text, #1a1a1a);
  font-weight: 700;
  font-size: 17px;
}

.wf-problem-text {
  margin: 0;
  color: var(--wf-muted, #5f5f5f);
  font-size: 15px;
}
