/* ============================================================
   checkout-ui — Spidermind checkout modal styles.
   All classes prefixed with `sm-` so nothing in the host page
   can collide. Inline styles on the overlay also guarantee
   visibility regardless of CSS loading order.
   ============================================================ */

body.sm-checkout-open { overflow: hidden !important; }

.sm-modal {
  position: relative;
  width: min(440px, 92vw);
  margin: auto 0;
  padding: 24px 24px 18px;
  border-radius: 16px;
  background: linear-gradient(160deg,
    rgba(28, 18, 56, 0.97) 0%,
    rgba(20, 14, 40, 0.95) 50%,
    rgba(36, 22, 70, 0.97) 100%);
  border: 1px solid rgba(167, 139, 250, 0.18);
  color: #e6edf3;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sm-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.sm-close:hover { color: #fff; }

.sm-head { text-align: center; margin: 0 0 14px; padding: 0 30px; }
.sm-title { margin: 0 0 4px; font-size: 1.05rem; font-weight: 600; color: #f5f3ff; }
.sm-price { font-size: 1.35rem; font-weight: 700; color: #c4b5fd; }

.sm-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  background: rgba(10, 6, 24, 0.6);
  border: 1px solid rgba(167, 139, 250, 0.10);
  border-radius: 10px;
}
.sm-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: #a7b0d1;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.sm-tab:hover { color: #f5f3ff; }
.sm-tab.is-active { background: rgba(167, 139, 250, 0.18); color: #f5f3ff; }

.sm-error {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 8px;
  color: #fecaca;
  font-size: 0.85rem;
}

/* Both panels live in the same grid cell so the modal never resizes when
   the user switches tabs — container sizes to whichever panel is taller. */
.sm-panels { display: grid; }
.sm-panel {
  grid-column: 1;
  grid-row: 1;
  visibility: hidden;
  pointer-events: none;
}
.sm-panel.is-active {
  visibility: visible;
  pointer-events: auto;
}

/* Card */
.sm-card-box {
  background: #fff;
  border-radius: 8px;
  min-height: 56px;
  padding: 6px;
  margin: 0 0 14px;
  box-sizing: border-box;
}
.sm-card-box iframe {
  width: 100% !important;
  min-height: 48px;
  display: block !important;
  border: none;
}
.sm-card-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 0.8rem;
  color: #6e7681;
  text-align: center;
  padding: 6px 8px;
  line-height: 1.4;
}
.sm-card-loading.is-error { color: #dc2626; }

.sm-pay-btn {
  display: block;
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, transform 0.1s;
}
.sm-pay-btn:hover:not(:disabled) { opacity: 0.92; }
.sm-pay-btn:active:not(:disabled) { transform: translateY(1px); }
.sm-pay-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Crypto */
.sm-crypto-opts {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
}
.sm-crypto-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(167, 139, 250, 0.20);
  border-radius: 8px;
  background: rgba(10, 6, 24, 0.6);
  color: #f5f3ff;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.sm-crypto-btn:hover { border-color: #c4b5fd; }
.sm-crypto-btn.is-selected { border-color: #c4b5fd; background: rgba(167, 139, 250, 0.10); }
.sm-crypto-info {
  font-size: 0.8rem;
  color: #a7b0d1;
  text-align: center;
  margin: 8px 0 6px;
}
.sm-crypto-addr {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.78rem;
  word-break: break-all;
  background: rgba(10, 6, 24, 0.7);
  border: 1px solid rgba(167, 139, 250, 0.20);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  margin: 4px 0 6px;
  transition: border-color 0.15s;
  color: #f5f3ff;
}
.sm-crypto-addr:hover { border-color: #c4b5fd; }
.sm-crypto-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #c4b5fd;
  margin-top: 8px;
}
.sm-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 2px solid rgba(245, 158, 11, 0.22);
  border-top-color: #f59e0b;
  background: transparent;
  animation: sm-spin 0.9s linear infinite;
}
@keyframes sm-spin { to { transform: rotate(360deg); } }

.sm-secure {
  text-align: center;
  margin: 12px 0 0;
  font-size: 0.7rem;
  color: #6e7681;
}
