/* ==========================================================================
   NeighbourGood — design system (placeholder brand)
   Consumer marketplace: warm, neighbourly, high-trust. NOT the house CRT style.
   Targets WCAG 2.2 AA: strong contrast, legible type, generous tap targets.
   Lineage: same philosophy as careconnect.css, distinct terracotta/forest palette.
   ========================================================================== */

:root {
  --brand:       #cf5230;   /* terracotta — community noticeboard warmth */
  --brand-deep:  #ad3f1f;
  --brand-tint:  #fbe7df;
  --leaf:        #2f6b4f;   /* forest — local, growth, trust */
  --leaf-deep:   #224f3b;
  --leaf-tint:   #e6f0ea;
  --gold:        #d99323;   /* stars, highlights — used sparingly */
  --gold-tint:   #f8edd6;

  --ink:         #2a211b;   /* primary text — ~12:1 on cream */
  --ink-soft:    #574a40;
  --muted:       #847566;
  --line:        #ece3d5;
  --line-soft:   #f3ece1;

  --bg:          #faf6ef;   /* warm cream page */
  --bg-alt:      #f3ecdf;
  --card:        #ffffff;

  --ok:          #2e7d52;  --ok-bg:    #e3f3e8;
  --warn:        #b0741a;  --warn-bg:  #fbf0d9;
  --danger:      #bb3b22;  --danger-bg:#fbe6e0;
  --info:        var(--leaf-deep); --info-bg: var(--leaf-tint);

  --radius:      14px;
  --radius-sm:   10px;
  --radius-lg:   22px;
  --shadow:      0 12px 34px rgba(42,33,27,.09);
  --shadow-sm:   0 2px 10px rgba(42,33,27,.07);
  --ring:        0 0 0 3px rgba(207,82,48,.32);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1140px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background: var(--bg); line-height: 1.6; font-size: 17px;
}
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: var(--leaf-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(250,246,239,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav__inner { display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1.18rem; }
.brand__mark { width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: var(--shadow-sm); }
.nav__spacer { flex: 1; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a { color: var(--ink-soft); text-decoration: none; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: .97rem; }
.nav__links a:hover { background: var(--brand-tint); color: var(--brand-deep); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; }
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__links.is-open { display: flex; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--card); padding: 12px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav__toggle { display: grid; place-items: center; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; cursor: pointer; padding: 12px 22px; min-height: 48px; border-radius: 999px; border: 1.5px solid transparent; text-decoration: none; transition: transform .04s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-deep); color: #fff; }
.btn--leaf { background: var(--leaf); color: #fff; }
.btn--leaf:hover { background: var(--leaf-deep); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg-alt); }
.btn--white { background: #fff; color: var(--brand-deep); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--block { width: 100%; }
.btn--lg { padding: 16px 30px; font-size: 1.06rem; min-height: 56px; }
.btn--sm { padding: 7px 14px; min-height: 38px; font-size: .9rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.card--pad-lg { padding: 30px; }
.card--soft { background: var(--bg-alt); box-shadow: none; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* ---------- Badges / trust pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--bg-alt); color: var(--ink-soft); }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--leaf { background: var(--leaf-tint); color: var(--leaf-deep); }
.badge--brand { background: var(--brand-tint); color: var(--brand-deep); }
.badge--gold { background: var(--gold-tint); color: var(--warn); }
.trust { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .82rem; }
.trust--trusted { color: var(--leaf-deep); }
.trust--verified { color: var(--ok); }
.trust--new { color: var(--muted); }
.stars { color: var(--gold); letter-spacing: 1px; }
.stars .off { color: var(--line); }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label, label.field__label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field .help, .helptext, .form-help { font-size: .85rem; color: var(--muted); margin-top: 5px; display: block; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--ink); padding: 12px 14px; min-height: 48px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); outline: none; }
.checkline { display: flex; align-items: flex-start; gap: 10px; }
.checkline input { width: 20px; height: 20px; min-height: 0; margin-top: 3px; }
ul.errorlist, .errornote { color: var(--danger); font-size: .88rem; list-style: none; padding: 0; margin: 6px 0 0; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 12px; font-weight: 500; border: 1px solid transparent; }
.alert--ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cb; }
.alert--warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dcae; }
.alert--danger { background: var(--danger-bg); color: var(--danger); border-color: #f1c6bb; }
.alert--info { background: var(--info-bg); color: var(--info); border-color: #c8e0d4; }
.sim-banner { background: var(--gold-tint); color: var(--warn); text-align: center; font-size: .85rem; font-weight: 600; padding: 6px 12px; }

/* ---------- Hero ---------- */
.hero { padding: 54px 0 30px; }
.hero__grid { display: grid; gap: 30px; align-items: center; }
@media (min-width: 880px) { .hero__grid { grid-template-columns: 1.05fr .95fr; } }
.hero h1 { margin-bottom: 16px; }
.hero__lead { font-size: clamp(1.1rem, 2.2vw, 1.32rem); color: var(--ink-soft); margin-bottom: 24px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__stats { display: flex; gap: 28px; margin-top: 26px; }
.hero__stat b { display: block; font-size: 1.6rem; color: var(--brand-deep); }
.hero__stat span { font-size: .85rem; color: var(--muted); }
.hero__art { background: linear-gradient(160deg, var(--leaf-tint), var(--brand-tint)); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero__art .tile { background: #fff; border-radius: var(--radius-sm); padding: 14px 8px; text-align: center; box-shadow: var(--shadow-sm); }
.hero__art .tile span { display: block; font-size: 1.9rem; }
.hero__art .tile small { font-size: .72rem; color: var(--muted); font-weight: 600; }

/* ---------- Section ---------- */
.section { padding: 40px 0; }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800; color: var(--brand); margin-bottom: 8px; }

/* ---------- Catalogue grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 620px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 920px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-card { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease; }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand); color: var(--ink); }
.cat-card .ico { font-size: 2.1rem; line-height: 1; margin-bottom: 6px; }
.cat-card .name { font-weight: 700; }
.cat-card .meta { font-size: .82rem; color: var(--muted); margin-top: auto; }
.cat-card .avail { color: var(--leaf-deep); font-weight: 700; }

/* category filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.chip { padding: 7px 15px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft); font-weight: 600; font-size: .9rem; text-decoration: none; }
.chip:hover { border-color: var(--brand); color: var(--brand-deep); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Listing card ---------- */
.listing-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); transition: transform .08s ease, box-shadow .15s ease; }
.listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.listing-card__photo { aspect-ratio: 4 / 3; background: var(--bg-alt) center/cover no-repeat; display: grid; place-items: center; font-size: 3rem; color: var(--muted); }
.listing-card__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.listing-card__title { font-weight: 700; }
.listing-card__price { color: var(--brand-deep); font-weight: 800; font-size: 1.15rem; }
.listing-card__price small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.listing-card__meta { font-size: .82rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Detail / price breakdown ---------- */
.split { display: grid; gap: 26px; }
@media (min-width: 860px) { .split { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.photo-lg { aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--bg-alt) center/cover no-repeat; display: grid; place-items: center; font-size: 5rem; color: var(--muted); border: 1px solid var(--line); }
.pricebox { position: sticky; top: 84px; }
.ledger { width: 100%; border-collapse: collapse; }
.ledger td { padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.ledger td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ledger tr.total td { border-top: 2px solid var(--ink); border-bottom: none; font-weight: 800; font-size: 1.1rem; padding-top: 12px; }
.ledger tr.muted td { color: var(--muted); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--leaf); }
.timeline .when { font-size: .8rem; color: var(--muted); }

/* status pill */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem; }
.status--requested { background: var(--gold-tint); color: var(--warn); }
.status--accepted, .status--paid { background: var(--leaf-tint); color: var(--leaf-deep); }
.status--active { background: var(--brand-tint); color: var(--brand-deep); }
.status--returned { background: var(--info-bg); color: var(--info); }
.status--completed { background: var(--ok-bg); color: var(--ok); }
.status--declined, .status--cancelled { background: var(--bg-alt); color: var(--muted); }

/* radio star group */
.rating-radios { display: flex; gap: 6px; }
.rating-radios label { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; }
.rating-radios input { width: auto; min-height: 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-alt); margin-top: 48px; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; padding: 28px 0; font-size: .9rem; color: var(--muted); }
.footer a { color: var(--ink-soft); text-decoration: none; }
.footer a:hover { color: var(--brand-deep); }
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Steps (how it works) ---------- */
.steps { counter-reset: step; display: grid; gap: 18px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step::before { content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 12px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { font-size: 2.6rem; }
