@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");

:root {
  --color-text: #fff;
  --color-text-muted: #9ca3af;
  --color-bg: #13151c;
  --color-bg-raised: #1e1f26;
  --color-border: #333;
  --color-primary: #3ac054;
  --color-primary-muted: #1f492d;
  --color-error: #e73434;
  --color-disabled: #999;
  --color-loading: #ffffff80;
  --color-code-text: #d1d5db;
  --color-code-bg: #111827;
  --color-code-border: #374151;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;

  --radius-sm: 6px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --container-width: 430px;
  --content-width: 320px;
  --page-padding: 25px;
  --header-height: 56px;
  --progress-height: 52px;
  --button-height: 42px;
  --footer-padding: 140px;
}

@keyframes error {
  10%, 30%, 50%, 70%, 90% { translate: -2px; }
  20%, 40%, 60%, 80% { translate: 2px; }
}

@keyframes loading {
  0% { translate: -100%; }
  100% { translate: 100%; }
}

@keyframes sweep {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Reset */

* {
  box-sizing: border-box;
  margin: 0;
  max-width: 100%;
}

html {
  background: var(--color-bg);
  font: 14px/1.5 "Inter", sans-serif;
  color: var(--color-text);
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

input[type="hidden"],
[hidden] {
  display: none;
}

/* Typography */

h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

p {
  color: var(--color-text-muted);
  max-width: var(--content-width);
  margin: 0 auto var(--space-lg);
}

p[left] {
  text-align: left;
  width: 100%;
}

small {
  font-size: 12px;
  color: var(--color-text-muted);
  display: block;
}

strong {
  font-weight: 600;
}

ul {
  list-style: none;
  padding: 0;
  text-align: left;
  width: 100%;
  max-width: var(--content-width);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

li {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

li strong {
  color: var(--color-text);
  display: block;
  margin-bottom: 2px;
}

li p {
  max-width: 100%;
  margin: 0;
  font-size: inherit;
}

code {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12px;
  color: var(--color-code-text);
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-md) auto;
  max-width: 350px;
  word-break: break-all;
  white-space: pre-wrap;
  text-align: left;
  display: block;
}

/* Layout */

body {
  max-width: var(--container-width);
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--header-height) var(--page-padding) var(--footer-padding);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-md);
  width: 100%;
}

header {
  background: var(--color-bg);
  position: fixed;
  width: 100%;
  padding: var(--space-md) var(--page-padding);
  height: var(--header-height);
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer {
  background: var(--color-bg);
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--container-width);
  padding: var(--space-md) var(--page-padding);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scrollbar-width: none;
}

footer::-webkit-scrollbar {
  display: none;
}

#content,
main {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
}

section {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
}

section > span {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

section > span:first-child {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: left;
}

section > span:last-child {
  text-align: right;
  align-items: flex-end;
}

form,
.button-group {
  width: 100%;
  display: flex;
  gap: var(--space-md);
}

/* Buttons */

button {
  width: 100%;
  height: var(--button-height);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-primary);
  padding: 0 var(--space-lg);
  background: none;
  box-shadow: inset 0 0 0 2px var(--color-primary);
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}

button::after {
  content: attr(error);
  position: absolute;
  inset: 0;
  background: var(--color-error);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

button[filled] {
  background: var(--color-primary);
  box-shadow: none;
  color: var(--color-bg);
}

button:hover:not(:disabled, [disabled], [loading]) {
  color: color-mix(in srgb, var(--color-primary), white 20%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-primary), white 20%);
}

button[filled]:hover:not(:disabled, [disabled], [loading]) {
  background: color-mix(in srgb, var(--color-primary), white 20%);
  color: var(--color-bg);
  box-shadow: none;
}

button:active:not(:disabled, [disabled], [loading]) {
  transform: scale(0.98);
}

button[loading] {
  pointer-events: none;
  cursor: wait;
  overflow: hidden;
}

button[loading]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--color-loading) 50%, transparent 100%);
  opacity: 1;
  pointer-events: auto;
  cursor: wait;
  border-radius: inherit;
  padding: 2px;
  -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: loading 2.5s infinite;
}

button[filled][loading]::after {
  padding: 0;
  -webkit-mask: none;
  mask: none;
}

button[error] {
  animation: error 0.6s;
  pointer-events: auto;
  cursor: pointer;
}

button[error]::after {
  color: var(--color-text);
  opacity: 1;
  pointer-events: auto;
}

button:disabled,
button[disabled] {
  cursor: not-allowed;
  box-shadow: inset 0 0 0 2px var(--color-disabled);
  color: var(--color-disabled);
}

button[filled]:disabled,
button[filled][disabled] {
  background: var(--color-disabled);
  box-shadow: none;
  color: var(--color-bg);
}

.close {
  position: absolute;
  top: var(--space-md);
  right: var(--page-padding);
  width: var(--page-padding);
  height: var(--page-padding);
  font-size: 18px;
  background: none;
  box-shadow: none;
  padding: 0;
  z-index: 11;
}

.close::after {
  display: none;
}

/* Data */

dl {
  padding: var(--space-md);
  background: var(--color-bg-raised);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  text-align: left;
  overflow: hidden;
  margin: 0;
  flex: 1;
}

dt {
  color: var(--color-text);
  font-weight: 600;
}

dt:not(:first-of-type) {
  margin-top: var(--space-sm);
}

dd {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 400;
  word-break: break-all;
  line-height: 1.4;
}

details {
  width: 100%;
  margin-bottom: var(--space-sm);
}

summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  margin-bottom: var(--space-sm);
  gap: var(--space-sm);
}

summary::-webkit-details-marker {
  display: none;
}

summary > span:first-child {
  flex: 1;
  text-align: left;
}

summary > span:last-child {
  text-align: right;
  flex-shrink: 0;
}

mark {
  background: none;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: normal;
  transition: transform 0.2s;
  margin-left: var(--space-sm);
}

details[open] mark {
  transform: rotate(90deg);
}

pre {
  max-width: 100%;
  overflow-x: auto;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  -webkit-hyphens: none;
  hyphens: none;
  font-family: inherit;
  border-left: 1px solid var(--color-text);
  padding-left: 6px;
  margin-left: 1px;
}

pre span {
  display: block;
  margin-bottom: var(--space-xs);
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  font-size: 12px;
  color: var(--color-text-muted);
}

pre strong {
  color: var(--color-text);
}

pre span + pre {
  margin-left: 1px;
  border-left: 1px solid var(--color-text);
  padding-left: 6px;
}

/* Utilities */

.main-icon {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-icon {
  height: 16px;
}

.amount-display {
  margin: var(--space-lg) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
}

.amount-display h1 {
  font-size: 48px;
  margin: 0;
}

.amount-display h2 {
  font-size: 24px;
  font-weight: 400;
  margin: 0;
}

.trace-id {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 10px;
  -webkit-user-select: all;
  user-select: all;
}

/* Step Progress Indicator */

nav {
  position: fixed;
  top: var(--header-height);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--content-width);
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) 0 var(--space-sm);
  background: var(--color-bg);
  z-index: 9;
}

#content:has(nav) {
  padding-top: calc(var(--progress-height) + var(--space-md));
}

nav-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1;
}

nav-step::before {
  content: "";
  width: 100%;
  height: var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--color-bg-raised);
}

nav-step[active]::before {
  background: var(--color-primary);
  animation: pop 0.3s 0.6s both cubic-bezier(0.34, 1.5, 0.64, 1);
}

nav-step[completed]::before {
  background: var(--color-primary-muted);
}

nav-step[completed]:has(+ nav-step[active])::before {
  transform-origin: left;
  animation: sweep 0.6s cubic-bezier(0.34, 1.5, 0.64, 1);
}

nav-step[active],
nav-step[completed] {
  color: var(--color-text);
}

body::-webkit-scrollbar {
  width: 4px;
}

body::-webkit-scrollbar-thumb {
  background: var(--color-primary-muted);
  border-radius: 2px;
}

body::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}
