/* ==========================================================================
   CleanerConnect — design system (placeholder brand)
   Consumer marketplace: fresh, clean, 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 / Borrowhood, distinct teal palette.
   ========================================================================== */

:root {
  --brand:       #0e9e8f;   /* fresh teal — clean, hygienic, eco */
  --brand-deep:  #0a7d72;
  --brand-tint:  #def3f0;
  --sky:         #1f5c9e;   /* deep blue — trust, reliability */
  --sky-deep:    #16467a;
  --sky-tint:    #e4eef8;
  --gold:        #e0a428;   /* stars, highlights — used sparingly */
  --gold-tint:   #f8edd3;

  --ink:         #15302d;   /* primary text — ~13:1 on the cool-white page */
  --ink-soft:    #41605b;
  --muted:       #76908b;
  --line:        #dde9e5;
  --line-soft:   #e9f1ee;

  --bg:          #f4faf8;   /* cool, fresh off-white page */
  --bg-alt:      #e7f2ee;
  --card:        #ffffff;

  --ok:          #1f8a5b;  --ok-bg:    #e1f3e9;
  --warn:        #a9701a;  --warn-bg:  #f9efd6;
  --danger:      #c0392b;  --danger-bg:#fbe5e2;
  --info:        var(--sky-deep); --info-bg: var(--sky-tint);

  --radius:      14px;
  --radius-sm:   10px;
  --radius-lg:   22px;
  --shadow:      0 12px 34px rgba(17,48,45,.10);
  --shadow-sm:   0 2px 10px rgba(17,48,45,.07);
  --ring:        0 0 0 3px rgba(14,158,143,.34);

  --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(--sky-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(244,250,248,.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(--sky)); color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: var(--shadow-sm); overflow: hidden; }
.brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.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--sky { background: var(--sky); color: #fff; }
.btn--sky:hover { background: var(--sky-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--sky { background: var(--sky-tint); color: var(--sky-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(--brand-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=time], 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; }
/* checkbox / radio groups (offered services, availability, frequency) */
ul#id_offered_services, .checkbox-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 620px) { ul#id_offered_services { grid-template-columns: 1fr 1fr; } }
ul#id_offered_services li label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
ul#id_offered_services li input { width: 18px; height: 18px; min-height: 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: #c5dbf0; }
.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 { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero__art img { display: block; width: 100%; height: auto; }

/* ---------- Brand illustration icons ---------- */
.ico-img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 6px; }
.cat-card .ico-img { width: 84px; height: 84px; align-self: center; }
.ico-inline { width: 46px; height: 46px; object-fit: contain; flex: 0 0 auto; }
.empty .ico-img { width: 96px; height: 96px; }

/* ---------- 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; }

/* ---------- Category / service 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(--brand-deep); font-weight: 700; }

/* category / service 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; }

/* ---------- Cleaner card ---------- */
.cleaner-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cleaner-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cleaner-grid { grid-template-columns: repeat(3, 1fr); } }
.cleaner-card { display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .08s ease, box-shadow .15s ease; }
.cleaner-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.cleaner-card__top { display: flex; gap: 12px; align-items: center; }
.avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: var(--bg-alt); flex: 0 0 auto; display: grid; place-items: center; font-weight: 800; color: var(--brand-deep); font-size: 1.3rem; }
.avatar--lg { width: 104px; height: 104px; font-size: 2.2rem; }
.cleaner-card__name { font-weight: 800; }
.cleaner-card__rate { color: var(--brand-deep); font-weight: 800; }
.cleaner-card__rate small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg-alt); color: var(--ink-soft); }

/* ---------- Vetting checklist ---------- */
.vetting { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.vetting li { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.vetting .met { color: var(--ok); font-weight: 800; }
.vetting .unmet { color: var(--muted); }
.vetting .unmet span { color: var(--muted); }

/* ---------- Detail / price breakdown ---------- */
.split { display: grid; gap: 26px; }
@media (min-width: 860px) { .split { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.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(--brand); }
.timeline .when { font-size: .8rem; color: var(--muted); }

/* status pill (booking lifecycle) */
.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 { background: var(--sky-tint); color: var(--sky-deep); }
.status--confirmed { background: var(--brand-tint); color: var(--brand-deep); }
.status--completed { background: var(--ok-bg); color: var(--ok); }
.status--declined, .status--cancelled { background: var(--bg-alt); color: var(--muted); }

/* booking row (dashboard) */
.bk-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; text-decoration: none; color: var(--ink); }
.bk-row:hover { border-color: var(--brand); color: var(--ink); }
.bk-row__ico { width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.bk-row__main { flex: 1; min-width: 0; }
.bk-row__title { font-weight: 700; }
.bk-row__meta { font-size: .82rem; 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; }

/* frequency / role radios */
.pick-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-radios label { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; }
.pick-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; }

/* ---------- Nav search + bell ---------- */
.nav__search { flex: 1; max-width: 380px; margin-left: 4px; }
.nav__search input { width: 100%; min-height: 40px; padding: 8px 14px; border-radius: 999px; background: var(--bg-alt); border: 1.5px solid var(--line); font-size: .95rem; }
.nav__search input:focus { background: #fff; }
.nav__bell { position: relative; font-size: 1.15rem; text-decoration: none; padding: 8px 10px; }
.nav__badge { position: absolute; top: 0; right: 0; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 800; min-width: 17px; height: 17px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
@media (max-width: 860px) { .nav__search { order: 3; flex-basis: 100%; max-width: none; margin: 8px 0 0; } }

/* ---------- Location bar ---------- */
.locbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0 18px; }
.locbar input { min-height: 40px; }

/* ---------- Messages thread ---------- */
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; background: var(--bg-alt); }
.msg--mine { align-self: flex-end; background: var(--brand-tint); }
.msg__who { font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
.msg__body { font-size: .95rem; }

/* ---------- Notifications ---------- */
.note--unread { border-left: 4px solid var(--brand); background: var(--brand-tint); }

/* ---------- Legal pages ---------- */
.legal h2 { margin-top: 28px; font-size: 1.2rem; }
.legal p, .legal li { color: var(--ink-soft); }
.legal ul { padding-left: 20px; }
