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

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #d9d9dc;
}

html[data-pay-theme="dark"],
html[data-pay-theme="dark"] body {
  background: #070707;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.pay-app {
  color-scheme: light;
  --page: #d9d9dc;
  --page-glow: #e6e6e9;
  --paper: #f4f4f6;
  --field: #ffffff;
  --ink: #2a1a12;
  --ink-soft: #5c4a3c;
  --muted: #9a8b7c;
  --line: #d8d0c8;
  --lead-line: var(--ink);
  --check-tick: #ffffff;
  --widget: #d9d6d2;
  --pay-primary: #2a1a12;
  --pay-primary-ink: #fff8ee;
  --pay-primary-sub: rgb(255 248 238 / 58%);
  --pay-primary-hover: #1c110b;
  --pay-primary-shadow:
    inset 0 1px 0 rgb(255 248 238 / 12%),
    0 8px 18px rgb(42 26 18 / 18%);
  --pay-secondary: #ffffff;
  --pay-secondary-hover: #fffaf4;
  --spinner-track: rgb(42 26 18 / 14%);
  --heart: #e31b73;
  --dot: #c6de3a;
  --card-shadow:
    0 18px 40px rgb(42 26 18 / 10%),
    0 2px 8px rgb(42 26 18 / 6%);
  --dock-bg: rgb(255 255 255 / 78%);
  --dock-ink: #2a1a12;
  --dock-on: #fff8ee;
  --dock-muted: #6a5748;
  --dock-line: rgb(42 26 18 / 12%);
  --dock-hover: rgb(42 26 18 / 6%);
  --dock-shadow: 0 10px 28px rgb(42 26 18 / 12%);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --radius-card: 32px;
  --radius-field: 18px;
  --radius-pill: 999px;
  width: 100%;
  min-height: 100dvh;
  color: var(--ink);
  background-color: var(--page);
  background-image: radial-gradient(90rem 46rem at 50% 40%, var(--page-glow) 0%, var(--page) 58%);
  font-family: Inter, system-ui, sans-serif;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

.pay-app[data-theme="dark"] {
  color-scheme: dark;
  --page: #070707;
  --page-glow: #111111;
  --paper: #141414;
  --field: #1c1c1c;
  --ink: #f3f3f1;
  --ink-soft: rgb(243 243 241 / 68%);
  --muted: rgb(243 243 241 / 46%);
  --line: rgb(255 255 255 / 12%);
  --lead-line: #3a3a3a;
  --check-tick: #141414;
  --widget: #0e0e0e;
  --pay-primary: #f3f3f1;
  --pay-primary-ink: #0c0c0c;
  --pay-primary-sub: rgb(12 12 12 / 55%);
  --pay-primary-hover: #ffffff;
  --pay-primary-shadow:
    inset 0 1px 0 rgb(255 255 255 / 28%),
    0 8px 18px rgb(0 0 0 / 40%);
  --pay-secondary: #1c1c1c;
  --pay-secondary-hover: #252525;
  --spinner-track: rgb(255 255 255 / 14%);
  --card-shadow:
    0 24px 48px rgb(0 0 0 / 55%),
    0 2px 8px rgb(0 0 0 / 35%);
  --dock-bg: rgb(255 255 255 / 8%);
  --dock-ink: #f3f3f1;
  --dock-on: #0c0c0c;
  --dock-muted: rgb(243 243 241 / 58%);
  --dock-line: rgb(255 255 255 / 14%);
  --dock-hover: rgb(255 255 255 / 8%);
  --dock-shadow: 0 10px 28px rgb(0 0 0 / 45%);
}

.pay-app h1,
.pay-app .headline,
.pay-app .support-title {
  font-family: Inter, system-ui, sans-serif;
}

.pay-app ::selection {
  background: var(--ink);
  color: var(--paper);
}

.stage {
  box-sizing: border-box;
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 28px 16px;
  overflow: auto;
  overscroll-behavior: none;
}

.stage::before,
.stage::after {
  content: "";
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  pointer-events: none;
}

.board {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  max-width: 100%;
  transition: gap 520ms var(--ease-out);
}

.board--help {
  gap: 16px;
}

.card {
  --card-pad: 32px;
  position: relative;
  flex: 0 0 auto;
  width: min(488px, calc(100vw - 32px));
  background: var(--paper);
  border-radius: var(--radius-card);
  padding: 30px var(--card-pad) 26px;
  color: var(--ink);
  container-type: inline-size;
  box-shadow: var(--card-shadow);
  animation: rise 480ms var(--ease-out) both;
  transition:
    background 240ms ease,
    color 240ms ease,
    box-shadow 240ms ease;
}

.brand-mark {
  display: block;
  width: 48px;
  height: 44px;
}

.bubble {
  fill: none;
  stroke: #e31b73;
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.heart {
  fill: #e31b73;
}

.dot {
  fill: #c6de3a;
}

.help-lane {
  display: flex;
  flex: 0 0 auto;
  align-self: stretch;
  width: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: none;
  transition:
    width 520ms var(--ease-out),
    box-shadow 520ms var(--ease-out);
}

.board--help .help-lane {
  width: 280px;
  box-shadow: var(--card-shadow);
}

.help-lane-inner {
  display: flex;
  width: 280px;
  min-height: 100%;
}

.support {
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 280px;
  min-height: 100%;
  padding: 28px 22px 20px;
  color: var(--ink);
  background: var(--paper);
  border-radius: var(--radius-card);
  opacity: 0;
  transform: translateX(-14px);
  transition:
    opacity 360ms var(--ease-out),
    transform 520ms var(--ease-out),
    background 240ms ease,
    color 240ms ease;
}

.board--help .support {
  opacity: 1;
  transform: none;
  transition-delay: 70ms;
}

.support-title {
  margin: 0;
  font-weight: 800;
  font-size: 34px;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.support-copy {
  margin: 12px 0 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--ink-soft);
}

.support-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.support-note {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.support-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 14%);
}

.support-go-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 16px;
}

.badge {
  margin: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  background: var(--field);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.headline {
  margin: 26px 0 0;
  max-width: 100%;
  font-weight: 800;
  font-size: 36px;
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-align: center;
  color: var(--ink);
  overflow-wrap: break-word;
}

.stage[data-step="widget"] .headline {
  margin-top: 14px;
}

.stage[data-step="widget"] .swap {
  margin-top: 18px;
}

.swap {
  position: relative;
  margin-top: 40px;
}

.body {
  width: 100%;
}

.body.is-leave {
  animation: leave 380ms var(--ease-out) both;
}

.body.is-enter {
  animation: enter 380ms var(--ease-out) both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes leave {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
    filter: blur(10px);
  }
}

.lead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
  padding: 12px 18px 11px;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--lead-line);
  border-radius: 14px;
}

.hint {
  display: block;
  width: 45px;
  height: auto;
  cursor: pointer;
}

.check {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 0;
  cursor: pointer;
}

.check input {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: 0;
  opacity: 0.01;
  cursor: pointer;
}

.box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--field);
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.tick {
  width: 12px;
  height: 12px;
  color: var(--check-tick);
  opacity: 0;
  transform: scale(0.6);
  transform-origin: center;
  transition:
    transform 160ms var(--ease-out),
    opacity 160ms ease;
}

.check input:checked + .box {
  background: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.check input:checked + .box .tick {
  opacity: 1;
  transform: scale(1);
}

.check input:focus-visible + .box {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.check-copy {
  font-size: 14.5px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--ink);
  overflow-wrap: break-word;
}

.check-copy a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.tip {
  position: relative;
  display: inline-block;
}

.tip-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tip-bubble {
  position: absolute;
  left: -8px;
  bottom: calc(100% + 10px);
  z-index: 8;
  width: min(240px, 68vw);
  padding: 10px 12px 11px 14px;
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  background: var(--field);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-align: left;
  box-shadow: 0 10px 30px rgb(42 26 18 / 8%);
  opacity: 0;
  filter: blur(8px);
  transform: translateY(10px);
  transform-origin: 0 100%;
  pointer-events: none;
  transition:
    opacity 280ms var(--ease-out),
    transform 420ms var(--ease-out),
    filter 420ms var(--ease-out);
}

.tip-bubble::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: var(--ink);
  transform: scaleY(0.2);
  transform-origin: bottom;
  transition: transform 420ms var(--ease-out);
}

.tip:hover .tip-bubble,
.tip:focus-within .tip-bubble {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.tip:hover .tip-bubble::before,
.tip:focus-within .tip-bubble::before {
  transform: scaleY(1);
}

.widget-slot {
  min-height: 280px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--widget);
}

.widget-slot--cloud {
  min-height: 320px;
  padding: 12px;
  background: var(--field);
  overflow: auto;
}

.pay-app[data-theme="dark"] .widget-slot--cloud {
  background: #000;
}

.pay-app[data-theme="dark"] #payment-widget iframe {
  filter: invert(1) hue-rotate(180deg);
}

.cp {
  color: #594b3e;
  padding: 18px 8px 6px;
}

.pay-app[data-theme="dark"] .cp {
  color: #f3f3f1;
}

.cp-title {
  margin: 6px 20px 36px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cp-label {
  margin: 0 20px 14px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.cp-field {
  height: 48px;
  margin: 0 20px 28px;
  border-radius: 10px;
  background: transparent;
}

.cp-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 40px);
  height: 56px;
  margin: 0 20px 22px;
  border: 0;
  border-radius: 14px;
  background: #867f7b;
  color: #fefbf6;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: default;
}

.cp-buy:disabled {
  opacity: 1;
}

.pay-app[data-theme="dark"] .cp-buy {
  background: #3a3a3a;
  color: rgb(243 243 241 / 72%);
}

.cp-save,
.cp-mail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 12px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
  text-align: center;
}

.cp-save {
  margin-bottom: 14px;
}

.cp-help {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  opacity: 0.7;
}

.cp-mail {
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 0 8px;
  text-align: left;
}

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e4e4e6;
  cursor: pointer;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
  transition: transform 180ms var(--ease-out);
}

.switch[aria-checked="true"] {
  background: #34c759;
}

.switch[aria-checked="true"] .switch-knob {
  transform: translateX(18px);
}

.cp-badges {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 8px 16px;
  color: #c5cdd6;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
  text-align: center;
}

.cp-badges span {
  flex: 1 1 0;
  max-width: 72px;
}

.cp-secured {
  margin: 0;
  color: #c5cdd6;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: center;
}

.cp-secured strong {
  font-weight: 700;
}

.chrome-slot {
  display: grid;
  justify-items: center;
  min-height: 36px;
  margin-top: 14px;
}

.theme-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6d6560;
  cursor: pointer;
}

.theme-btn:hover {
  background: rgb(0 0 0 / 6%);
}

.pay-app[data-theme="dark"] .theme-btn {
  color: rgb(243 243 241 / 78%);
}

.pay-app[data-theme="dark"] .theme-btn:hover {
  background: rgb(255 255 255 / 8%);
}

.theme-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.theme-ico {
  width: 18px;
  height: 18px;
}

.theme-ico--sun {
  display: none;
}

.pay-app[data-theme="dark"] .theme-ico--moon {
  display: none;
}

.pay-app[data-theme="dark"] .theme-ico--sun {
  display: block;
}

.pay-status {
  margin: 12px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.pay-status.is-fail {
  color: #e31b73;
}

.dock {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 3px;
  color: var(--dock-ink);
  background: var(--dock-bg);
  border: 1px solid var(--dock-line);
  border-radius: 999px;
  box-shadow: var(--dock-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease;
}

.dock-btn:hover,
.dock-btn.is-on {
  background: var(--dock-hover);
}

.dock-btn:focus-visible,
.support-go:focus-visible,
.switch:focus-visible {
  outline: 2px solid var(--dock-ink);
  outline-offset: 2px;
}

.dock-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.dock-rule {
  width: 1px;
  height: 14px;
  background: var(--dock-line);
}

.toaster {
  position: fixed;
  z-index: 50;
  top: 24px;
  left: 50%;
  width: min(356px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 16px;
  border: 1px solid hsl(0 0% 93%);
  border-radius: 8px;
  background: #fff;
  color: hsl(0 0% 9%);
  box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  animation: toast-in 400ms ease both;
}

html[data-pay-theme="dark"] .toast {
  border-color: hsl(0 0% 20%);
  background: hsl(0 0% 12%);
  color: hsl(0 0% 96%);
}

.toast.is-out {
  animation: toast-out 300ms ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 860px) {
  .board,
  .board--help {
    flex-direction: column;
    width: min(100%, 488px);
    gap: 0;
  }

  .board--help {
    gap: 10px;
  }

  .help-lane {
    width: 100%;
    max-height: 0;
    transition: max-height 420ms var(--ease-out);
  }

  .board--help .help-lane {
    width: 100%;
    max-height: 320px;
  }

  .help-lane-inner,
  .support {
    width: 100%;
    min-height: 0;
    height: auto;
  }

  .support {
    padding: 18px 18px 16px;
    transform: translateY(-8px);
  }

  .board--help .support {
    transform: none;
  }
}

@media (max-width: 520px) {
  .card {
    --card-pad: 22px;
    padding: 24px var(--card-pad) 22px;
    border-radius: 28px;
  }

  .cp-badges {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .body.is-leave,
  .body.is-enter,
  .toast {
    animation: none;
  }

  .board,
  .help-lane,
  .support {
    transition: none;
  }
}
