/* Checkout pages: dissenters.pro/checkout/<plan>/ (tip, monthly, annual, lifetime). Driven by assets/checkout.js.
   The page is the newsroom look; only the payment box on the right is Substack-style (white card, rounded, sans, one red button). */
:root {
  --ink: #111; --red: #d4151c; --red-dark: #b01117; --grey: #ececec; --rule: #cfcfcf; --muted: #555; --line: #e3e3e3; --soft: #f7f7f7;
  --head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gut: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink); font: 400 18px/1.5 var(--serif); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gut); }

/* Header */
.co-head { background: #000; color: #fff; }
.co-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.co-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 900 18px/1 var(--head); font-stretch: 82%; text-transform: uppercase; letter-spacing: .01em; }
.co-brand img { width: 32px; height: 32px; border-radius: 50%; }
.co-back { font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; opacity: .85; }
.co-back:hover { opacity: 1; text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; }

/* Steps line */
.co-steps { border-bottom: 1px solid var(--ink); }
.co-steps ol { display: flex; gap: 22px; margin: 0; padding: 14px 0; list-style: none; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); counter-reset: s; }
.co-steps li { counter-increment: s; }
.co-steps li::before { content: counter(s) ". "; }
.co-steps li[aria-current] { color: var(--red); }

/* Layout */
.co-main { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(28px, 5vw, 72px); padding-top: clamp(32px, 5vw, 64px); padding-bottom: 80px; align-items: start; }
@media (max-width: 1100px) { .co-main { grid-template-columns: 1fr; } }

/* Summary */
.co-kicker { margin: 0 0 10px; font: 600 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--red); }
.co-title { margin: 0; font: 900 clamp(44px, 7vw, 88px)/.9 var(--head); font-stretch: 82%; text-transform: uppercase; letter-spacing: -.01em; }
.co-for { margin: 18px 0 0; max-width: 34ch; font-size: clamp(19px, 2vw, 22px); line-height: 1.4; color: #333; }
.co-price { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 0; padding: 18px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.co-price b { font: 900 56px/1 var(--head); font-stretch: 82%; }
.co-price span { font: 500 14px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.co-list { margin: 0; padding: 0; list-style: none; }
.co-list li { position: relative; padding: 12px 0 12px 26px; border-bottom: 1px solid var(--rule); }
.co-list li::before { content: ""; position: absolute; left: 2px; top: 22px; width: 12px; height: 4px; background: var(--red); }
.co-list li.no { color: #888; }
.co-list li.no::before { background: var(--rule); }
.co-small { margin: 18px 0 0; font-size: 15px; color: var(--muted); }

/* ---------- The payment box: Substack's look (centred, logo, bold heading, joined email bar), in red ---------- */
.co-pay { position: sticky; top: 24px; padding: 36px 32px 28px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: center; font: 400 16px/1.5 var(--sans); }
@media (max-width: 1100px) { .co-pay { position: static; } }
@media (max-width: 760px) { .co-pay { padding: 28px 18px 22px; } }
.sb-test { margin: -16px 0 20px; padding: 5px 10px; border-radius: 999px; background: #111; color: #fff; font-size: 12px; font-weight: 600; }
.sb-logo { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 10px; }
.sb-h { margin: 0; font: 700 28px/1.2 var(--sans); letter-spacing: -.02em; }
.sb-sub { margin: 8px auto 24px; max-width: 30ch; font-size: 16px; color: var(--muted); }
.co-form { text-align: left; }
.sb-step { margin: 0; }

/* Plan option rows */
.sb-plan { padding: 14px 16px; border: 1.5px solid var(--red); border-radius: 8px; background: #fff7f7; }
.sb-plan-row { display: flex; align-items: center; gap: 12px; }
.sb-radio { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--red); position: relative; }
.sb-radio::after { content: ""; position: absolute; left: 7px; top: 4px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sb-plan-name { flex: 1; font-weight: 600; }
.sb-price { white-space: nowrap; color: var(--muted); font-size: 15px; }
.sb-price b { color: var(--ink); font-size: 16px; }

/* Tip amounts */
.sb-amounts { display: grid; grid-template-columns: repeat(3, 1fr) 1.3fr; gap: 8px; }
.sb-amounts button, .sb-own { height: 46px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease); }
.sb-amounts button:hover, .sb-own:hover { border-color: #bbb; }
.sb-amounts button:active { transform: scale(.97); }
.sb-amounts button[aria-pressed="true"], .sb-own.on { border: 1.5px solid var(--red); color: var(--red); background: #fff7f7; }
.sb-own { display: flex; align-items: center; gap: 2px; padding: 0 10px; cursor: text; color: var(--muted); }
.sb-own input { width: 100%; border: 0; background: transparent; font-weight: 600; outline: none; -moz-appearance: textfield; }
.sb-own input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Email + button joined in one bar, Substack's signature */
.sb-label { display: block; margin: 22px 0 8px; font-weight: 600; font-size: 14px; }
.sb-join { display: flex; padding: 4px; border: 1px solid #d6d6d6; border-radius: 8px; background: #fff; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.sb-join:hover { border-color: #bbb; }
.sb-join:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(212, 21, 28, .12); }
.sb-input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; background: transparent; font-size: 16px; outline: none; }
.sb-join:has(.sb-input[aria-invalid="true"]) { border-color: var(--red); }
.sb-btn { flex: none; height: 44px; padding: 0 20px; border: 0; border-radius: 6px; background: var(--red); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: background-color .2s var(--ease), transform .12s var(--ease); }
.sb-btn:hover { background: var(--red-dark); }
.sb-btn:active { transform: scale(.97); }
.sb-help { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.sb-check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; font-size: 14px; color: #333; cursor: pointer; }
.sb-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.sb-err { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--red); }
.sb-fine { margin: 22px 0 0; font-size: 12px; color: #8a8a8a; text-align: center; }

/* Step 2: pay */
.sb-summary { text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 14px 16px; border-radius: 10px; background: var(--soft); font-size: 15px; }
.sb-summary #sum-plan { font-weight: 600; }
.sb-summary #sum-email { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-link { border: 0; background: none; padding: 0; color: var(--red); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.co-buttons { min-height: 110px; margin-top: 14px; }
.co-btn + .co-btn, .co-btn-note + .co-btn { margin-top: 12px; }
.co-switch { margin: 14px 0 0; font-size: 14px; text-align: center; }
.co-switch a { color: var(--red); font-weight: 600; text-underline-offset: 3px; }
.co-btn-note { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.co-msg { margin: 10px 0 0; font-size: 15px; text-align: center; }
.co-msg:empty { margin: 0; }
.co-msg.err { color: var(--red); font-weight: 600; }

/* Done */
.co-done { padding: 4px 0 0; font-size: 16px; }
.co-done strong:first-child { display: block; margin-bottom: 8px; font: 600 22px/1.25 var(--serif); }
.co-done a { color: var(--red); font-weight: 600; }
.co-closed { margin: 0; }

/* Footer */
.co-foot { background: #000; color: #bbb; }
.co-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 22px; padding-bottom: 22px; font: 500 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.co-foot a { color: #fff; }

/* Entrance */
@media (prefers-reduced-motion: no-preference) {
  .co-rise { animation: co-rise .8s var(--ease) both; }
  .co-rise:nth-child(2) { animation-delay: 90ms; }
  .sb-step:not([hidden]) { animation: sb-in .35s var(--ease) both; }
  @keyframes co-rise { from { opacity: 0; transform: translateY(36px); } }
  @keyframes sb-in { from { opacity: 0; transform: translateY(10px); } }
}
@media (max-width: 760px) { .co-steps ol { gap: 14px; font-size: 11px; } .co-brand span { display: none; } }
@media (max-width: 420px) { .sb-amounts { grid-template-columns: repeat(3, 1fr); } .sb-own { grid-column: 1 / -1; } }
