:root {
  color-scheme: light;
  --page: #e9ecea;
  --surface: #ffffff;
  --surface-muted: #f4f5f3;
  --rail: #17231f;
  --rail-muted: #aebbb5;
  --ink: #18201d;
  --muted: #69736f;
  --line: #d8ddda;
  --line-strong: #bcc5c0;
  --accent: #e85d3f;
  --accent-strong: #c9482e;
  --accent-soft: #fff0eb;
  --mint: #bfe6d5;
  --focus: rgba(232, 93, 63, 0.24);
  --shadow: 0 20px 50px rgba(24, 32, 29, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: Aptos, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

button,
[role="radio"] {
  -webkit-tap-highlight-color: transparent;
}

.page-state[hidden],
.success-shell[hidden],
.checkout-shell[hidden],
.card-fields[hidden],
.card-loading[hidden],
.success-detail[hidden] {
  display: none;
}

.checkout-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.checkout-layout {
  width: min(100%, 1260px);
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid #cfd5d1;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-rail {
  min-width: 0;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  color: #ffffff;
  background: var(--rail);
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--rail);
  background: var(--mint);
  border-radius: 7px;
  font-size: 1.1rem;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
  overflow-wrap: anywhere;
}

.brand-lockup strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.brand-lockup > div > span {
  margin-top: 3px;
  color: var(--rail-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.checkout-steps {
  margin: 72px 0 0;
  padding: 0;
  list-style: none;
}

.checkout-steps li {
  min-height: 54px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #718079;
  font-size: 0.84rem;
  font-weight: 700;
}

.checkout-steps li:not(:last-child)::after {
  content: "";
  width: 1px;
  height: 26px;
  position: absolute;
  left: 13px;
  top: 28px;
  background: #3b4943;
}

.checkout-steps .is-complete {
  color: var(--rail-muted);
}

.checkout-steps .is-current {
  color: #ffffff;
}

.step-number {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #73817b;
  border: 1px solid #4b5a54;
  border-radius: 50%;
  font-size: 0.7rem;
  line-height: 1;
}

.is-complete .step-number {
  color: var(--rail);
  background: var(--mint);
  border-color: var(--mint);
}

.is-current .step-number {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.rail-assurance {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid #33413b;
}

.rail-assurance p,
.action-assurance p {
  margin: 0;
}

.rail-assurance strong,
.rail-assurance span {
  display: block;
}

.rail-assurance strong {
  font-size: 0.78rem;
  line-height: 1.3;
}

.rail-assurance p span {
  margin-top: 4px;
  color: var(--rail-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.shield-mark {
  flex: 0 0 auto;
  width: 16px;
  height: 19px;
  position: relative;
  border: 2px solid var(--mint);
  border-radius: 8px 8px 10px 10px;
}

.shield-mark::after {
  content: "";
  width: 4px;
  height: 7px;
  position: absolute;
  left: 4px;
  top: 3px;
  border: solid var(--mint);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkout-workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-muted);
}

.workspace-header {
  min-height: 130px;
  padding: 32px 42px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-label,
.state-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace-header h1 {
  margin: 6px 0 0;
  max-width: 640px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 720;
  line-height: 1.1;
  letter-spacing: 0;
}

.secure-badge {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #44514c;
  background: #f7f8f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1;
}

.lock-mark {
  width: 12px;
  height: 10px;
  position: relative;
  display: inline-block;
  border-radius: 2px;
  background: currentColor;
}

.lock-mark::before {
  content: "";
  width: 7px;
  height: 7px;
  position: absolute;
  left: 2.5px;
  top: -6px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.checkout-content {
  min-width: 0;
  flex: 1;
  padding: 34px 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 18px 34px;
}

.payment-section {
  min-width: 0;
  grid-row: 1 / span 2;
  padding-right: 4px;
}

.section-heading,
.receipt-heading,
.card-fields-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.3;
  letter-spacing: 0;
}

.channel-status,
.receipt-tag {
  flex: 0 0 auto;
  min-height: 27px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  color: #5b6863;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.71rem;
  font-weight: 760;
  line-height: 1;
}

.payment-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.payment-option {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  padding: 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.payment-option:hover {
  border-color: #9fa9a4;
  transform: translateY(-1px);
}

.payment-option:focus-visible,
.pay-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.payment-option.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.payment-icon {
  width: 44px;
  height: 34px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  font-weight: 850;
  line-height: 1;
}

.apple-icon {
  color: #ffffff;
  background: #111111;
  font-size: 0.66rem;
}

.paypal-icon {
  color: #174ea6;
  background: #e9f1ff;
  font-size: 1.3rem;
  font-style: italic;
}

.card-icon {
  background: #28363f;
}

.card-icon::before,
.card-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.card-icon::before {
  top: 8px;
  height: 5px;
}

.card-icon::after {
  width: 13px;
  right: auto;
  bottom: 7px;
  height: 4px;
}

.cashapp-icon {
  color: #08733b;
  background: #e1f7ea;
  font-size: 1.25rem;
}

.googlepay-icon {
  color: #2868d8;
  background: #ffffff;
  border: 1px solid #d8dde6;
  box-shadow: inset 0 -4px 0 #34a853;
  font-size: 1.2rem;
}

.payment-copy {
  min-width: 0;
}

.payment-copy strong,
.payment-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.payment-copy strong {
  font-size: 0.88rem;
  font-weight: 760;
  line-height: 1.3;
}

.payment-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.selection-mark {
  width: 18px;
  height: 18px;
  position: relative;
  display: block;
  border: 1.5px solid #aeb8b3;
  border-radius: 50%;
  background: #ffffff;
}

.payment-option.is-selected .selection-mark {
  border-color: var(--accent);
}

.payment-option.is-selected .selection-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  background: var(--accent);
}

.card-fields {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.card-fields-heading {
  align-items: baseline;
  margin-bottom: 12px;
}

.card-fields-heading > span {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: right;
}

.card-loading {
  min-height: 76px;
  margin: 0;
  padding: 16px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.84rem;
}

.checkout-card-container {
  width: 100%;
}

.amount-card {
  min-width: 0;
  padding: 24px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 8px 22px rgba(24, 32, 29, 0.05);
}

.receipt-heading {
  align-items: center;
}

.receipt-tag {
  color: #3e5c50;
  background: #eef8f3;
  border-color: #cfe5dc;
}

.amount-row {
  min-width: 0;
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px 10px;
}

.currency {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 780;
}

#amountValue {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 2.55rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

.summary-rule {
  height: 1px;
  margin: 24px 0 10px;
  border-top: 1px dashed var(--line-strong);
}

.summary-list {
  margin: 0;
}

.summary-list > div {
  padding: 11px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #ecefed;
}

.summary-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-list dt,
.summary-list dd {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  min-width: 0;
  color: var(--ink);
  font-weight: 720;
  overflow-wrap: anywhere;
  text-align: right;
}

.payment-actions {
  min-width: 0;
  padding: 22px 24px;
  background: var(--rail);
  border-radius: 7px;
}

.pay-button {
  width: 100%;
  min-height: 52px;
  padding: 12px 15px;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  box-shadow: 0 10px 22px rgba(232, 93, 63, 0.2);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pay-button:hover {
  background: var(--accent-strong);
  box-shadow: 0 12px 24px rgba(200, 72, 46, 0.24);
  transform: translateY(-1px);
}

.pay-button:disabled {
  color: #d4dbd8;
  background: #5c6964;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.action-assurance {
  margin-top: 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--rail-muted);
}

.action-assurance .lock-mark {
  flex: 0 0 auto;
  margin-top: 5px;
  color: var(--mint);
  transform: scale(0.82);
}

.action-assurance p {
  font-size: 0.69rem;
  line-height: 1.5;
}

.workspace-footer {
  min-height: 48px;
  padding: 12px 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #7a847f;
  background: var(--surface-muted);
  border-top: 1px solid var(--line);
  font-size: 0.69rem;
  line-height: 1.3;
}

.page-state,
.success-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  display: grid;
  place-items: center;
}

.state-card,
.success-panel {
  width: min(100%, 460px);
  padding: 40px;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.state-kicker {
  display: block;
  margin-bottom: 26px;
}

.spinner {
  display: inline-block;
  width: 38px;
  height: 38px;
  border: 4px solid #e5eae7;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.state-card h2,
.success-panel h1 {
  margin: 18px 0 8px;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.state-card p,
.success-panel > p:not(.section-label) {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

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

.success-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  position: relative;
  border-radius: 50%;
  background: #167558;
  box-shadow: 0 12px 24px rgba(22, 117, 88, 0.18);
}

.success-mark::after {
  content: "";
  width: 16px;
  height: 27px;
  position: absolute;
  left: 20px;
  top: 11px;
  border: solid #ffffff;
  border-width: 0 4px 4px 0;
  transform: rotate(45deg);
}

.success-panel .section-label {
  margin-bottom: 5px;
}

.success-panel h1 {
  margin-top: 0;
}

.success-details {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.success-detail {
  padding: 14px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.success-detail strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-align: right;
}

.toast {
  max-width: min(420px, calc(100% - 32px));
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  padding: 13px 15px;
  color: #ffffff;
  background: #17201d;
  border-radius: 6px;
  box-shadow: 0 16px 36px rgba(23, 32, 29, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 0.84rem;
  line-height: 1.4;
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1020px) {
  .checkout-shell {
    padding: 16px;
  }

  .checkout-layout {
    min-height: calc(100vh - 32px);
    min-height: calc(100dvh - 32px);
    grid-template-columns: 188px minmax(0, 1fr);
  }

  .brand-rail {
    padding: 24px 18px;
  }

  .checkout-steps {
    margin-top: 54px;
  }

  .workspace-header {
    padding-inline: 28px;
  }

  .checkout-content {
    padding: 28px;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 18px 24px;
  }

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

  .workspace-footer {
    padding-inline: 28px;
  }
}

@media (max-width: 860px) {
  html,
  body {
    background: var(--surface-muted);
  }

  .checkout-shell {
    padding: 0;
  }

  .checkout-layout {
    min-height: 100vh;
    min-height: 100dvh;
    display: block;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .brand-rail {
    min-height: 66px;
    padding: 12px 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .checkout-steps {
    margin: 0;
    display: flex;
    align-items: center;
  }

  .checkout-steps li {
    min-height: auto;
    align-items: center;
    gap: 0;
  }

  .checkout-steps li > span:last-child,
  .checkout-steps li:not(.is-current),
  .checkout-steps li::after,
  .rail-assurance {
    display: none;
  }

  .checkout-steps .is-current {
    display: flex;
  }

  .checkout-steps .is-current::before {
    content: "Step 2 of 3";
    margin-right: 9px;
    color: var(--rail-muted);
    font-size: 0.69rem;
    font-weight: 700;
  }

  .workspace-header {
    min-height: 118px;
    padding: 25px 20px 22px;
  }

  .workspace-header h1 {
    font-size: 1.65rem;
  }

  .secure-badge > span:last-child {
    display: none;
  }

  .secure-badge {
    width: 36px;
    height: 36px;
    justify-content: center;
    padding: 0;
  }

  .checkout-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .amount-card {
    order: 1;
  }

  .payment-section {
    order: 2;
    padding-right: 0;
  }

  .payment-actions {
    order: 3;
  }

  .payment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-option {
    min-height: 94px;
  }

  .amount-card {
    padding: 20px;
  }

  .amount-row {
    margin-top: 16px;
  }

  #amountValue {
    font-size: 2.15rem;
  }

  .summary-rule {
    margin: 18px 0 7px;
  }

  .summary-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .summary-list > div,
  .summary-list > div:last-child {
    min-width: 0;
    padding: 8px 0 0;
    display: block;
    border-bottom: 0;
  }

  .summary-list dd {
    margin-top: 3px;
    text-align: left;
  }

  .workspace-footer {
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  }

  .page-state,
  .success-shell {
    padding: 18px;
  }

  .state-card,
  .success-panel {
    padding: 34px 24px;
    box-shadow: none;
  }
}

@media (max-width: 520px) {
  .brand-lockup > div,
  .workspace-footer span[aria-hidden="true"],
  .workspace-footer span:last-child {
    display: none;
  }

  .workspace-header {
    align-items: flex-start;
  }

  .workspace-header h1 {
    max-width: 260px;
  }

  .checkout-content {
    padding-inline: 16px;
  }

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

  .payment-option {
    min-height: 82px;
  }

  .summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-list > div:first-child {
    grid-column: 1 / -1;
  }

  .card-fields-heading > span {
    max-width: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1400ms;
  }

  .payment-option,
  .pay-button,
  .toast {
    transition: none;
  }
}
