/*
 * Krepling Pay order confirmation ("Payment complete") page.
 *
 * Self-contained: everything is scoped under .kp-orx with a light reset so the
 * merchant theme's stylesheet (still loaded via wp_head for compatibility)
 * doesn't bleed into the page, and our styles don't leak elsewhere. Design
 * tokens mirror the drawer/checkout language; --kp-button-color comes from the
 * merchant's configured palette (printed inline by the bootstrap).
 */

.kp-orx-body {
  margin: 0;
  padding: 0;
  background: #f3f3f6;
}

.kp-orx {
  /* ---- Design tokens (mirror the drawer) ---- */
  --kp-orx-ink: #18181b;
  --kp-orx-ink-2: #3a3a42;
  --kp-orx-muted: #71717f;
  --kp-orx-hair: #e6e6ee;
  --kp-orx-surface: #ffffff;
  --kp-orx-page: #f3f3f6;
  --kp-orx-good: #1f9d55;
  --kp-orx-good-tint: #dcf7e3;
  --kp-orx-warn: #b7791f;
  --kp-orx-warn-tint: #fbf0d7;
  --kp-orx-bad: #c0392b;
  --kp-orx-bad-tint: #fbe4e1;
  --kp-orx-brand: var(--kp-button-color, #8e00e9);
  --kp-orx-brand-tint: color-mix(in srgb, var(--kp-button-color, #8e00e9) 9%, #ffffff);
  --kp-orx-divider: color-mix(in srgb, #18181b 20%, transparent);
  /* Shadows mirror the design tokens (hifi.css): a crisp raised surface plus a
   * white top "bevel" edge — used on the cards and the primary button. */
  --kp-orx-raise: 0 1px 1px rgba(20, 19, 29, 0.05), 0 3px 6px rgba(20, 19, 29, 0.08), 0 8px 18px -6px rgba(20, 19, 29, 0.16);
  --kp-orx-raise-sm: 0 1px 1px rgba(20, 19, 29, 0.04), 0 2px 6px -2px rgba(20, 19, 29, 0.1);
  --kp-orx-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --kp-orx-bevel-on: inset 0 1.5px 0 rgba(255, 255, 255, 0.4);

  min-height: 100vh;
  background: var(--kp-orx-page);
  color: var(--kp-orx-ink);
  font-family: "PPRadioGrotesk-Regular", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Light reset within scope so the theme can't restyle our elements. */
.kp-orx *,
.kp-orx *::before,
.kp-orx *::after {
  box-sizing: border-box;
}

.kp-orx h1,
.kp-orx p,
.kp-orx dl,
.kp-orx dd,
.kp-orx ul {
  margin: 0;
  padding: 0;
}

.kp-orx ul {
  list-style: none;
}

.kp-orx a {
  text-decoration: none;
}

/* ============================ Top bar ============================ */
.kp-orx__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
}

.kp-orx__bar-back {
  justify-self: start;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--kp-orx-ink);
  border-radius: 50%;
}

.kp-orx__bar-back:hover {
  background: rgba(16, 15, 25, 0.06);
}

.kp-orx__bar-title {
  justify-self: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--kp-orx-ink);
}

.kp-orx__bar-link {
  justify-self: end;
  font-size: 15px;
  font-weight: 600;
  color: #8e00e9;
}

.kp-orx__bar-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================ Layout ============================ */
.kp-orx__main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 24px 64px;
}

/* ============================ Hero ============================ */
.kp-orx__hero {
  text-align: center;
  padding: 24px 0 28px;
}

.kp-orx__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--kp-orx-good-tint);
  color: var(--kp-orx-good);
}

/* Per-state hero icon colours (success = default green above). */
.kp-orx__check--pending {
  background: var(--kp-orx-warn-tint);
  color: var(--kp-orx-warn);
}

.kp-orx__check--failed {
  background: var(--kp-orx-bad-tint);
  color: var(--kp-orx-bad);
}

.kp-orx__title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--kp-orx-ink);
}

.kp-orx__subtitle {
  margin-top: 8px;
  font-size: 16px;
  color: var(--kp-orx-muted);
}

/* ============================ Receipt card ============================ */
.kp-orx__card {
  padding: 26px 28px;
  border: 1px solid var(--kp-orx-hair);
  border-radius: 20px;
  background: var(--kp-orx-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.kp-orx__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.kp-orx__meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.kp-orx__meta-item--wide {
  grid-column: 1 / -1;
}

.kp-orx__meta-lab {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--kp-orx-muted);
}

.kp-orx__meta-val {
  font-size: 15px;
  font-weight: 500;
  color: var(--kp-orx-ink);
  word-break: break-word;
}

.kp-orx__divider {
  height: 1px;
  margin: 20px 0;
  background: var(--kp-orx-hair);
}

.kp-orx__divider--dotted {
  height: 0;
  border-top: 2px dotted var(--kp-orx-divider);
  background: none;
}

.kp-orx__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kp-orx__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.kp-orx__item-name {
  color: var(--kp-orx-ink);
  font-size: 15px;
}

.kp-orx__item-qty {
  color: var(--kp-orx-muted);
}

.kp-orx__item-total {
  font-size: 15px;
  font-weight: 500;
  color: var(--kp-orx-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kp-orx__totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kp-orx__total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.kp-orx__total-row dt {
  color: var(--kp-orx-ink-2);
  font-size: 15px;
}

.kp-orx__total-row dd {
  color: var(--kp-orx-ink-2);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kp-orx__grand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.kp-orx__grand-lab {
  font-size: 18px;
  font-weight: 800;
  color: var(--kp-orx-ink);
}

.kp-orx__grand-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--kp-orx-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ============================ Account banner ============================ */
.kp-orx__banner {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--kp-orx-brand-tint);
  border: 1px solid color-mix(in srgb, var(--kp-orx-brand) 22%, transparent);
}

.kp-orx__banner-tick {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--kp-orx-brand);
  color: #ffffff;
}

.kp-orx__banner-body {
  min-width: 0;
}

.kp-orx__banner-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--kp-orx-ink);
}

.kp-orx__banner-text {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--kp-orx-ink-2);
}

.kp-orx__banner-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--kp-orx-brand);
}

/* ============================ CTA ============================ */
.kp-orx__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #8e00e9;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--kp-orx-raise), var(--kp-orx-bevel-on);
  transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.kp-orx__cta:hover {
  filter: brightness(0.96);
}

.kp-orx__cta:active {
  transform: translateY(1px);
  box-shadow: var(--kp-orx-raise-sm), var(--kp-orx-bevel-on);
}

/* Secondary action (e.g. "Keep shopping" beneath "Try payment again"). */
.kp-orx__cta--secondary {
  margin-top: 10px;
  background: var(--kp-orx-surface);
  color: var(--kp-orx-ink);
  border-color: var(--kp-orx-hair);
  box-shadow: var(--kp-orx-raise), var(--kp-orx-bevel);
}

.kp-orx__cta--secondary:hover {
  filter: none;
  border-color: var(--kp-orx-muted);
}

.kp-orx__cta--secondary:active {
  box-shadow: var(--kp-orx-raise-sm), var(--kp-orx-bevel);
}

/* ============================ Responsive ============================ */
@media (max-width: 540px) {
  .kp-orx__bar {
    padding: 16px;
  }

  .kp-orx__main {
    padding: 8px 16px 48px;
  }

  .kp-orx__card {
    padding: 22px 18px;
  }

  .kp-orx__meta {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .kp-orx__title {
    font-size: 26px;
  }
}

/* ============================ Link colour overrides ============================ */
/* Pinned with .kp-orx-prefixed (two-class) specificity so neither the reset
 * above nor a host theme's generic a / a:link / a:visited rules (loaded via
 * wp_head) can override them. */
.kp-orx .kp-orx__bar-back {
  color: var(--kp-orx-ink);
}

.kp-orx .kp-orx__bar-link {
  color: #8e00e9;
}

.kp-orx .kp-orx__banner-link {
  color: var(--kp-orx-brand);
}

.kp-orx .kp-orx__cta {
  color: #ffffff;
}

.kp-orx .kp-orx__cta--secondary {
  color: var(--kp-orx-ink);
}
