* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: #f5f5f7;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 28px 20px;
  color: #0f172a;
  font: 13.5px/1.4 Arial, sans-serif;
}

.primary {
  height: 40px;
  border: 0;
  border-radius: 5px;
  background: #00c07d;
  color: #fff;
  font: 600 13.5px 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.primary:hover:enabled {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.primary:disabled {
  opacity: 0.65;
  cursor: default;
}

#open-payment {
  padding: 0 22px;
}

dialog {
  width: calc(100% - 40px);
  max-width: 310px;
  padding: 18px 20px 20px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  box-shadow: 0 18px 44px -12px rgba(15, 23, 42, 0.35);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

h1 {
  margin: 0;
  font: 600 15px 'Segoe UI', system-ui, sans-serif;
}

.close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-inline-end: -4px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #94a3b8;
  cursor: pointer;
}

.close:focus-visible {
  outline: 2px solid #00c16e;
  outline-offset: 2px;
}

.close:hover {
  background: #f1f5f9;
  color: #475569;
}

.line {
  display: flex;
  align-items: flex-end;
  height: 38px;
  padding-bottom: 6px;
  border-bottom: 1px solid #c8c8c9;
}

.line input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: #000;
  font: inherit;
}

.line input::placeholder {
  color: #9aa3ae;
  opacity: 1;
}

/* A cross-origin frame has no height of its own, so its container needs one. */
.line > div {
  width: 100%;
  height: 22px;
}

.line.is-focused {
  border-bottom-color: #00c07d;
}

.line.is-invalid {
  border-bottom-color: #ff0000;
}

.line.is-invalid input {
  color: #ff0000;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

form .primary,
#success .primary {
  width: 100%;
  margin-top: 18px;
}

#error:empty {
  display: none;
}

#error {
  margin: 8px 0 0;
  color: #ff0000;
  text-align: center;
}

#success h2 {
  margin: 6px 0;
  color: #00a56b;
  font: 600 14px 'Segoe UI', system-ui, sans-serif;
}

#success dl {
  margin: 0;
}

#success dl div {
  display: flex;
  align-items: center;
  height: 34px;
  border-bottom: 1px solid #e5e7eb;
}

#success dt {
  flex: 0 0 56px;
  color: #64748b;
}

#success dd {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
