/* Checkout + completion page — plain CSS. Colors meet WCAG AA contrast; focus is always visible. */
:root {
  --text: #1a1a1a;
  --muted: #4a4a4a;
  --bg: #ffffff;
  --surface: #f5f6f8;
  --line: #d9dce1;
  --border: #767676;
  --brand: #1b2a4a;
  --accent: #0b5cad;
  --accent-hover: #084a8c;
  --error: #b00020;
  --success: #1e6b34;
  --focus: #ffbf47;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font: 1.0625rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  padding: .75rem 1rem; background: var(--text); color: #fff; z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--text); }
[hidden] { display: none !important; }

/* ---------- header ---------- */

.site-header { border-bottom: 1px solid var(--line); text-align: center; padding: 1rem; }
.brand {
  font-size: 1.375rem; font-weight: 700; letter-spacing: .02em;
  color: var(--brand); text-decoration: none;
}
.brand:hover { text-decoration: underline; }

/* ---------- two-column layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 68rem; margin: 0 auto;
}
.order { background: var(--surface); border-bottom: 1px solid var(--line); padding: 1.25rem 1rem; }
.checkout-main { padding: 1.5rem 1rem 3rem; }

@media (min-width: 56rem) {
  .layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: calc(100vh - 4.5rem); }
  .checkout-main { grid-column: 1; grid-row: 1; padding: 2.5rem 3rem 3rem 1.5rem; }
  .order { grid-column: 2; grid-row: 1; border-bottom: 0; border-left: 1px solid var(--line); padding: 2.5rem 1.5rem 2.5rem 3rem; }
  .order-inner { position: sticky; top: 2rem; } /* the whole summary scrolls as one block */
}

/* ---------- order summary ---------- */

.order-item { display: flex; align-items: center; gap: 1rem; }
.order-thumb {
  flex: none; width: 4rem; height: 4rem; border-radius: var(--radius);
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; letter-spacing: .05em; border: 1px solid var(--line);
}
.order-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.order-thumb:has(img) { background: none; border: 0; } /* the image itself is rounded, so nothing dark shows at the corners */
.order-text { flex: 1; min-width: 0; }
.order-name { margin: 0; font-weight: 700; }
.order-includes { margin: 0; color: var(--muted); font-size: .9375rem; }
.order-price { margin: 0; font-weight: 600; }

.order-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 1.25rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.order-total dt { font-size: 1.25rem; font-weight: 700; }
.order-total dd { margin: 0; font-size: 1.5rem; font-weight: 700; }
.order-total .currency { font-size: .8125rem; font-weight: 400; color: var(--muted); margin-right: .25rem; }

/* ---------- form sections ---------- */

.section { margin-bottom: 2rem; }
.section:focus { outline: none; }
.section h2 { font-size: 1.375rem; line-height: 1.3; margin: 0 0 .25rem; }
.hint { color: var(--muted); margin: 0 0 1rem; font-size: .9375rem; }

.field { margin-bottom: 1rem; }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 36rem) { .field-row { grid-template-columns: minmax(0, 1fr) 10rem; } }

label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: 1rem; }
input[type="text"], input[type="email"] {
  width: 100%;
  padding: .75rem .875rem;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
input:focus-visible { border-color: var(--accent); }
input[aria-invalid="true"] { border: 2px solid var(--error); }

.error { color: var(--error); font-weight: 600; margin: .3rem 0 0; font-size: .9375rem; }
.error::before { content: "⚠ "; }

/* ---------- express buttons ---------- */

.express-label { text-align: center; color: var(--muted); font-size: .9375rem; margin: 1.25rem 0 .5rem; }
.express {
  display: grid; gap: .625rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}
.express-slot { min-height: 44px; }
.express-slot--wide { grid-column: span 2; }
@media (max-width: 26rem) { .express-slot--wide { grid-column: auto; } }

.divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0 1.25rem; color: var(--muted); font-size: .9375rem;
}
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

#payment-element { margin-bottom: .5rem; min-height: 3rem; }

/* ---------- buttons ---------- */

.button {
  display: inline-block; width: 100%;
  padding: .875rem 1.25rem; min-height: 52px;
  font: inherit; font-weight: 700; text-align: center; text-decoration: none;
  color: #fff; background: var(--accent);
  border: 2px solid var(--accent); border-radius: var(--radius); cursor: pointer;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button:disabled { opacity: .6; cursor: not-allowed; }
.button--pay { font-size: 1.125rem; }
.button--secondary { color: var(--accent); background: #fff; }
.button--secondary:hover { color: #fff; }

/* ---------- messages ---------- */

.status { min-height: 1.55em; margin: 0 0 .75rem; font-weight: 600; }
.status[data-kind="error"] { color: var(--error); }
.status[data-kind="info"] { color: var(--muted); }
.status--compact:empty { min-height: 0; margin: 0; } /* sign-in page: no reserved gap when there's no message */

.secure-note { margin-top: 1.5rem; color: var(--muted); font-size: .875rem; text-align: center; }

/* ---------- sign-in page (login/): grey page, white bordered box — matches the old /members/ page ---------- */

.boxed-page { background: #efefef; }
.boxed-page .checkout { max-width: 750px; padding: 20px 20px 3rem; }
.signin-box { background: #fff; border: 1px solid #000; padding: 20px; }

/* ---------- completion page (checkout/complete/) ---------- */

.checkout { max-width: 36rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
.checkout:focus { outline: none; }
.success h1, .success h2 { font-size: 1.5rem; margin: 0 0 .5rem; }
.success h1:focus { outline: none; }
.success { padding: 1.5rem; border: 2px solid var(--success); border-radius: var(--radius); background: #eef7f0; }
.next-steps { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 1rem; }
.next-steps .hint { margin: .5rem 0 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
