/* order.printscharm.ing. PCC purple #45419e and gold #edba36; the token block is
   copied from Auth/static/auth.css (memory pcc-apps-use-pcc-colours) so the shop and
   the back end look like the auth site and its apps. State colours (good, check,
   refused) are semantic and separate from the brand. Phone first. */
:root { --purple: #45419e; --deep: #332f78; --ink: #16123a; --gold: #edba36; --bg: #f6f4fc; --card: #fff; --line: #cfcbf1; --muted: #6b6892; --bad: #841617; --good: #1f7a3a;
  --good-bg: #e2f3e9; --warn: #7a4a00; --warn-bg: #fdf0dc; --bad-bg: #f7e1e1; --soft: #ecebf8; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root { --deep: #c9c5ff; --ink: #ecebfa; --bg: #15132b; --card: #211e3f; --line: #3d3970; --muted: #a9a6cf; --bad: #ff8a8a; --good: #7fd79a;
    --good-bg: #173a2a; --warn: #f3bf6b; --warn-bg: #3d2b10; --bad-bg: #44181c; --soft: #2a2750; color-scheme: dark; }
  a { color: #b9b4ff; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Montserrat, "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.45; }
a { color: var(--purple); }
h1 { font-size: 24px; margin: 18px 0 6px; color: var(--deep); }
h2 { font-size: 17px; margin: 0 0 10px; color: var(--deep); }
h3 { font-size: 15px; margin: 14px 0 6px; color: var(--deep); }
main { padding: 0 16px 40px; max-width: 760px; margin: 0 auto; }
.top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; background: var(--purple); color: #fff; padding: 10px 16px; }
.top .brand { color: #fff; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; font-size: 14px; }
.top nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 14px; }
.top nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 20px 76px; }
.card { background: var(--card); border-radius: 16px; box-shadow: 0 4px 16px rgba(51,47,120,.08); padding: 16px; margin: 14px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.loading { padding: 40px 0; }
.lead { font-size: 17px; margin: 0 0 6px; }
.banner { background: var(--gold); color: #16123a; border-radius: 12px; padding: 10px 14px; font-weight: 700; margin: 14px 0; }
.banner.test { background: var(--soft); color: var(--deep); border: 2px dashed var(--purple); }

/* the shop */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.product { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 14px; text-decoration: none; color: var(--ink); min-height: 150px; }
.product:hover { border-color: var(--purple); }
.product b { color: var(--deep); font-size: 17px; }
.product .from { margin-top: auto; font-weight: 700; color: var(--purple); }
.product.soon { opacity: .7; border-style: dashed; cursor: default; }
.product img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--soft); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--deep); align-self: flex-start; }
.badge.gold { background: var(--gold); color: #16123a; }

/* the order form */
.step { border-left: 4px solid var(--purple); padding-left: 12px; margin: 18px 0; }
.step > h2 { display: flex; gap: 8px; align-items: baseline; }
.step > h2 .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--purple); color: #fff; font-size: 13px; flex: none; }
.pick { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: var(--card); }
.opt:has(input:checked) { border-color: var(--purple); background: var(--soft); }
.opt input { accent-color: var(--purple); width: 18px; height: 18px; flex: none; }
.opt .price { margin-left: auto; font-weight: 700; color: var(--deep); white-space: nowrap; }
.opt .sub { display: block; font-size: 13px; color: var(--muted); }
label { display: block; margin: 10px 0 4px; font-size: 14px; color: var(--muted); font-weight: 600; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; width: 100%; background: var(--card); color: var(--ink); margin: 2px 0; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.qty { display: flex; align-items: center; gap: 8px; }
.qty input { width: 90px !important; text-align: center; }
.help { font-size: 13px; color: var(--muted); margin: 2px 0 0; }

/* the artwork drop and its check */
.drop { display: grid; place-items: center; gap: 6px; text-align: center; border: 2px dashed var(--purple); border-radius: 14px; padding: 22px 14px; background: var(--soft); cursor: pointer; }
.drop.over { background: var(--gold); }
.drop b { color: var(--deep); }
.drop input { display: none; }
.art { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; margin-top: 12px; }
@media (max-width: 420px) { .art { grid-template-columns: 1fr; } }
.art img { width: 110px; height: 110px; object-fit: contain; border-radius: 10px; border: 2px solid var(--line);
  background-color: #fff; background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.verdict { font-weight: 800; border-radius: 10px; padding: 6px 10px; display: inline-block; margin-bottom: 6px; }
.verdict.good { background: var(--good-bg); color: var(--good); }
.verdict.check { background: var(--warn-bg); color: var(--warn); }
.verdict.refused { background: var(--bad-bg); color: var(--bad); }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.findings li { padding-left: 22px; position: relative; }
.findings li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.findings li.info::before { content: "i"; color: var(--purple); left: 6px; }
.findings li.warn::before { content: "!"; color: var(--warn); left: 6px; }
.findings li.block::before { content: "x"; color: var(--bad); left: 4px; }
.fee { margin-top: 8px; font-weight: 700; color: var(--deep); }

/* the summary and paying */
.summary { width: 100%; border-collapse: collapse; font-size: 15px; }
.summary td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.summary td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.summary tr.total td { font-weight: 800; font-size: 18px; color: var(--deep); border-bottom: 0; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--purple); background: var(--card); color: var(--purple); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--purple); color: #fff; }
.btn.big { font-size: 18px; padding: 14px 28px; width: 100%; margin-top: 12px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.msg { min-height: 1.2em; margin: 8px 0 0; font-weight: 600; }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--good); }
#turnstile { margin-top: 12px; min-height: 65px; }
.status { font-size: 20px; font-weight: 800; color: var(--deep); }
.status.paid { color: var(--good); }

/* the back end */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tabs button { font: inherit; border: 2px solid var(--line); background: var(--card); color: var(--deep); border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer; }
.tabs button.on { background: var(--purple); border-color: var(--purple); color: #fff; }
table.orders { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border-radius: 12px; overflow: hidden; }
table.orders th, table.orders td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.orders th { background: var(--soft); color: var(--deep); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
table.orders tr { cursor: pointer; }
table.orders tr:hover td { background: var(--soft); }
.state { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.state.paid { background: var(--good-bg); color: var(--good); }
.state.awaiting_payment { background: var(--warn-bg); color: var(--warn); }
.state.cancelled, .state.failed { background: var(--bad-bg); color: var(--bad); }
.state.creating { background: var(--soft); color: var(--muted); }
.events { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.events li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.events code { color: var(--muted); word-break: break-all; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.wide { overflow-x: auto; }
[hidden] { display: none !important; }
table.orders select { width: auto; min-width: 10em; }
