:root {
  --ink: #17201d;
  --muted: #61706a;
  --paper: #f3f4ef;
  --panel: #fffef9;
  --rule: #d4d9d2;
  --accent: #e95436;
  --accent-dark: #b9341e;
  --success: #19734b;
  --warning: #94620e;
  --error: #a72d2d;
  --mono: "DM Mono", monospace;
  --body: "Manrope", sans-serif;
  --display: "Newsreader", serif;
  --s1: 0.5rem;
  --s2: 0.75rem;
  --s3: 1rem;
  --s4: 1.5rem;
  --s5: 2rem;
  --s6: 3rem;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 5; background: var(--ink); color: white; padding: 0.7rem 1rem; }
.skip-link:focus { top: 1rem; }

.topbar, footer {
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar { min-height: 76px; border-bottom: 1px solid var(--rule); }
.wordmark { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; font-weight: 700; }
.wordmark span { display: grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: white; font-family: var(--mono); font-size: 0.75rem; }
.environment { display: flex; align-items: center; gap: 0.55rem; font-family: var(--mono); font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.08em; }
.environment i { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px #e6d9be; }

.checkout-shell {
  width: min(1080px, calc(100% - 3rem));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 7rem);
  padding: 4rem 0;
}
.eyebrow { margin: 0 0 var(--s2); color: var(--accent-dark); font: 500 0.74rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
h1, h2 { font-family: var(--display); font-weight: 600; line-height: 0.98; }
h1 { max-width: 10ch; margin: 0; font-size: clamp(3.4rem, 6vw, 5.8rem); letter-spacing: -0.025em; }
h2 { margin: 0; font-size: 2rem; letter-spacing: -0.015em; }
.lede { max-width: 56ch; margin: var(--s4) 0 var(--s5); color: var(--muted); font-size: 1.04rem; }

.pack-visual { position: relative; width: min(100%, 500px); aspect-ratio: 16 / 8.5; background: #ced7c7; overflow: hidden; border: 1px solid #bcc7b5; }
.image-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(2, 1fr); opacity: 0.58; }
.image-grid span { border: 1px solid rgba(23,32,29,0.14); background: linear-gradient(145deg, transparent 48%, rgba(255,255,255,0.38) 49% 53%, transparent 54%); }
.credit-ticket { position: absolute; right: 1.25rem; bottom: 1.25rem; width: 156px; background: var(--accent); color: #fffdf8; padding: 1rem; box-shadow: 8px 8px 0 rgba(23,32,29,0.15); }
.credit-ticket small, .credit-ticket span { display: block; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.credit-ticket small { font-size: 0.65rem; }
.credit-ticket strong { display: block; margin: 0.3rem 0 0; font: 600 4rem/0.9 var(--display); }
.credit-ticket span { font-size: 0.68rem; }
.flow { display: grid; grid-template-columns: repeat(3, 1fr); width: min(100%, 500px); margin-top: var(--s3); border-top: 1px solid var(--rule); }
.flow div { padding: var(--s3) var(--s2) 0 0; display: grid; gap: 0.25rem; }
.flow b { font: 500 0.7rem var(--mono); color: var(--accent-dark); }
.flow span { font-size: 0.78rem; font-weight: 600; }

.order { background: var(--panel); border: 1px solid var(--rule); padding: clamp(1.4rem, 4vw, 2.5rem); box-shadow: 12px 12px 0 #e0e3dc; }
.order-heading { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: var(--s4); border-bottom: 1px solid var(--rule); }
.mode-badge { border: 1px solid #c29e57; color: var(--warning); background: #fbf4e5; padding: 0.28rem 0.52rem; font: 500 0.67rem var(--mono); letter-spacing: 0.08em; }
.line-item, .total { display: flex; justify-content: space-between; gap: var(--s3); }
.line-item { align-items: flex-start; padding: var(--s4) 0; }
.line-item div { display: grid; gap: 0.2rem; }
.line-item span { color: var(--muted); font-size: 0.78rem; }
.total { padding: var(--s3) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.total strong { font-size: 1.1rem; }
form { display: grid; gap: var(--s2); margin-top: var(--s4); }
label { font-size: 0.78rem; font-weight: 700; }
label span { color: var(--muted); font-weight: 500; }
input { width: 100%; min-height: 48px; border: 1px solid #adb7b0; background: white; border-radius: 2px; padding: 0 0.9rem; font: inherit; }
input:focus-visible { outline: 3px solid rgba(233,84,54,0.25); border-color: var(--accent-dark); }
button { min-height: 50px; border: 0; border-radius: 2px; display: flex; justify-content: center; align-items: center; gap: 0.6rem; padding: 0 1rem; background: var(--ink); color: white; font: 700 0.92rem var(--body); cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
button:hover:not(:disabled) { background: var(--accent-dark); }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible { outline: 3px solid rgba(233,84,54,0.3); outline-offset: 3px; }
button:disabled { cursor: not-allowed; background: #8c9691; }

.status { display: flex; gap: var(--s2); margin-top: var(--s3); padding: 0.85rem; border: 1px solid var(--rule); background: #f5f6f2; }
.status-mark { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 0.35rem; border-radius: 50%; background: #7b8781; }
.status strong, .status p { display: block; margin: 0; font-size: 0.75rem; }
.status p { color: var(--muted); }
.status.ready { border-color: #a8cbb9; background: #eff8f3; }
.status.ready .status-mark { background: var(--success); }
.status.warning { border-color: #dac492; background: #fcf7ea; }
.status.warning .status-mark { background: var(--warning); }
.status.error { border-color: #ddb0b0; background: #fff1f1; }
.status.error .status-mark { background: var(--error); }
.status.loading .status-mark { animation: pulse 1s infinite alternate; }

.test-card { margin-top: var(--s3); padding: var(--s3); background: #252e2b; color: #eef1ed; }
.test-card span { display: block; margin-bottom: 0.4rem; color: #bac4bf; font: 0.66rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.test-card code { font: 500 1rem var(--mono); }
.test-card p { margin: 0.5rem 0 0; color: #bac4bf; font-size: 0.7rem; }
.security-note { display: flex; gap: 0.5rem; align-items: center; margin: var(--s3) 0 0; color: var(--muted); font-size: 0.72rem; }
.security-note svg { flex: 0 0 auto; width: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
footer { min-height: 74px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.75rem; }
footer a { color: var(--ink); }

@keyframes pulse { to { opacity: 0.25; } }
@media (max-width: 820px) {
  .checkout-shell { grid-template-columns: 1fr; gap: 2.5rem; padding: 3rem 0; }
  .product { display: grid; }
  h1 { font-size: clamp(3rem, 15vw, 4.7rem); }
  .pack-visual, .flow { width: 100%; }
  .order { box-shadow: 7px 7px 0 #e0e3dc; }
}
@media (max-width: 520px) {
  .topbar, footer, .checkout-shell { width: min(100% - 2rem, 1080px); }
  .topbar { min-height: 66px; }
  .wordmark { font-size: 0.8rem; }
  .environment { font-size: 0.61rem; }
  .pack-visual { aspect-ratio: 5 / 4; }
  .credit-ticket { width: 136px; }
  .flow { gap: 0.25rem; }
  .flow span { font-size: 0.68rem; }
  .line-item { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
