:root {
  --bg: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --success: #10b981;
  --error: #ef4444;
  --pending: #f59e0b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.shell {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand h1 { margin: 0 0 4px; font-size: 28px; }
.brand .tagline { margin: 0; color: var(--muted); font-size: 14px; }

.product {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: center;
}
.product__image {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
}
.product__info h2 { margin: 0 0 8px; font-size: 20px; }
.product__info p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.product__price {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { background: var(--border); cursor: not-allowed; }

.error {
  margin: 12px 0 0;
  color: var(--error);
  font-size: 13px;
}

.status {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.status h3 { margin: 0 0 16px; font-size: 16px; }
.status__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.status__row:last-of-type { border-bottom: none; }
.status__label { color: var(--muted); }
.mono {
  font-family: ui-monospace, "SF Mono", Monaco, monospace;
  font-size: 12px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.dot--pending {
  background: var(--pending);
  animation: pulse 1.5s ease-in-out infinite;
}
.dot--success { background: var(--success); }
.dot--error { background: var(--error); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hidden { display: none !important; }

.muted { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

.result__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.result__header h2 { margin: 0; font-size: 18px; }

.icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
}
.icon--success { background: var(--success); }
.icon--success::before { content: '\2713'; }
.icon--error { background: var(--error); }
.icon--error::before { content: '\2715'; }
.icon--pending { background: var(--pending); }
.icon--pending::before { content: '…'; font-weight: 700; }

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--border);
  color: var(--text);
}
.badge--success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge--error { background: rgba(239, 68, 68, 0.15); color: var(--error); }

.raw {
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}
.raw summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}
.raw pre {
  margin: 12px 0 0;
  font-family: ui-monospace, "SF Mono", Monaco, monospace;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

.actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.btn--secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}
.btn--secondary:hover { background: var(--border); }

@media (max-width: 520px) {
  .product { grid-template-columns: 1fr; text-align: center; }
  .product__image { margin: 0 auto; }
}
