:root {
    --ink: #1f2a37;
    --muted: #5b6776;
    --line: #dfe4ea;
    --paper: #fffdf9;
    --card: #ffffff;
    --accent: #1f7a5c;
    --accent-dark: #17614a;
    --warm: #f6efe4;
    --alert: #b42318;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 32px; padding-bottom: 64px; min-height: 60vh; }

a { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.3rem; }
small, .muted { color: var(--muted); }
code { background: var(--warm); padding: 1px 6px; border-radius: 4px; font-size: .9em; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--card); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.brand small { font-weight: 400; }
.mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
nav { display: flex; gap: 6px; }
nav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); }
nav a:hover { background: var(--warm); }
nav a[aria-current] { background: var(--accent); color: #fff; }
.count { display: inline-block; min-width: 1.4em; padding: 0 5px; text-align: center; border-radius: 999px; background: #fff; color: var(--accent-dark); font-size: .8em; font-weight: 700; }

.test-banner { margin: 0; padding: 8px 20px; text-align: center; background: #fff4d6; color: #7a5a00; font-size: .9rem; }
.demo-notice { padding: 10px 20px; text-align: center; background: #fff4d6; color: #6b4f00; font-size: .9rem; border-bottom: 1px solid #f0dfa8; }
.demo-notice p { margin: .15em auto; max-width: 100ch; }
.site-footer { border-top: 1px solid var(--line); background: var(--warm); padding: 24px 0; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: .2em 0; }

/* hero */
.hero { background: var(--warm); border-radius: var(--radius); padding: 48px 32px; margin-bottom: 40px; }
.hero h1 { font-size: 2.6rem; max-width: 18ch; }
.hero p { max-width: 52ch; font-size: 1.1rem; color: var(--muted); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* buttons */
.button, button {
    display: inline-block; padding: 10px 20px; border: 0; border-radius: var(--radius);
    background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover, button:hover { background: var(--accent-dark); }
.button.secondary { background: transparent; color: var(--accent-dark); box-shadow: inset 0 0 0 2px var(--accent); }
.button.secondary:hover { background: var(--card); }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* forms */
form p { margin: 0 0 14px; }
label { display: block; font-weight: 600; font-size: .95rem; }
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea {
    display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit;
    border: 1px solid #c4ccd6; border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #9bd3bf; outline-offset: 1px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0 6px; }
[aria-invalid=true] { border-color: var(--alert) !important; }
[role=alert] { color: var(--alert); font-weight: 600; }
[role=status] { color: var(--accent-dark); font-weight: 600; }

/* radios as pills */
fieldset label:has(input[type=radio]) {
    display: inline-block; margin: 0 8px 8px 0; padding: 8px 16px; border: 1px solid #c4ccd6; border-radius: 999px;
    font-weight: 600; cursor: pointer; background: #fff;
}
fieldset label:has(input[type=radio]:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
fieldset label:has(input[type=radio]) input { position: absolute; opacity: 0; pointer-events: none; }
fieldset label:has(input[type=radio]:focus-visible) { outline: 3px solid #9bd3bf; }
fieldset label:has(input[type=checkbox]) { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
fieldset label:has(input[type=checkbox]) input { margin-top: 5px; }

/* donate page */
.donate { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 800px) { .donate { grid-template-columns: 5fr 6fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 2px rgba(31, 42, 55, .04); }
.impact { list-style: none; padding: 0; margin: 20px 0; }
.impact li { padding: 10px 0 10px 34px; position: relative; border-bottom: 1px solid var(--line); }
.impact li::before { content: "£"; position: absolute; left: 0; top: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--warm); color: var(--accent-dark); font-weight: 700; text-align: center; font-size: .85rem; line-height: 24px; }
progress { width: 100%; height: 10px; accent-color: var(--accent); }

/* shop */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); list-style: none; padding: 0; margin: 0; }
.product { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.product .thumb { height: 150px; display: grid; place-items: center; font-size: 3.2rem; color: #fff; }
.product:nth-child(3n+1) .thumb { background: #1f7a5c; }
.product:nth-child(3n+2) .thumb { background: #c0792b; }
.product:nth-child(3n) .thumb { background: #3b6fa0; }
.product .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product h2 { margin: 0; font-size: 1.15rem; }
.price { font-size: 1.25rem; font-weight: 700; }
.product form { margin-top: auto; display: flex; gap: 10px; align-items: end; }
.product form label { flex: 0 0 90px; }

/* tables (basket) */
table { width: 100%; border-collapse: collapse; margin: 16px 0; background: var(--card); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
thead th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tfoot th { text-align: right; }
td input[type=number] { width: 80px; margin: 0; }
td button, th button { padding: 6px 12px; background: transparent; color: var(--alert); box-shadow: inset 0 0 0 1px #e3b4ae; font-weight: 500; }
td button:hover { background: #fdeceb; }

/* stripe payment form */
#payment-element { margin: 16px 0; }
#payment-form { max-width: 520px; }

/* basket extras */
.discount-form, form[action*="discount"] { max-width: 360px; }
main > p > a.button, main a.button[href="/checkout"] { margin-top: 12px; }

/* checkout */
form:has(input[name=action][value="small-change/checkout/start"]) { max-width: 640px; }
