/* Wigo zTech Payments
   Radius system: controls 10px, containers 12px, summary card 16px.
   One accent: brand violet. One theme: split dark brand / light form. */

@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/geist-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/geist-500-latin.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/geist-600-latin.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/geist-700-latin.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/instrument-sans-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/instrument-sans-500-latin.woff2) format('woff2'); }
@font-face { font-family: 'Spline Sans Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/spline-sans-mono-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'Spline Sans Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/spline-sans-mono-500-latin.woff2) format('woff2'); }

:root {
  /* brand (dark summary panel) */
  --bg: #07080D;
  --fg: rgba(255, 255, 255, 0.96);
  --fg-2: rgba(255, 255, 255, 0.62);
  --fg-3: rgba(255, 255, 255, 0.4);
  --line-dark: rgba(255, 255, 255, 0.09);
  --brand: #8B5CF6;
  --brand-deep: #6C47E6;
  --brand-ink: #5A38C9;
  --brand-2: #2563FF;

  /* light pane */
  --pane-bg: #FBFBFD;
  --panel: #FFFFFF;
  --ink: #20242F;
  --ink-2: #5E6470;
  --ink-3: #8C919C;
  --line: #E4E6EB;
  --line-strong: #D5D8DF;
  --ring: rgba(108, 71, 230, 0.16);
  --ok: #1E9E6A;
  --warn: #8A6A12;
  --err: #D7264C;

  --display: "Geist", "Helvetica Neue", Arial, sans-serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Spline Sans Mono", "SF Mono", Menlo, monospace;

  --r-control: 10px;
  --r-container: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--pane-bg);
  -webkit-font-smoothing: antialiased;
}

/* ================= layout ================= */
.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100dvh;
}

/* ================= left: summary ================= */
.summary {
  position: relative;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 48px) clamp(24px, 5.5vw, 84px);
}

.summary-inner { position: relative; z-index: 1; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .summary-inner > * { animation: rise 0.7s var(--ease) both; }
  .summary-inner > *:nth-child(2) { animation-delay: 0.08s; }
  .summary-inner > *:nth-child(3) { animation-delay: 0.16s; }
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--fg);
  text-decoration: none;
}
.back-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  color: var(--fg-2);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.25s var(--ease);
}
.back:hover .back-btn {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--fg);
  transform: translateX(-2px);
}
.back img { display: block; }
.back .lockup { height: 25px; width: auto; }

.summary-amount { margin: clamp(40px, 8vh, 84px) 0 clamp(26px, 4.5vh, 44px); }
.pay-to {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg-2);
  margin-bottom: 8px;
}
.big-amount {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(44px, 4.8vw, 62px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.live-memo {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--fg-2);
  min-height: 22px;
}

.summary-card {
  max-width: 430px;
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  padding: 4px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.summary-lines { list-style: none; }
.summary-lines li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: 13.5px;
}
.summary-lines li:last-child { border-bottom: 0; }
.summary-lines li span:first-child { color: var(--fg-3); }
.summary-lines li span:last-child { color: var(--fg-2); text-align: right; font-weight: 500; }
.summary-lines li:first-child span:last-child { color: var(--fg); }

.summary-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 12.5px;
  color: var(--fg-3);
  padding-top: 28px;
}
.summary-foot strong { color: var(--fg-2); font-weight: 600; }
.foot-links { display: flex; gap: 18px; }
.foot-links a { color: var(--fg-3); text-decoration: none; }
.foot-links a:hover { color: var(--fg-2); }

/* ================= right: pane ================= */
.pane {
  display: flex;
  justify-content: center;
  background: var(--pane-bg);
  padding: clamp(36px, 7vh, 72px) clamp(16px, 5vw, 56px) 44px;
}
.pane-inner {
  width: 100%;
  max-width: 416px;
  position: relative;
}

.notice {
  display: block;
  background: #FFFDF6;
  border: 1px solid #EEE2BC;
  border-left: 3px solid #D9A91F;
  border-radius: var(--r-container);
  padding: 12px 15px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 26px;
}
.notice strong { color: var(--warn); font-weight: 600; font-family: var(--display); display: block; margin-bottom: 1px; }
.notice span { color: var(--ink-2); }
.notice a { color: var(--brand-ink); }

/* views (form <-> result panels) */
.view {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.view.is-active { opacity: 1; transform: translateY(0); }
.view.is-leaving { opacity: 0; transform: translateY(-10px); }

/* steps: directional slides */
@keyframes step-in-fwd { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
@keyframes step-out-fwd { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-32px); } }
@keyframes step-out-back { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(32px); } }
.step.enter-fwd { animation: step-in-fwd 0.4s var(--ease) both; }
.step.enter-back { animation: step-in-back 0.4s var(--ease) both; }
.step.leave-fwd { animation: step-out-fwd 0.22s ease both; }
.step.leave-back { animation: step-out-back 0.22s ease both; }

.step-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 18px;
}

/* method chooser */
.methods {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-container);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(32, 36, 47, 0.04), 0 4px 16px rgba(32, 36, 47, 0.03);
}
.method-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 18px;
  background: var(--panel);
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  transition: background 0.15s;
}
.method-tile:last-child { border-bottom: 0; }
.method-tile:hover { background: #F8F8FB; }
.method-tile:hover .tile-arrow { transform: translateX(3px); color: var(--brand-deep); }
.method-tile:active { transform: scale(0.995); }
.tile-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: var(--r-control);
  display: grid;
  place-items: center;
  background: #F3F3F7;
  border: 1px solid var(--line);
  color: var(--ink-2);
  transition: color 0.15s, border-color 0.15s;
}
.method-tile:hover .tile-icon { color: var(--brand-deep); border-color: #DCD3F8; }
.tile-text strong {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.tile-text small { font-size: 13px; color: var(--ink-2); }
.tile-arrow {
  margin-left: auto;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  transition: transform 0.2s var(--ease), color 0.15s;
}

/* step 2 header */
.step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px 7px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  box-shadow: 0 1px 2px rgba(32, 36, 47, 0.04);
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.back-link svg { transition: transform 0.2s var(--ease); }
.back-link:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: 0 2px 6px rgba(32, 36, 47, 0.07); }
.back-link:hover svg { transform: translateX(-2px); }
.back-link:active { transform: scale(0.97); }

:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 2px; }
.method-label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}

/* field groups */
.group { margin-bottom: 14px; }
.group-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 7px;
}

/* segmented network control */
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(32, 36, 47, 0.04);
}
.pill {
  padding: 10px 6px 9px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.pill:first-child { border-left: 0; }
.pill small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 1px;
}
.pill:hover { color: var(--ink); }
.pill.selected {
  background: #F4F1FE;
  color: var(--brand-ink);
  box-shadow: inset 0 0 0 1.5px var(--brand-deep);
  border-radius: calc(var(--r-control) - 2px);
}
.pill.selected small { color: var(--brand-deep); }

/* Stripe-style inset-label fieldboxes */
.fieldbox {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  padding: 9px 13px 8px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(32, 36, 47, 0.04);
  transition: border-color 0.16s, box-shadow 0.16s;
  cursor: text;
}
.fieldbox:focus-within {
  border-color: var(--brand-deep);
  box-shadow: 0 0 0 4px var(--ring), 0 1px 2px rgba(32, 36, 47, 0.04);
  z-index: 1;
}
.fieldbox label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 1px;
  cursor: text;
}
.fieldbox label em { font-style: normal; color: var(--ink-3); font-weight: 400; }
.fieldbox input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  padding: 2px 0;
}
.fieldbox input::placeholder { color: #AEB3BD; }
.fieldbox:has(input.invalid) { border-color: var(--err); }
.fieldbox:has(input.invalid):focus-within { box-shadow: 0 0 0 4px rgba(215, 38, 76, 0.1); }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* joined first/last name pair */
.fieldbox-row { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.fieldbox-row .fieldbox { margin-bottom: 0; }
.fieldbox-row .fieldbox:first-child { border-radius: var(--r-control) 0 0 var(--r-control); }
.fieldbox-row .fieldbox:last-child { border-radius: 0 var(--r-control) var(--r-control) 0; border-left: 0; }
.fieldbox-row .fieldbox:last-child:focus-within { border-left: 1px solid var(--brand-deep); margin-left: -1px; }

/* amount */
.amountbox .amount-wrap { display: flex; align-items: baseline; gap: 10px; }
.amountbox .cur {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
  transform: translateY(-1px);
}
.amountbox input {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.under-hint { font-size: 12.5px; color: var(--ink-3); margin: -8px 0 14px 2px; }

.form-error { color: var(--err); font-size: 13.5px; margin: -2px 0 14px 2px; }
.form-error.info { color: var(--ink-2); }

/* button */
.btn {
  position: relative;
  width: 100%;
  border: 0;
  border-radius: var(--r-control);
  padding: 14px 18px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: 0.005em;
  color: #fff;
  background: var(--brand-deep);
  box-shadow: 0 1px 2px rgba(32, 36, 47, 0.18);
  cursor: pointer;
  transition: transform 0.14s var(--ease), box-shadow 0.18s, background 0.18s;
}
.btn:hover { background: var(--brand-ink); box-shadow: 0 3px 10px rgba(90, 56, 201, 0.25); }
.btn:active { transform: scale(0.985); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

.spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: -3px;
  animation: spin 0.7s linear infinite;
}
.btn.busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn.ghost {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(32, 36, 47, 0.05);
  margin-top: 24px;
}
.btn.ghost:hover { border-color: var(--brand-deep); box-shadow: 0 0 0 4px var(--ring); filter: none; }

.fine { font-size: 12.5px; color: var(--ink-3); margin-top: 16px; line-height: 1.55; }
.fine strong { color: var(--ink-2); }
.fine.lock svg { vertical-align: -2px; margin-right: 3px; color: var(--ink-3); }

/* result panels */
.panel { text-align: center; padding-top: 26px; }
.panel h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.panel p { color: var(--ink-2); font-size: 14.5px; }
.ref {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink) !important;
  background: #F4F5F8;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-control);
  padding: 11px 14px;
  margin: 16px 0 10px;
  word-break: break-all;
}

.check { width: 64px; height: 64px; margin: 0 auto 18px; display: block; }
.check-ring {
  fill: none;
  stroke: var(--ok);
  stroke-width: 2.5;
  stroke-dasharray: 183;
  stroke-dashoffset: 183;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: draw 0.7s var(--ease) forwards;
}
.check-mark {
  fill: none;
  stroke: var(--ok);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 0.45s 0.5s var(--ease) forwards;
}
.check.pending .check-ring, .check.pending .check-mark { stroke: #C99D1C; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.pane-foot {
  margin-top: 40px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}
.pane-foot a { color: var(--ink-3); }

/* ================= responsive ================= */
@media (max-width: 860px) {
  .checkout { grid-template-columns: 1fr; }
  .summary { padding: 22px 16px 24px; }
  .summary-amount { margin: 26px 0 0; }
  .big-amount { font-size: 40px; }
  .summary-card { display: none; }
  .summary-foot { display: none; }
  .pane { padding: 26px 16px 36px; }
}
@media (max-width: 420px) {
  .fieldbox-row { grid-template-columns: 1fr; }
  .fieldbox-row .fieldbox:first-child { border-radius: var(--r-control) var(--r-control) 0 0; }
  .fieldbox-row .fieldbox:last-child { border-radius: 0 0 var(--r-control) var(--r-control); border-left: 1px solid var(--line-strong); border-top: 0; }
  .pill small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
