/* =========================================================
   Test Product / Payment Integration Test
   Clean, businesslike, matches the reference design.
   ========================================================= */

:root {
  --bg: #ffffff;
  --ink: #0e1116;
  --ink-soft: #4a5560;
  --ink-dim: #8a95a1;
  --rule: #e5e8ec;
  --primary: #1d4ed8;        /* the blue from the reference button */
  --primary-hover: #1a44bf;
  --primary-press: #15389d;
  --accent: #15a34a;         /* the green for the price */
  --danger-bg: #fee2e2;
  --danger-fg: #991b1b;
  --warn-bg: #fef3c7;
  --warn-fg: #92400e;
  --ok-bg: #dcfce7;
  --ok-fg: #166534;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 8px 24px rgba(15,23,42,.10);
  --shadow-lg: 0 24px 48px rgba(15,23,42,.18);
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Product page ---------- */

.product {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 40px;
  text-align: center;
}
.product__title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 12px;
}
.product__lede {
  color: var(--ink-soft);
  font-size: 18px;
  margin: 0 0 28px;
}
.product__image {
  margin: 8px 0 24px;
  display: flex;
  justify-content: center;
}
.product__price {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 24px;
}
.product__amount { color: var(--accent); }
.product__footer {
  margin-top: 100px;
  color: var(--ink-dim);
  font-size: 14px;
}

/* ---------- Buttons ---------- */

.btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 12px 22px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
.btn:focus-visible { outline: 3px solid rgba(29,78,216,.35); outline-offset: 2px; }
.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--primary-hover); }
.btn--primary:active { background: var(--primary-press); transform: translateY(1px); }
.btn--lg { padding: 16px 36px; font-size: 18px; }
.btn--ghost {
  background: #f1f4f8;
  color: var(--ink);
}
.btn--ghost:hover { background: #e5eaf1; }
.btn__icon { display: inline-block; }

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade .15s ease-out;
}
.modal__panel {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-lg);
  animation: rise .2s ease-out;
}
.modal__panel--wide { width: min(640px, calc(100vw - 32px)); }
.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--ink-soft);
  border-radius: 6px;
  cursor: pointer;
}
.modal__close:hover { background: #f1f4f8; color: var(--ink); }
.modal__title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.modal__sub {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
}
.modal__fields {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 20px;
  background: #fafbfc;
}
.modal__fields summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
}
.modal__fields[open] summary { margin-bottom: 12px; }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.grid__full { grid-column: 1 / -1; }
.grid label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.grid input {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
}
.grid input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.15);
}

/* ---------- Method tiles ---------- */

.methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.method {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .1s;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}
.method:hover {
  border-color: var(--primary);
  background: #f5f8ff;
}
.method:active { transform: translateY(1px); }
.method[disabled] { opacity: .5; cursor: progress; }
.method__icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.method__icon--alt { background: linear-gradient(135deg, #15a34a 0%, #16a34a 100%); }
.method__icon--alt2 { background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%); }
.method__body { flex: 1; min-width: 0; }
.method__name {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.method__sub {
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 2px;
}
.tag {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef2f7;
  color: var(--ink-soft);
}
.tag--h2h { background: #dbeafe; color: #1e40af; }
.tag--hpp { background: #fef3c7; color: #92400e; }
.method__chev {
  color: var(--ink-dim);
  font-size: 18px;
  flex: none;
}

/* ---------- Alerts ---------- */

.alert {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
}
.alert--error { background: var(--danger-bg); color: var(--danger-fg); }

/* ---------- Result drawer ---------- */

.result__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill--pending { background: var(--warn-bg); color: var(--warn-fg); }
.status-pill--pending::before { animation: pulse 1.4s ease-in-out infinite; }
.status-pill--paid { background: var(--ok-bg); color: var(--ok-fg); }
.status-pill--failed { background: var(--danger-bg); color: var(--danger-fg); }
.status-pill--info { background: #dbeafe; color: #1e40af; }

.result__body { font-size: 14px; }
.result__note {
  margin: 14px 0 18px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.info {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 4px 16px;
  background: #fafbfc;
  margin-bottom: 4px;
}
.info__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--rule);
}
.info__row:last-child { border-bottom: 0; }
.info__label {
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  flex: none;
}
.info__value {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  text-align: right;
  flex: 1;
  color: var(--ink);
}
.info__link {
  color: var(--primary);
  text-decoration: none;
}
.info__link:hover { text-decoration: underline; }

.result__debug {
  margin-top: 14px;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}
.result__debug summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.result__debug pre {
  margin-top: 10px;
  background: #0e1116;
  color: #d4d8de;
  padding: 12px 14px;
  border-radius: 8px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  max-height: 320px;
}

/* ---------- Loader ---------- */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .product { padding-top: 48px; }
  .product__title { font-size: 32px; }
  .grid { grid-template-columns: 1fr; }
  .modal__panel { padding: 22px 18px 18px; }
}
