/* StealthX checkout page. Uses the colour variables from styles.css. */
.pay { padding: 28px 0 72px; background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.pay-container { width: 100%; max-width: 1000px; margin: 0 auto; padding-inline: 24px; }

.pay-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.pay-back { display: inline-block; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.pay-back:hover { color: var(--text); }
.pay-head h1 { font-size: 1.85rem; font-weight: 700; }
.pay-steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--dim); }
.pay-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.pay-steps li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pay-steps li.on { color: var(--text); border-color: var(--border-strong); }
.pay-steps li.on span { background: var(--accent); color: var(--accent-ink); }
.pay-steps li.done { color: var(--muted); }
.pay-steps li.done span { background: rgba(28, 196, 157, 0.18); color: var(--accent); }

.pay-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.pay-card { border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8); }

/* Summary */
.pay-summary { padding: 22px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }
.sum-product { display: flex; align-items: center; gap: 12px; }
.sum-logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--border-strong); flex-shrink: 0; }
.sum-product strong { display: block; font-size: 16px; }
.sum-product span { font-size: 13.5px; color: var(--dim); }
.sum-field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sum-field input {
  width: 100%; padding: 11px 13px; border-radius: 9px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); font: 15px/1.3 var(--mono); letter-spacing: .5px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sum-field input::placeholder { color: #4d5461; }
.sum-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28, 196, 157, 0.15); }
.sum-field p { margin-top: 7px; font-size: 13px; color: var(--dim); }
.sum-field a { color: var(--accent); }
.sum-list { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: grid; gap: 9px; font-size: 14px; color: var(--muted); }
.sum-list li { position: relative; padding-left: 24px; }
.sum-list li::before {
  content: ''; position: absolute; left: 0; top: 3px; width: 15px; height: 15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231cc49d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4 10-10'/%3E%3C/svg%3E") center/15px no-repeat;
}
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; border-top: 1px solid var(--border); }
.sum-total span { font-size: 15px; color: var(--muted); }
.sum-total strong { font-size: 1.6rem; font-weight: 700; }

/* Payment panel */
.pay-panel { padding: 24px; min-height: 470px; display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 80px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.2rem; }
.panel-head span { font-size: 13.5px; color: var(--dim); }

.coin-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.coin-tab {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; cursor: pointer; min-width: 0;
  font: inherit; color: var(--text); text-align: left; background: var(--bg); border: 1px solid var(--border-strong);
  transition: border-color .15s ease, background-color .15s ease;
}
.coin-tab:hover:not(:disabled) { border-color: #4a5466; }
.coin-tab[aria-checked="true"] { border-color: var(--accent); background: rgba(28, 196, 157, 0.08); box-shadow: inset 0 0 0 1px var(--accent); }
.coin-tab:disabled { opacity: .4; cursor: not-allowed; }
.coin-logo { width: 30px; height: 30px; flex-shrink: 0; display: block; }
.coin-tab-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.coin-tab-text strong { font-size: 14.5px; }
.coin-tab-text small { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-tab-text small.manual { color: var(--warning); }

.pay-start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 12px 8px; }
.start-art { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--border-strong); }
.start-art svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pay-start p { max-width: 360px; color: var(--muted); }
.pay-start .btn { max-width: 360px; }

.pay-alert { width: 100%; padding: 11px 14px; border-radius: 9px; font-size: 14px; text-align: left; color: #f3a1ab; background: rgba(239, 91, 107, 0.07); border: 1px solid rgba(239, 91, 107, 0.35); }

/* Invoice */
.pay-invoice { display: flex; flex-direction: column; gap: 18px; }
.inv-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; }
.inv-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.inv-qr span { font-size: 12.5px; color: var(--dim); }
.qr { width: 172px; height: 172px; padding: 11px; border-radius: 12px; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.inv-fields { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.inv-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.inv-box { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 13px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border-strong); }
.inv-amount { flex: 1; min-width: 0; font: 700 1.35rem/1.25 var(--mono); }
.inv-address { flex: 1; min-width: 0; font: 500 13.5px/1.5 var(--mono); word-break: break-all; }
.inv-sub { display: block; margin-top: 5px; font-size: 13px; color: var(--muted); }
.copy-btn { flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-strong); }
.copy-btn:hover { color: var(--text); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }
.copy-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.inv-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--dim); }
.inv-meta strong { color: var(--text); font-weight: 600; }
.inv-timer strong { font-family: var(--mono); }
.inv-timer.low strong { color: var(--warning); }
.inv-note { font-size: 13.5px; color: var(--muted); padding: 11px 14px; border-radius: 9px; background: rgba(232, 183, 58, 0.06); border: 1px solid rgba(232, 183, 58, 0.22); }
.inv-note strong { color: var(--text); }

.inv-state { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border-strong); }
.inv-state strong { display: block; font-size: 15px; }
.inv-state span { display: block; font-size: 13.5px; color: var(--muted); }
.state-icon { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: pay-spin .9s linear infinite; }
.inv-state[data-state="confirming"] { border-color: rgba(28, 196, 157, 0.45); }
.inv-state[data-state="confirming"] .state-icon { border: 0; background: var(--accent); box-shadow: 0 0 0 5px rgba(28, 196, 157, 0.2); animation: pay-pulse 1.6s ease-in-out infinite; width: 14px; height: 14px; margin: 4px; }
.inv-state[data-state="reported"] { border-color: rgba(28, 196, 157, 0.45); }
.inv-state[data-state="reported"] .state-icon,
.inv-state[data-state="manual"] .state-icon { animation: none; border: 0; background: rgba(28, 196, 157, 0.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231cc49d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4 10-10'/%3E%3C/svg%3E") center/14px no-repeat; }
.inv-state[data-state="manual"] .state-icon { background-color: rgba(232, 183, 58, 0.15); background-image: none; border: 2px solid var(--warning); }
.inv-state[data-state="expired"] { border-color: rgba(239, 91, 107, 0.4); }
.inv-state[data-state="expired"] .state-icon { animation: none; border-color: var(--danger); }
@keyframes pay-spin { to { transform: rotate(360deg); } }
@keyframes pay-pulse { 50% { box-shadow: 0 0 0 9px rgba(28, 196, 157, 0.04); } }

.sent-box { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border-strong); }
.sent-box p { font-size: 14px; color: var(--muted); }
.inv-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--dim); }
.inv-foot code { white-space: nowrap; color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; font: 500 14px var(--font); color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Done */
.pay-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 20px 8px; }
.pay-done h2 { font-size: 1.5rem; }
.pay-done p { max-width: 380px; color: var(--muted); }
.pay-done code { white-space: nowrap; color: var(--text); }
.done-check { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: rgba(28, 196, 157, 0.12); border: 1px solid rgba(28, 196, 157, 0.4); }
.done-check svg { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

@media (max-width: 900px) {
  .pay-grid { grid-template-columns: 1fr; }
  .pay-summary { position: static; }
  .sum-list { display: none; }
}
@media (max-width: 600px) {
  .pay { padding-top: 18px; }
  .pay-container { padding-inline: 14px; }
  .pay-head h1 { font-size: 1.5rem; }
  .pay-steps li { padding: 4px 9px 4px 4px; font-size: 13px; }
  .pay-summary, .pay-panel { padding: 18px 16px; }
  .pay-panel { min-height: 0; }
  .coin-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-grid { grid-template-columns: 1fr; justify-items: center; }
  .inv-fields { width: 100%; }
  .done-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .state-icon { animation: none !important; }
}
