/*
 * Deliberately small and self-contained: this page is opened inside other products,
 * on phones, over bad connections. No font downloads, no framework, no layout shift.
 */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f62fe;
  --brand-ink: #ffffff;
  --ok: #0f9d58;
  --error: #d93025;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111827;
    --ink: #e5e7eb;
    --muted: #9aa4b2;
    --line: #1f2937;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.checkout {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgb(15 23 42 / 6%);
}

.checkout__header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.checkout__brand {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.state[hidden] {
  display: none;
}

.state__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.state__text {
  margin: 0;
  color: var(--muted);
}

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

.summary__amount {
  margin: 0;
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.02em;
  /* Tabular figures stop the amount from dancing while it loads. */
  font-variant-numeric: tabular-nums;
}

.summary__description {
  margin: 0;
  color: var(--muted);
}

.items {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.items__item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
}

.button {
  width: 100%;
  margin-top: 8px;
  padding: 13px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.06);
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

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

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.badge--ok {
  background: var(--ok);
}

.badge--error {
  background: var(--error);
}

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

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