:root {
  /* MtaaCare palette: "Jacaranda sunset". Jacaranda purple blends through magenta into coral,
     with peach and gold accents. One gradient carries the brand; flat colours do the work. */
  --sunset: linear-gradient(135deg, #4B2A99 0%, #8A3DA6 52%, #E8607A 100%);
  --button: linear-gradient(135deg, #5B34A6 0%, #7A3AA8 100%);
  --ground: #FFF8F5;
  --card: #FFFFFF;
  --ink: #24173A;
  --muted: #6B6078;
  --line: #EEE2EA;
  --brand: #5B34A6;
  --brand-dark: #43247F;
  --brand-tint: #F1EBFB;
  --coral: #F2685A;
  --coral-tint: #FFE9E4;
  --sun: #FFC35C;
  --sun-tint: #FFF1E8;
  --brown: #8A3B1E;
  --green: #5B34A6;
  --red: #B42318;
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scroll-padding-bottom: 140px; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.page { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 20px 24px; }
.page.wide { max-width: 980px; }
.spacer { flex: 1; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 6px; padding: 14px 0 6px; margin-left: -10px; }
.topbar h1 { font-size: 20px; margin: 0; letter-spacing: -0.02em; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--ink); border-radius: 22px; cursor: pointer; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.brand-care { color: var(--brand); }
.hero-panel { position: relative; margin-top: 14px; border-radius: 28px; background: var(--sunset); color: #fff; padding: 28px 22px 0; overflow: hidden; }
.hero-panel .hero { color: #fff; margin: 0 0 10px; }
.hero-panel .lead { color: #F4E9FF; max-width: 330px; }
.hero-panel .skyline { display: block; width: calc(100% + 44px); margin: 22px -22px 0; height: auto; }
.chip-sun { position: absolute; right: 16px; top: 16px; padding: 6px 12px; border-radius: 14px; background: var(--sun); color: var(--ink); font-size: 12px; font-weight: 800; }

/* Type */
.hero { font-size: 32px; line-height: 1.12; font-weight: 800; letter-spacing: -0.03em; margin: 28px 0 10px; }
.lead { color: var(--muted); margin: 0; font-size: 15px; }
.label { display: block; font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.small { font-size: 13px; color: var(--muted); }
.center { text-align: center; }
.section { margin-top: 22px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgba(36, 23, 58, 0.04), 0 10px 28px -18px rgba(36, 23, 58, 0.22); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.option { display: flex; align-items: center; gap: 14px; padding: 16px; color: var(--ink); }
.option:hover { border-color: var(--brand); color: var(--ink); }
.option .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.option strong { font-size: 16px; }
.tile { width: 48px; height: 48px; flex: none; border-radius: 14px; background: var(--brand-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.banner { border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: flex-start; }
.banner.gold { background: var(--sun-tint); color: var(--ink); border: 1px solid #F9D6C4; }
.banner.gold svg { color: var(--coral); }
.banner.soft { background: var(--brand-tint); color: var(--brand); }
.banner.cream { background: var(--sun-tint); color: var(--brown); }
.banner.error { background: #FDECEA; color: var(--red); }
.banner strong { display: block; font-size: 15px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 56px; padding: 0 22px; border-radius: 28px; border: 0; background: var(--button); box-shadow: 0 6px 16px -8px rgba(91, 52, 166, 0.6); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; width: 100%; text-align: center; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn.ghost, .btn.gold { box-shadow: none; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); }
.btn.small { height: 44px; font-size: 14px; padding: 0 16px; width: auto; }
.btn.gold { background: var(--sun); color: var(--ink); }
.link-btn { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; font-size: 14px; background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0 4px; }
.sticky-cta { position: sticky; bottom: 0; background: linear-gradient(rgba(255, 248, 245, 0), var(--ground) 24%); padding: 24px 0 8px; margin-top: 16px; }

.sticky-cta.static { position: static; background: none; padding-top: 8px; }

/* Chips & segmented controls built on real radio/checkbox inputs */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; }
.chip input:checked + span { background: var(--button); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -8px rgba(91, 52, 166, 0.7); }
.chip input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.segmented .chip span { width: 100%; justify-content: center; border: 0; border-radius: 12px; background: transparent; font-weight: 700; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.input, select.input, textarea.input { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid #D9CCE0; background: var(--card); font-size: 16px; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--brand); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; min-height: 44px; padding-top: 10px; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--brand); }
.hint { font-size: 13px; color: var(--muted); }
.error-text { color: var(--red); font-size: 14px; font-weight: 600; margin: 10px 0 0; }

/* People */
.avatar { width: 52px; height: 52px; flex: none; border-radius: 26px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.avatar.big { width: 88px; height: 88px; border-radius: 44px; font-size: 30px; }
.av0 { background: #F3E3C7; color: #7A4B00; } .av1 { background: #DCE8F5; color: #1F4E79; } .av2 { background: #EADFF2; color: #5A2D82; } .av3 { background: #FFE3D3; color: #8A3B1E; }
.pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; background: var(--brand-tint); color: var(--brand); white-space: nowrap; }
.pill.strong { background: var(--button); color: #fff; }
.pill.gold { background: var(--sun-tint); color: var(--brown); }
.pill.grey { background: #F1EAF1; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; font-size: 13px; margin-top: 12px; }
.facts span { display: flex; align-items: center; gap: 6px; }
.help-card { display: block; color: var(--ink); }
.help-card:hover { border-color: var(--brand); color: var(--ink); }
.help-card.top { border: 2px solid transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--sunset) border-box; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.checklist li.no { color: var(--muted); font-weight: 500; }
.contact { display: flex; gap: 8px; margin-top: 12px; }
.contact .btn { height: 44px; font-size: 14px; }

/* Admin */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tabs button { height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.empty { text-align: center; padding: 32px 12px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Place search */
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px -18px rgba(36, 23, 58, 0.35); max-height: 300px; overflow-y: auto; }
.combo-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.combo-list li[aria-selected="true"] { background: var(--brand-tint); }
.combo-town { font-size: 13px; font-weight: 500; color: var(--muted); }
.combo-empty { color: var(--muted); font-weight: 500 !important; cursor: default !important; }
.input.picked { border-color: var(--brand); background-color: #FDFBFF; }
.search-input { padding-left: 44px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B6078' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; }


/* Step cards: one question per card, numbered */
.step-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; margin: 0; min-width: 0; box-shadow: 0 1px 2px rgba(36, 23, 58, 0.04), 0 10px 28px -18px rgba(36, 23, 58, 0.22); }
.step-card legend, .step-card .legend { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; margin: 0 0 12px; padding: 0; width: 100%; }
.step-card legend { float: left; }
.step-card legend + * { clear: both; }
.step-card .hint { display: block; }
.step-num { width: 28px; height: 28px; flex: none; border-radius: 14px; background: var(--sunset); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.note-toggle { margin-top: 6px; }
.note-toggle > summary { list-style: none; } .note-toggle > summary::-webkit-details-marker { display: none; }
.note-toggle textarea { margin-top: 6px; }

/* Progress bar for multi-step forms */
.progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 4px 0 6px; }
.progress i { height: 6px; border-radius: 3px; background: #E9DDEB; }
.progress i.on { background: var(--sunset); }
.wizard-nav { display: flex; gap: 10px; }
.wizard-nav .btn.ghost { flex: 0 0 38%; }

/* Dropdown with checkboxes */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-chev { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); flex: none; }
.dropdown[open] .dropdown-chev { transform: rotate(-135deg) translateY(-2px); }
.dropdown-panel { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 18px 40px -18px rgba(36, 23, 58, 0.35); }
.dropdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }

/* Success state */
.celebrate { text-align: center; padding: 28px 18px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 28px -18px rgba(36, 23, 58, 0.22); }
.celebrate-icon { width: 72px; height: 72px; margin: 0 auto; border-radius: 36px; background: var(--sunset); color: #fff; display: flex; align-items: center; justify-content: center; }
.celebrate-icon svg { width: 34px; height: 34px; }

/* Home */
.hero-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.btn.light { background: #fff; color: var(--brand-dark); box-shadow: 0 10px 24px -12px rgba(36, 23, 58, 0.6); }
.btn.light:hover { background: #FBF6FF; color: var(--brand-dark); }
.btn.outline-light { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.55); box-shadow: none; height: 50px; }
.btn.outline-light:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.trust div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px; font-size: 12px; font-weight: 700; line-height: 1.3; display: flex; flex-direction: column; gap: 8px; }
.trust .ic { width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); }
.trust div:nth-child(2) .ic { background: var(--coral-tint); color: #C2412F; }
.trust div:nth-child(3) .ic { background: var(--sun-tint); color: #A0570B; }
.how { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.how li { display: flex; gap: 12px; align-items: flex-start; }
.how b { display: block; font-size: 15px; }
.how span.small { display: block; }
.section-title { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 12px; }


/* ---------- Layout pieces shared by mobile and desktop ---------- */
.top-links { display: none; gap: 6px; }
.top-links a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 22px; font-weight: 700; font-size: 15px; color: var(--ink); }
.top-links a:hover { background: var(--brand-tint); color: var(--brand-dark); }
.options { display: flex; flex-direction: column; gap: 10px; }
.footer { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.helper-grid .col { display: flex; flex-direction: column; }
.helper-grid .col > .card + .card, .helper-grid .col > .card + .banner { margin-top: 16px; }
.profile-head { padding: 22px 16px; }
.helper-grid .col:last-child > :first-child { margin-top: 16px; }

/* ---------- Big screens: use the width ---------- */
@media (min-width: 900px) {
  .page { max-width: 1180px; padding: 0 40px 56px; }
  .page.narrow { max-width: 760px; }
  .page.join { max-width: 880px; }
  .page.wide { max-width: 1280px; }
  .topbar { padding-top: 22px; padding-bottom: 12px; }
  .top-links { display: flex; }

  /* Home */
  .home .hero-panel { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: end; gap: 24px; padding: 0 0 0 56px; min-height: 440px; }
  .home .hero-copy { padding: 56px 0; }
  .home .hero { font-size: 60px; line-height: 1.04; }
  .home .hero-panel .lead { font-size: 18px; max-width: 460px; }
  .home .hero-actions { flex-direction: row; }
  .home .hero-actions .btn { width: auto; padding: 0 28px; }
  .home .hero-panel .skyline { width: 100%; height: 300px; margin: 0; align-self: end; }
  .trust { gap: 16px; }
  .trust div { flex-direction: row; align-items: center; gap: 12px; padding: 18px 20px; font-size: 15px; }
  .options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .home .how { flex-direction: row; gap: 24px; }
  .home .how li { flex: 1; }
  .home .section { margin-top: 32px; }
  .footer { flex-direction: row; justify-content: space-between; }
  .footer .btn { width: auto; padding: 0 24px; }
  .footer p { text-align: right; }

  /* Find a helper: two columns of question cards */
  .find form.stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .find .error-text, .find .sticky-cta, .find .step-card.full { grid-column: 1 / -1; }
  .sticky-cta { position: static; padding-top: 8px; }
  .find .sticky-cta { width: 100%; max-width: 520px; margin: 4px auto 0; background: none; }

  /* Matches: side by side */
  .matches #list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
  .matches #list > .empty { grid-column: 1 / -1; }
  .matches .spacer, .helper .spacer { display: none; }
  .matches #cta .sticky-cta { max-width: 520px; margin: 20px auto 0; background: none; }

  /* Helper profile: two columns */
  .helper .helper-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
  .helper .helper-grid .col:last-child > :first-child { margin-top: 0; }
  .helper .sticky-cta { max-width: 520px; margin: 20px auto 0; background: none; }
}
