/* Shared checkout shell -- structure/layout only. Every color, font and piece
   of copy is a CSS custom property or inline content set by the page itself
   (model-heresy.html, together.html, ...), so this file never needs editing
   to add another course. Structure mirrors /joyful-marketing-checkout/index.html
   (the one other working checkout in this repo) deliberately -- same grid,
   same skeleton/error states, same Stripe mount point -- so this is a real
   shared system, not a look-alike rebuild.

   Required custom properties (set per-page):
     --ink, --ink-soft, --ink-faint, --rule, --bg, --accent, --accent-soft
     --font-body, --font-display
   Optional: --card-bg (defaults to #fff), --card-border (defaults to a
   translucent --ink line). */
:root {
  --card-bg: #fff;
  --card-border: rgba(0,0,0,.14);
}
html { scroll-behavior: smooth; }
* , *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.staff-banner {
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12.5px;
  letter-spacing: .04em;
  text-align: center;
  padding: 7px 12px;
}

.topbar {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 32px) 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  text-decoration: none;
}
.topbar .back {
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}
.topbar .back:hover { border-bottom-color: var(--ink-soft); }

main {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 16px) 24px clamp(64px, 8vw, 100px);
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: clamp(20px, 3vw, 32px) 0 8px;
  max-width: 20ch;
}
.sub {
  color: var(--ink-soft);
  font-size: 18px;
  margin: 0 0 clamp(32px, 5vw, 48px);
  max-width: 46ch;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 2px;
}

/* ---- order summary ---- */
.summary { padding: clamp(24px, 3vw, 32px); position: sticky; top: 24px; }
.summary .eyebrow {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 10px;
}
.summary h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  margin: 0 0 4px;
}
.summary .tagline {
  color: var(--accent);
  font-size: 15.5px;
  margin: 0 0 22px;
}
.summary ul {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}
.summary li {
  display: grid;
  grid-template-columns: 16px minmax(0,1fr);
  align-items: baseline;
}
.summary li span.dash { color: var(--accent); }
.summary .divider { border-top: 1px solid var(--rule); margin: 4px 0 20px; }
.summary .priceline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.summary .priceline .label {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.summary .priceline .amount {
  font-weight: 700;
  font-size: clamp(28px, 3vw, 34px);
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* ---- payment column ---- */
.payment { padding: clamp(24px, 3vw, 32px); min-height: 420px; }
.payment h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 4px;
}
.payment .trust {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin: 0 0 20px;
}
#checkout-element { min-height: 320px; }

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0 24px;
}
.skeleton .bar {
  height: 44px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0,0,0,.06) 25%, rgba(0,0,0,.11) 37%, rgba(0,0,0,.06) 63%);
  background-size: 400% 100%;
  animation: sgs-checkout-shimmer 1.4s ease infinite;
}
@media (prefers-reduced-motion: reduce) { .skeleton .bar { animation: none; } }
@keyframes sgs-checkout-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skeleton .note { font-size: 14px; color: var(--ink-faint); text-align: center; margin-top: 4px; }

.error-box {
  display: none;
  border: 1px solid var(--accent);
  /* Relative to --card-bg, not a hardcoded #fff -- a dark-themed course
     (e.g. Truth or Dare) sets --card-bg dark, and mixing against a
     hardcoded white here would render --ink's light text on a near-white
     box, illegible on exactly the course most likely to need this state
     read correctly. */
  background: color-mix(in srgb, var(--accent) 10%, var(--card-bg));
  color: var(--ink);
  border-radius: 2px;
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.55;
}
.error-box.show { display: block; }
.error-box button {
  margin-top: 12px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 2px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.error-box button:hover { background: var(--accent); }

.reassure {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-faint);
}
.reassure svg { flex: none; }

@media (max-width: 780px) {
  .grid { grid-template-columns: 1fr; }
  .summary { position: static; }
}

/* ---- success page (shared, themed via the same custom properties) ---- */
.success-wrap {
  min-height: calc(100vh - 34px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-card { max-width: 460px; margin: 0 auto; padding: 32px 24px; text-align: center; }
.success-dot {
  width: 10px; height: 10px; border-radius: 999px; background: var(--accent);
  display: inline-block; margin-right: 8px;
  animation: sgs-checkout-pulse 1.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .success-dot { animation: none; } }
@keyframes sgs-checkout-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.success-card h1 { font-size: 24px; margin: 0 0 12px; max-width: none; }
.success-card p { color: var(--ink-soft); margin: 0 0 8px; }
.success-actions { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.success-btn {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 2px;
}
.success-btn:hover { background: var(--accent); }
.success-btn.secondary {
  background: none;
  color: var(--ink-soft);
  padding: 4px;
  font-weight: 400;
  font-size: 14px;
  text-decoration: underline;
}

/* ---- email step + owner notices (duplicate-purchase guard, see
   community-server AGENTS.md 9a; markup is built by checkout-app.js) ---- */
.staff-banner[hidden], .email-step[hidden], .notice[hidden], .email-error[hidden],
.payment .signed-in[hidden] { display: none; }
.payment .signed-in { font-size: 13.5px; color: var(--ink-faint); margin: 0 0 20px; }
.payment .signed-in strong { color: var(--ink-soft); font-weight: 600; }
.link-btn {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}
.email-step { margin: 0 0 8px; }
.email-step .email-intro { font-size: 13.5px; color: var(--ink-faint); margin: 0 0 18px; }
.email-step label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 8px; }
.email-step .row { display: flex; gap: 10px; flex-wrap: wrap; }
.email-step input {
  flex: 1 1 240px;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--card-bg);
  color: var(--ink);
}
.email-step input:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
/* Text takes --card-bg, not #fff, so the dark-themed course (Truth or Dare,
   light --ink) gets dark text on a light button instead of white on cream. */
.btn-ink {
  background: var(--ink);
  color: var(--card-bg);
  border: none;
  border-radius: 2px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-ink:hover { background: var(--accent); }
.btn-ink[disabled] { opacity: .6; cursor: default; background: var(--ink); }
.email-error { color: var(--accent); font-size: 14px; margin: 10px 0 0; }
.notice {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 22px 24px;
  font-size: 15.5px;
  line-height: 1.55;
}
.notice h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.notice p { margin: 0 0 14px; color: var(--ink-soft); }
.notice p:last-child { margin-bottom: 0; }
.notice .small { font-size: 13.5px; color: var(--ink-faint); }

/* Terms + no-refunds line under the payment form (2026-11-02). Stripe's own
   required checkbox says the same inside the iframe; this makes it visible
   before anyone starts typing. */
.terms {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.terms a { color: var(--accent); }
