/* ================================================================
   SCOPOS CHECKOUT — overlay chrome
   Digital Ghost Protocol: The Toolkit

   Ported from the Espresso IQ LTD checkout overlay and re-skinned to
   the Scopos design system. Every colour and face here resolves from
   the tokens already declared on digital-ghost.html (--red, --black,
   --ivory, --mid, --hairline2, --font-display, --font-body,
   --font-mono), so this file inherits the page rather than
   re-declaring a palette. The fallbacks exist only for the standalone
   review harness.

   The card fields themselves are NOT styled here — they live inside
   Stripe's iframe and are themed through the Appearance API in
   checkout.js. This file is everything around them.
================================================================ */

.sx-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sx-overlay[data-open="true"] { display: flex; }

.sx-panel {
  width: 100%;
  max-width: 520px;
  margin-top: 6vh;
  background: var(--black, #0D0D0D);
  border: 1px solid rgba(244, 243, 240, 0.14);
  border-top: 3px solid var(--red, #AC0014);
  padding: 32px 24px 40px;
}
@media (min-width: 640px) {
  .sx-panel { padding: 40px 40px 48px; }
}

.sx-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.sx-head .sx-label {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 243, 240, 0.55);
  margin: 0 0 8px;
}
.sx-head .sx-title {
  font-family: var(--font-display, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ivory, #F4F3F0);
  margin: 0;
}
.sx-close {
  flex: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  color: rgba(244, 243, 240, 0.55);
  transition: color 0.2s;
}
.sx-close:hover { color: var(--ivory, #F4F3F0); }

/* Test-mode banner. Shown only when Stripe reports livemode:false (see
   isTestMode in checkout.js); it is not removed at go-live, it stops
   applying. The [hidden] rule below is deliberate belt-and-braces: a page
   stylesheet that set a display value on .sx-testnote would otherwise beat
   the browser's own [hidden] rule and show a real buyer a notice telling
   them they were not charged. */
.sx-testnote[hidden] { display: none !important; }

.sx-testnote {
  margin: 0 0 22px;
  padding: 12px 14px;
  background: rgba(172, 0, 20, 0.14);
  border-left: 2px solid var(--red, #AC0014);
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: rgba(244, 243, 240, 0.82);
}
.sx-testnote strong { letter-spacing: 0.14em; }

.sx-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(244, 243, 240, 0.14);
}
.sx-line__name {
  font-family: var(--font-body, 'Barlow', sans-serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ivory, #F4F3F0);
}
.sx-line__sub {
  display: block;
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 243, 240, 0.55);
  margin-top: 6px;
}
.sx-line__price {
  flex: none;
  font-family: var(--font-display, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--ivory, #F4F3F0);
}

/* Refund terms. Small and muted on purpose: stated plainly at the point
   of payment rather than shouted on the sales page. */
.sx-refund {
  margin: -4px 0 22px;
  font-family: var(--font-body, 'Barlow', sans-serif);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(244, 243, 240, 0.72);
}

#sx-mount { min-height: 300px; }

.sx-slot { margin-bottom: 18px; }

.sx-loading,
.sx-error {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 243, 240, 0.55);
  padding: 28px 0;
}
.sx-error {
  color: #FF6B6B;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 13px;
}

/* Pay button — identical geometry and behaviour to the page's .btn-primary
   so checkout does not introduce a second button language. */
.sx-pay {
  display: block;
  width: 100%;
  padding: 16px 30px;
  background: var(--red, #AC0014);
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-family: var(--font-display, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s ease;
}
.sx-pay:hover:not(:disabled) { background: var(--red-dk, #8a0010); }
.sx-pay:disabled { opacity: 0.55; cursor: progress; }

.sx-secure {
  margin-top: 14px;
  font-family: var(--font-body, 'Barlow', sans-serif);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(244, 243, 240, 0.62);
  border-left: 2px solid rgba(244, 243, 240, 0.14);
  padding-left: 12px;
}

/* Post-payment confirmation and delivery. */
.sx-success__lede {
  font-family: var(--font-body, 'Barlow', sans-serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ivory, #F4F3F0);
  margin: 0 0 22px;
}
.sx-success__card {
  border: 1px solid rgba(244, 243, 240, 0.14);
  border-left: 3px solid var(--red, #AC0014);
  padding: 20px;
}
.sx-success__label {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 243, 240, 0.55);
  margin-bottom: 10px;
}
.sx-success__ref {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 13px;
  word-break: break-all;
  color: var(--ivory, #F4F3F0);
}

/* ── the download ────────────────────────────────────────────────────
   One product, one archive, one button. The kit is a guide, a tracker
   and the letters, identical for every buyer, so there is nothing to
   choose between and no second affordance competing with the button.
──────────────────────────────────────────────────────────────────── */
.sx-dl { margin: 0 0 18px; }

.sx-dl__btn {
  display: block;
  width: 100%;
  padding: 16px 30px;
  background: var(--red, #AC0014);
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-display, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s ease;
}
.sx-dl__btn:hover { background: var(--red-dk, #8a0010); color: #ffffff; }

.sx-dl__note {
  margin: 0 0 22px;
  font-family: var(--font-body, 'Barlow', sans-serif);
  font-size: 16px;
  line-height: 1.7;
  color: rgba(244, 243, 240, 0.72);
}
.sx-dl__note a { color: var(--ivory, #F4F3F0); }
