:root {
    --bg: #f7f9fc;
    --ink: #1a2332;
    --muted: #5a6a7e;
    --line: #dde3ec;
    --accent: #0a4d8c;
    --accent-hover: #083f73;
    --ok: #1d7a46;
    --bad: #b32d2e;
    --warn: #a46a00;
    --card: #ffffff;
    --radius: 8px;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 1rem 0;
    margin-bottom: 2rem;
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; }
.site-header strong { font-size: 1.1rem; }
.site-header nav { margin-left: auto; }
.site-header nav a {
    margin-left: 1rem;
    color: var(--ink);
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}
.site-header nav a[aria-current="page"] {
    background: #eaf2fb;
    color: var(--accent);
}
.env-pill {
    font-family: var(--mono);
    font-size: 0.75rem;
    background: #fff3cd;
    color: #856404;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
}

/* Hide our site chrome when the prototype is embedded in a parent page
   (e.g. the WP /membership-form/ iframe). The parent already has its
   own branded header; ours would be redundant. Class is set on <html>
   by an inline script in view.php::layout_start() before first paint. */
.embedded .site-header,
.embedded .site-footer { display: none; }
.embedded main.wrap { padding-top: 1rem; padding-bottom: 0; }

h1 { margin-top: 0; }
.lede { color: var(--muted); font-size: 1.05rem; }

.site-footer {
    margin-top: 4rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

/* forms */
.wizard fieldset, .pay-form fieldset {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
legend {
    padding: 0 0.5rem;
    font-weight: 600;
}
label {
    display: block;
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
    color: var(--muted);
}
label input,
label select,
label textarea {
    display: block;
    width: 100%;
    padding: 0.55rem 0.7rem;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-top: 0.25rem;
}
label input:focus, label select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* tiers */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.tier {
    display: flex; align-items: flex-start; gap: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    cursor: pointer;
    background: #fff;
}
.tier input { margin-top: 0.25rem; }
.tier strong { display: block; }
.tier small { display: block; color: var(--muted); }
.tier .price {
    display: block; margin-top: 0.4rem;
    font-family: var(--mono); font-weight: 600; color: var(--accent);
}
.tier:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px #d6e7f8 inset;
}

/* actions */
.actions {
    display: flex; gap: 0.75rem; justify-content: flex-end; align-items: center;
    margin-top: 1.25rem;
}
button, .btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font: inherit; font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
}
button, .btn-primary {
    background: var(--accent); color: #fff; border-color: var(--accent);
}
button:hover, .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary {
    background: #fff; color: var(--ink); border-color: var(--line);
}

/* errors */
.errors {
    background: #fce8e8; border: 1px solid #f0b4b4; color: var(--bad);
    padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem;
}
.errors ul { margin: 0.4rem 0 0 1rem; }

/* review grid */
.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.review-grid section {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1rem 1.25rem;
}
.review-grid h2 {
    margin-top: 0; font-size: 1rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.04em;
}
dl { margin: 0; }
dl dt { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
dl dd { margin: 0.15rem 0 0 0; font-weight: 500; }
dl dt.total, dl dd.total {
    margin-top: 0.75rem; font-weight: 700; font-size: 1.1rem;
    border-top: 1px solid var(--line); padding-top: 0.6rem;
}

/* pay layout */
.pay-layout {
    display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem;
}
@media (max-width: 700px) { .pay-layout { grid-template-columns: 1fr; } }
.test-note {
    background: #fff8e1; border-left: 3px solid #f0b904;
    padding: 0.75rem 1rem; border-radius: 4px;
    color: #6e5100; font-size: 0.9rem;
}
.test-cards {
    background: #eef4fb; border: 1px solid #cfdff2;
    padding: 0.9rem 1.1rem; border-radius: 6px;
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
}
.test-cards ul { margin: 0.5rem 0 0.5rem 1rem; padding: 0; }
.test-cards code { font-family: var(--mono); background: #fff; padding: 0 4px; border-radius: 3px; }
.summary-card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    align-self: start;
}
.summary-card h2 {
    margin-top: 0; font-size: 0.95rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.04em;
}

/* receipt */
.receipt {
    background: var(--card); border: 1px solid var(--line);
    border-left: 5px solid var(--ok);
    border-radius: var(--radius); padding: 1.5rem 2rem;
}
.receipt.bad { border-left-color: var(--bad); }
.receipt-summary, .moneris-block, .netsuite-block {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.moneris-block dl, .netsuite-block dl, .receipt-summary dl {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.4rem 1rem;
}
.moneris-block dt, .netsuite-block dt, .receipt-summary dt {
    margin-top: 0; color: var(--muted);
}
.receipt-summary dl dt.total, .receipt-summary dl dd.total {
    grid-column: 1 / span 2;
    display: flex; justify-content: space-between;
    margin-top: 0.75rem;
}

/* admin table */
.kpis {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.kpi {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 0.75rem 1rem;
}
.kpi strong { display: block; font-size: 1.5rem; line-height: 1.2; }
.kpi .ok { color: var(--ok); }
.kpi .bad { color: var(--bad); }
.kpi span { color: var(--muted); font-size: 0.85rem; }

table.records {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}
table.records th, table.records td {
    padding: 0.7rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: 0.9rem;
}
table.records th { background: #f1f5fa; color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
table.records tr:last-child td { border-bottom: none; }
table.records code { font-family: var(--mono); font-size: 0.8rem; }

.pill {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pill-approved { background: #e0f5e7; color: var(--ok); }
.pill-declined { background: #fce8e8; color: var(--bad); }
.pill-pending  { background: #f0f1f5; color: var(--muted); }
.pill-error    { background: #fff3cd; color: var(--warn); }

/* detail grid */
.detail-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem;
}
.detail-grid section {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1rem 1.25rem;
}
.detail-grid h2 { margin-top: 0; font-size: 0.95rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

details.raw {
    margin-top: 1.5rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}
details.raw pre {
    background: #0d1117; color: #e6edf3;
    padding: 0.75rem; border-radius: 4px;
    overflow-x: auto;
    font-family: var(--mono); font-size: 0.8rem;
}

.empty-state {
    background: var(--card); border: 1px dashed var(--line);
    padding: 2rem; text-align: center; border-radius: var(--radius);
    color: var(--muted);
}

.tier-auto-card {
    display: flex; flex-direction: column; gap: 0.25rem;
    background: var(--card); border: 2px solid var(--accent);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    max-width: 28rem;
}
.tier-auto-card strong { font-size: 1.05rem; }
.tier-auto-card .price { font-weight: 700; color: var(--accent); margin-top: 0.25rem; }
.tier-auto-empty {
    border-color: var(--line); color: var(--muted);
    font-style: italic;
}
.field-hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.75rem; }

/* --- Payment-method step (method.php, 2026-09-18) ------------------------ */
/* Parity with the live form's payment-method select, rebuilt as radio cards. */
.method-choices { display: grid; gap: 0.6rem; border: 0; padding: 0; margin: 0 0 0.5rem; }
.method-choice {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    align-items: start;
    margin: 0;
    padding: 0.85rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}
.method-choice:hover { border-color: var(--accent); }
.method-choice:has(input:checked) {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}
/* Beats the generic `label input { display:block; width:100% }` rule above,
   which otherwise renders each radio as a full-width block on its own line. */
.method-choice input[type="radio"] {
    display: inline-block;
    width: auto;
    margin: 0.15rem 0 0;
    padding: 0;
    grid-row: 1 / span 2;
}
.method-choice .method-name { font-weight: 600; color: var(--ink); }
.method-choice .method-hint { color: var(--muted); font-size: 0.9rem; }
.method-total { margin: 1rem 0 0; font-weight: 600; color: var(--ink); }
.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Step-1 honeypot (lib/antispam.php). Off-screen rather than display:none,
   which simple bots skip. The markup also carries aria-hidden and tabindex=-1. */
.hp-field {
    position: absolute; left: -10000px; top: auto;
    width: 1px; height: 1px; overflow: hidden;
}

/* Receipt when payment is still owed (e-Transfer / EFT) */
.pay-instructions {
    margin: 1.2rem 0;
    padding: 1rem 1.2rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
}
.pay-instructions h2 { margin-top: 0; font-size: 1.05rem; }
.pay-instructions .reference { font-weight: 600; margin-bottom: 0; }
