*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #080d14;
  --surface: #0f1823;
  --card: #141f2e;
  --border: rgba(255, 255, 255, 0.07);
  --border-lit: rgba(82, 210, 150, 0.35);
  --green: #3adb8a;
  --green-dim: #1a6b42;
  --green-glow: rgba(58, 219, 138, 0.12);
  --amber: #f5c842;
  --amber-dim: rgba(245, 200, 66, 0.15);
  --red: #f56060;
  --text: #e8f0ea;
  --muted: #7a8f82;
  --mono: 'DM Mono', monospace;
  --head: 'Syne', sans-serif;
  --body: 'DM Sans', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 4rem;
}

/* ── Header ─────────────────────────────── */
header {
  width: 100%;
  max-width: 860px;
  padding: 2.5rem 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 3rem;
}

.logo {
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
}

.badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--amber);
  background: var(--amber-dim);
  border: 0.5px solid rgba(245, 200, 66, 0.3);
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Layout ─────────────────────────────── */
.wrapper {
  width: 100%;
  max-width: 860px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 680px) {
  .wrapper {
    grid-template-columns: 1fr;
  }
}

/* ── Cards ───────────────────────────────── */
.card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
}

.card.wide {
  grid-column: 1 / -1;
}

.card-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-label::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
}

h2 {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* ── Form elements ───────────────────────── */
.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="number"] {
  width: 100%;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 3px var(--green-glow);
}

/* Amount with prefix */
.input-group {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group:focus-within {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.input-prefix {
  padding: 0.7rem 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border-right: 0.5px solid var(--border);
  white-space: nowrap;
}

.input-group input {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex: 1;
}

.input-group input:focus {
  box-shadow: none;
}

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.toggle-label-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.toggle-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.toggle {
  width: 42px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  border: none;
  transition: background 0.25s;
  flex-shrink: 0;
}

.toggle.on {
  background: var(--green);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s;
}

.toggle.on::after {
  transform: translateX(18px);
}

/* CTA button */
.btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 10px;
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-primary {
  background: var(--green);
  color: #051208;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 0.5px solid var(--border);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Verify section ───────────────────────── */
.ref-row {
  display: flex;
  gap: 8px;
}

.ref-row input {
  flex: 1;
}

.ref-row .btn {
  width: auto;
  padding: 0.7rem 1.2rem;
  font-size: 0.85rem;
}

/* ── Status pill ─────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-pill.success {
  background: rgba(58, 219, 138, 0.12);
  color: var(--green);
}

.status-pill.success .pill-dot {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

.status-pill.error {
  background: rgba(245, 96, 96, 0.12);
  color: var(--red);
}

.status-pill.error .pill-dot {
  background: var(--red);
}

.status-pill.loading {
  background: rgba(245, 200, 66, 0.1);
  color: var(--amber);
}

.status-pill.loading .pill-dot {
  background: var(--amber);
}

/* ── Result box ──────────────────────────── */
.result-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 10px;
  border-left: 2px solid var(--green);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.7;
  display: none;
}

.result-box.visible {
  display: block;
}

.result-box.error {
  border-left-color: var(--red);
}

.result-key {
  color: var(--muted);
}

/* ── Event log ───────────────────────────── */
.log-container {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-empty {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 1.5rem;
  text-align: center;
  border: 0.5px dashed var(--border);
  border-radius: 10px;
}

.log-event {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.log-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.log-icon.ok {
  background: rgba(58, 219, 138, 0.12);
}

.log-icon.err {
  background: rgba(245, 96, 96, 0.12);
}

.log-icon.inf {
  background: rgba(245, 200, 66, 0.1);
}

.log-body {
  flex: 1;
}

.log-title {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.log-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

/* ── Stat row ────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1.5rem;
}

.stat {
  background: var(--surface);
  border-radius: 10px;
  padding: 0.9rem;
  border: 0.5px solid var(--border);
}

.stat-val {
  font-family: var(--head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.stat-lbl {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ── Footer ──────────────────────────────── */
footer {
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-align: center;
}

/* ── Scrollbar ───────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ── Spinner ─────────────────────────────── */
.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

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