:root {
  color-scheme: light;
  --bg: #eef2f5;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --ink: #141820;
  --muted: #667085;
  --line: #d8dee7;
  --line-strong: #aeb8c6;
  --blue: #0969da;
  --blue-dark: #064da3;
  --green: #12805c;
  --green-soft: #e9f8f0;
  --red: #c93d3d;
  --gold: #b6842c;
  --shadow: 0 18px 44px rgba(20, 24, 32, 0.1);
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.5;
  background:
    linear-gradient(135deg, rgba(9, 105, 218, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(18, 128, 92, 0.08), transparent 36%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

img,
svg {
  max-width: 100%;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.checkout-card {
  width: min(100%, 820px);
  min-height: 620px;
  background: var(--panel);
  border: 1px solid rgba(174, 184, 198, 0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4.5vw, 44px);
  position: relative;
  overflow: hidden;
}

.checkout-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold));
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  margin-bottom: clamp(26px, 5vw, 42px);
}

.brand-logo {
  width: min(210px, 48vw);
  max-width: 100%;
  height: auto;
  display: block;
  flex: 0 1 auto;
  object-fit: contain;
}

.brand-name {
  text-align: right;
  min-width: 0;
  flex: 1 1 auto;
}

.brand h1,
.section-head h2,
.loading-step h2,
.success-step h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.12;
}

.brand h1 {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 600;
  color: #202632;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.step {
  display: none;
  animation: stepIn 260ms var(--ease) both;
}

.step.is-active {
  display: block;
}

.section-head {
  margin-bottom: 22px;
}

.section-head h2 {
  max-width: 18ch;
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-weight: 600;
}

#detailsStep .section-head h2 {
  max-width: none;
}

.currency-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-inline-size: 0;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.currency-grid legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.currency-option {
  min-width: 0;
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.currency-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.currency-option span {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(1rem, 4vw, 1.15rem);
  font-weight: 650;
}

.currency-option small {
  color: var(--muted);
  font-size: 0.82rem;
}

.currency-option:hover,
.currency-option:focus-within {
  border-color: var(--blue);
}

.currency-option.is-selected {
  border-color: var(--blue);
  background: #edf5ff;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  min-width: 0;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  font-size: 0.98rem;
  font-weight: 400;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23141820' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px 18px;
}

.field input::placeholder {
  color: #8a94a3;
}

.field input:focus,
.field select:focus,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(9, 105, 218, 0.16);
}

.field input.is-invalid,
.field select.is-invalid {
  border-color: var(--red);
  background: #fff8f8;
}

.amount-field {
  margin-bottom: 24px;
}

.amount-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}

.amount-control span {
  min-width: 66px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel-soft);
  border-right: 1px solid var(--line);
  font-weight: 600;
}

.amount-control input {
  height: 52px;
  border: 0;
  border-radius: 0;
  font-size: clamp(1.45rem, 6vw, 2.1rem);
  font-weight: 500;
}

.amount-control:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(9, 105, 218, 0.16);
}

.error-text {
  min-height: 18px;
  color: var(--red);
  font-size: 0.86rem;
  font-weight: 600;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  color: #ffffff;
  background: var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line-strong);
}

.secondary-button:hover {
  border-color: var(--ink);
}

.summary-box {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-box div,
.receipt dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.summary-box span,
.receipt dt {
  color: var(--muted);
}

.summary-box strong,
.receipt dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.form-section {
  padding: 24px 0 0;
}

.form-section + .form-section {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.form-section h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.field.full {
  grid-column: 1 / -1;
}

.payment-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.payment-title h3 {
  margin-bottom: 4px;
}

.payment-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.payment-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: #667085;
}

.payment-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
}

.card-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 16px;
  align-items: end;
}

.card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  color: #667085;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card-row.split {
  grid-template-columns: 1fr 1fr;
}

.actions {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.loading-step,
.success-step {
  width: 100%;
  min-height: 440px;
  text-align: center;
  align-content: center;
  justify-items: center;
}

.loading-step.is-active,
.success-step.is-active {
  display: grid;
}

.loader {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  position: relative;
}

.loader span {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.loader span:nth-child(2) {
  inset: 12px;
  border-top-color: var(--green);
  animation-duration: 1200ms;
  animation-direction: reverse;
}

.loader span:nth-child(3) {
  inset: 28px;
  border-top-color: var(--gold);
  animation-duration: 700ms;
}

.loading-step p,
.success-step p {
  color: var(--muted);
}

.success-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #b8ebce;
  border-radius: 50%;
  font-size: 2.1rem;
  font-weight: 500;
}

.success-mark svg {
  width: 32px;
  height: 32px;
}

.receipt {
  width: 100%;
  max-width: 640px;
  margin: 24px auto;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.receipt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.receipt-head span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.receipt-head strong {
  display: block;
  margin-top: 3px;
  font-weight: 600;
}

.status-pill {
  color: var(--green) !important;
  background: var(--green-soft);
  border: 1px solid #b8ebce;
  border-radius: 999px;
  padding: 6px 11px;
  font-weight: 600;
}

.receipt dl {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 18px;
}

#newPaymentButton {
  max-width: 420px;
  margin: 0 auto;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 560px) {
  .app-shell {
    align-items: start;
    padding: 12px;
    overflow-x: clip;
  }

  .checkout-card {
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - 24px);
    padding: 22px 16px;
  }

  .brand {
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
  }

  .brand-logo {
    width: clamp(112px, 34vw, 140px);
  }

  .brand-name .eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    line-height: 1.2;
  }

  .brand h1 {
    max-width: 10ch;
    margin-left: auto;
    font-size: 0.86rem;
    line-height: 1.2;
  }

  .currency-grid {
    grid-template-columns: 1fr;
  }

  .currency-option {
    min-height: 66px;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 10px;
  }

  .field-grid,
  .actions,
  .card-row,
  .card-row.split {
    grid-template-columns: 1fr;
  }

  .card-icon {
    display: none;
  }

  .receipt dl div {
    display: grid;
    gap: 4px;
  }

  .receipt dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@supports not (overflow-x: clip) {
  html,
  body,
  .app-shell {
    overflow-x: hidden;
  }
}
