/* Checkout pages. Builds on main.css tokens and components. */

.checkout-header { height: var(--header-h); border-bottom: 1px solid var(--line); }
.checkout-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-2);
}
.secure-badge .icon { width: 18px; height: 18px; color: var(--accent-ink); }

.checkout { padding-block: 24px 64px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}
.back-link .icon { width: 18px; height: 18px; }

.checkout-title {
  margin-top: 12px;
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.test-banner {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--r-input);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.checkout-grid,
.result-layout {
  display: grid;
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}
.checkout-grid .summary { order: -1; }

@media (min-width: 900px) {
  .checkout-grid,
  .result-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
  .checkout-grid .summary { order: 0; position: sticky; top: 24px; }
}

/* ---------- Card form ---------- */
.pay-panel,
.summary,
.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
}
.pay-panel { padding: 20px; }
@media (min-width: 640px) { .pay-panel { padding: 28px 32px; } }

.card-form { display: grid; gap: 24px; }

.form-section { display: grid; gap: 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
.form-section-title { padding: 0; margin-bottom: 2px; font-size: 1.0625rem; font-weight: 800; color: var(--text); }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

select.text-input { padding-right: 10px; cursor: pointer; }

.pay-status {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--danger);
}
.pay-status:empty { display: none; }

.card-form .btn-block .icon { width: 20px; height: 20px; transform: none; }
.card-form .btn-block:hover .icon { transform: none; }
.card-form .btn-block[aria-busy="true"] { cursor: progress; }

.secure-note-left {
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  line-height: 1.5;
  font-weight: 500;
}
.secure-note-left .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--accent-ink); }

/* ---------- 3D Secure challenge (the SDK inserts #tds-challenge and sets display:block) ---------- */
#tds-challenge[style*="block"] {
  position: fixed;
  inset: 0;
  z-index: 60;
  margin: auto;
  width: min(500px, calc(100vw - 24px));
  height: min(600px, calc(100dvh - 24px));
  border: 0;
  border-radius: var(--r-card);
  background: #FFFFFF; /* bank pages are designed for a white background */
  box-shadow: 0 30px 80px -20px rgb(2 8 20 / 0.55);
}
.challenge-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgb(6 20 40 / 0.6);
}
.pay-panel:has(#tds-challenge[style*="block"]) .challenge-backdrop { display: block; }

/* ---------- Transak widget (lib/transak/checkout.php), also the hosted Blackstone page (lib/blackstone/hosted_checkout.php) ---------- */
.pay-panel-transak { padding: 0; overflow: hidden; }
.transak-frame {
  position: relative;
  height: min(720px, calc(100dvh - 96px));
  min-height: 560px;
}
.transak-iframe { display: block; width: 100%; height: 100%; border: 0; }
.transak-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--muted);
}
.transak-loading[hidden] { display: none; }
.transak-foot { display: grid; gap: 12px; padding: 16px 20px 20px; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .transak-foot { padding: 16px 32px 24px; } }
.transak-foot .btn { justify-self: start; }
.transak-foot .btn[hidden] { display: none; } /* .btn's display would otherwise override hidden */
.pay-status-ok { color: var(--text); }

/* ---------- Summary ---------- */
.summary { padding: 20px 24px; }
.summary-title { font-size: 1rem; font-weight: 800; letter-spacing: 0; }
.summary-list { display: grid; gap: 12px; margin: 16px 0 0; }
.summary-list > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.summary-list dt { color: var(--muted); font-size: 0.9375rem; font-weight: 600; }
.summary-list dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.summary-total {
  padding-block: 12px;
  border-block: 1px solid var(--line);
}
.summary-total dt { color: var(--text); }
.summary-total dd { font-size: 1.25rem; font-weight: 800; }
.summary-wallet { flex-direction: column; align-items: stretch !important; gap: 4px !important; }
.summary-wallet dd {
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  word-break: break-all;
  color: var(--text-2);
}
.summary-note { margin-top: 12px; font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; }

/* ---------- Result and message pages ---------- */
.result-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 40px 24px;
  text-align: center;
}
.checkout > .result-card { max-width: 560px; margin: 48px auto 0; }
.result-card h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.2; letter-spacing: -0.02em; }
.result-text { max-width: 46ch; color: var(--text-2); }
.result-card .btn { margin-top: 8px; }
.result-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--r-pill);
}
.result-icon .icon { width: 34px; height: 34px; }
.result-icon-success { background: var(--accent-soft); color: var(--accent-ink); }
.result-icon-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.checkout-footer {
  padding-block: 8px 32px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- Account pages (sign in, verify, name, reset) ---------- */
.auth-card {
  display: grid;
  gap: 16px;
  max-width: 460px;
  margin: 40px auto 0;
  padding: 32px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .auth-card { padding: 40px; } }
.auth-card h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem); line-height: 1.2; letter-spacing: -0.02em; }
.auth-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-pill);
  background: var(--icon-bg);
  color: var(--accent-ink);
}
.auth-icon .icon { width: 24px; height: 24px; }
.auth-lead { color: var(--text-2); overflow-wrap: anywhere; }
.auth-form { display: grid; gap: 16px; margin-top: 4px; }
.auth-foot { font-size: 0.9375rem; color: var(--text-2); }
.auth-foot a { font-weight: 700; }

.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-link { font-size: 0.8125rem; font-weight: 700; }
.code-input { font-size: 1.375rem; font-weight: 700; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }

.form-alert,
.form-notice {
  padding: 10px 14px;
  border-radius: var(--r-input);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
}
.form-alert { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.form-notice { color: var(--text); background: var(--accent-soft); }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Header: logo (and the account links on account pages), then the tools */
.header-start { display: flex; align-items: center; gap: 48px; min-width: 0; }
.header-tools { display: flex; align-items: center; gap: 12px; min-width: 0; }
@media (max-width: 399px) { .checkout-header .brand-logo { height: 28px; } }
@media (max-width: 359px) { .checkout-header .brand-logo { height: 24px; } }
