/* =========================================================================
   New Baby Legal Checklist — Niggly Stuff
   Palette: "Sage & Honey". Calm base, warm honey demoted to dated-deadline
   accents only. Mobile-first. Fonts vendored locally (no external requests).
   ========================================================================= */

/* --- Vendored fonts ------------------------------------------------------ */
@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fonts/fraunces-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fonts/fraunces-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

/* --- Tokens -------------------------------------------------------------- */
:root {
  --paper:      #F4F2EC;
  --surface:    #FFFFFF;
  --ink:        #33403A;
  --body:       #52605A;
  --muted:      #7B8580;
  --sage:       #7BA394;
  --sage-deep:  #4A6E60;
  --sage-tint:  #EAF0EC;
  --honey:      #D8A657;
  --honey-deep: #A9761F;
  --honey-tint: #FBF3E2;
  --line:       #E4E0D6;
  --shadow:     0 1px 2px rgba(51,64,58,.05), 0 8px 24px rgba(51,64,58,.06);
  --shadow-sm:  0 1px 2px rgba(51,64,58,.06);

  --display: 'Fraunces', 'Iowan Old Style', Palatino, Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 720px;
}

/* --- Reset-ish ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--sage-deep); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
img, svg { max-width: 100%; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

/* --- Accessibility helpers ---------------------------------------------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --- Site header --------------------------------------------------------- */
.site-head { padding: 16px 0; }
.site-head__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink); font-weight: 600; letter-spacing: -.01em;
}
.brand__mark { color: var(--sage); font-size: 1.2em; line-height: 1; }
.brand__name { font-size: .98rem; }
.scope-tag {
  font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  color: var(--sage-deep); background: var(--sage-tint);
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}

/* --- Intake -------------------------------------------------------------- */
.intake { padding-top: 8px; padding-bottom: 40px; }
.intake__intro { text-align: center; max-width: 560px; margin: 8px auto 26px; }
.intake__title {
  font-family: var(--display); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(2rem, 6vw, 2.85rem); margin-bottom: 12px;
}
.intake__lead { color: var(--body); font-size: 1.05rem; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 32px);
}
.intake__form { max-width: 540px; margin-inline: auto; }

.field { margin-bottom: 22px; border: 0; padding: 0; margin-inline: 0; }
.field > label, .field legend {
  display: block; font-weight: 600; color: var(--ink); margin-bottom: 7px; font-size: 1rem;
}
.field legend { padding: 0; }
.field__opt, .field__req { font-weight: 400; color: var(--muted); font-size: .85em; }
.field__help { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.field__error { font-size: .88rem; color: #B23B3B; margin-top: 6px; font-weight: 500; }

input[type="text"], input[type="date"] {
  width: 100%; font: inherit; color: var(--ink);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="text"]:focus, input[type="date"]:focus {
  border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-tint); outline: none;
}
input[aria-invalid="true"] { border-color: #C86B6B; }

.field--radio legend { margin-bottom: 4px; }
.radio-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.radio {
  flex: 1 1 120px; display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; background: #fff; transition: border-color .15s, background .15s;
  font-weight: 500; color: var(--ink);
}
.radio:hover { border-color: var(--sage); }
.radio:has(input:checked) { border-color: var(--sage); background: var(--sage-tint); }
.radio input { accent-color: var(--sage-deep); width: 18px; height: 18px; }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; transition: transform .06s ease, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn--block { width: 100%; margin-top: 6px; }
.btn--primary { background: var(--sage-deep); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: #3E5E51; color: #fff; }
.btn--ghost { background: transparent; color: var(--sage-deep); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--sage); background: var(--sage-tint); color: var(--sage-deep); }
.btn--will { background: var(--honey); color: #3a2a06; border-color: var(--honey); box-shadow: var(--shadow-sm); }
.btn--will:hover { background: #cf9942; color: #3a2a06; }

.intake__privacy {
  margin-top: 18px; font-size: .84rem; color: var(--muted); text-align: center; line-height: 1.5;
}

/* --- Results ------------------------------------------------------------- */
.results { padding-bottom: 56px; }
.result-head { text-align: center; max-width: 620px; margin: 8px auto 30px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .72rem;
  font-weight: 600; color: var(--sage-deep); margin-bottom: 10px;
}
.result-title {
  font-family: var(--display); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(1.9rem, 6vw, 2.6rem); margin-bottom: 10px; outline: none;
}
.result-sub { color: var(--muted); font-size: .95rem; }

/* --- Groups -------------------------------------------------------------- */
.group { margin-bottom: 34px; }
.group-title {
  font-family: var(--display); font-weight: 600; font-size: 1.28rem;
  letter-spacing: -.01em; margin-bottom: 4px;
}
.group-sub { color: var(--muted); font-size: .9rem; margin-bottom: 16px; max-width: 60ch; }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

/* --- Item base ----------------------------------------------------------- */
.item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
  position: relative; transition: opacity .2s ease;
}
.item-row { display: flex; gap: 14px; align-items: flex-start; }
.item-check {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 2px;
  accent-color: var(--sage-deep); cursor: pointer;
}
.item-main { flex: 1 1 auto; min-width: 0; }
.item-title {
  display: block; font-weight: 600; color: var(--ink); font-size: 1.08rem;
  line-height: 1.3; cursor: pointer;
}
.item-note { color: var(--body); font-size: .95rem; margin-top: 6px; }
.item-link {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 12px;
  font-weight: 600; font-size: .92rem; text-decoration: none;
  color: var(--sage-deep); background: var(--sage-tint);
  padding: 8px 14px; border-radius: 999px;
}
.item-link:hover { background: #DEE9E2; color: var(--ink); }
.item-link .ext { font-size: .9em; }

.item.is-done { opacity: .62; }
.item.is-done .item-title { text-decoration: line-through; text-decoration-color: var(--muted); }

/* --- Light group: quieter, clearly separated ----------------------------- */
.group--light { border-top: 1px dashed var(--line); padding-top: 26px; }
.item--light {
  box-shadow: none; background: transparent; border-color: transparent;
  border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 4px;
}
.item--light .item-title { font-size: 1rem; font-weight: 600; }
.item--light .item-note { font-size: .9rem; }
.items:has(.item--light) { gap: 0; }

/* --- Dated items: elevated + honey date chip ----------------------------- */
.item--dated {
  border-color: #EAD9B4;
  box-shadow: 0 1px 2px rgba(169,118,31,.06), 0 10px 28px rgba(169,118,31,.10);
  padding-top: 20px;
}
.item--dated::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px;
  background: var(--honey); border-radius: 0 4px 4px 0;
}
.date-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  background: var(--honey-tint); border: 1px solid #EAD9B4; border-radius: 12px;
  padding: 8px 14px; margin-bottom: 14px;
}
.date-chip__date {
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  color: var(--honey-deep); line-height: 1.1;
}
.date-chip__sub {
  font-size: .74rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: #8A6A2E; margin-top: 2px;
}

/* --- Child Benefit answer sheet ------------------------------------------ */
.answer-sheet { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.answer-sheet > summary {
  cursor: pointer; font-weight: 600; color: var(--sage-deep); font-size: .95rem;
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.answer-sheet > summary::-webkit-details-marker { display: none; }
.answer-sheet .chevron { transition: transform .15s ease; display: inline-block; }
.answer-sheet[open] .chevron { transform: rotate(90deg); }
.answer-sheet__body { margin-top: 14px; }
.answer-sheet__caption {
  font-size: .9rem; color: var(--body);
  background: var(--honey-tint); border: 1px solid #EAD9B4;
  padding: 12px 14px; border-radius: 10px;
}
.answer-list { margin: 14px 0 0; display: grid; gap: 0; }
.answer-list dt {
  font-weight: 600; color: var(--ink); font-size: .92rem; margin-top: 14px;
}
.answer-list dt:first-child { margin-top: 0; }
.answer-list dd { margin: 3px 0 0; color: var(--body); font-size: .92rem; }
.hicbc-note {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
  background: var(--sage-tint); border: 1px solid #CFE0D6;
}
.hicbc-note__title { font-weight: 700; color: var(--sage-deep); margin-bottom: 6px; }
.hicbc-note p { font-size: .92rem; color: var(--body); }
.hicbc-note a { display: inline-block; margin-top: 8px; font-weight: 600; font-size: .9rem; }

/* --- Will CTA + Fane aside ----------------------------------------------- */
.will-cta { margin-top: 16px; }
.will-cta .btn--will { width: 100%; }
.will-cta__hint { font-size: .84rem; color: var(--muted); margin-top: 8px; text-align: center; }

.fane-aside {
  margin-top: 18px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--sage-tint); border: 1px solid #CFE0D6;
}
.fane-aside__lead { font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.fane-aside p { font-size: .93rem; color: var(--body); }
.fane-aside__link {
  display: inline-block; margin-top: 12px; font-weight: 600;
  background: var(--sage-deep); color: #fff; text-decoration: none;
  padding: 9px 18px; border-radius: 999px; font-size: .92rem;
}
.fane-aside__link:hover { background: #3E5E51; color: #fff; }
.fane-aside__reg { margin-top: 12px; font-size: .74rem; color: var(--muted); line-height: 1.45; }

/* --- Actions ------------------------------------------------------------- */
.actions {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line);
}

/* --- Footer -------------------------------------------------------------- */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 46px; margin-top: 10px; }
.disclaimer { font-size: .85rem; color: var(--muted); max-width: 62ch; }
.disclaimer strong { color: var(--body); }
.foot-links {
  margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  font-size: .88rem;
}
.foot-links a { font-weight: 600; }
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--sage-deep); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.linkbtn:hover { color: var(--ink); }
.foot-fane { margin-top: 16px; font-size: .74rem; color: var(--muted); max-width: 62ch; line-height: 1.5; }

/* --- Collapse intake once results are shown ------------------------------ */
.intake.is-collapsed { display: none; }

/* --- Larger screens ------------------------------------------------------ */
@media (min-width: 640px) {
  body { font-size: 18px; }
  .item--dated .item-row { position: relative; }
  /* Float the date chip to the top-right on wider viewports. */
  .item--dated.has-chip { padding-right: 20px; }
  .item--dated .date-chip {
    position: absolute; top: 18px; right: 20px; margin-bottom: 0; align-items: flex-end;
  }
  .item--dated .item-main { padding-right: 132px; }
}

/* --- Motion & print ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .site-head, .site-foot, .intake, .actions, .answer-sheet > summary { display: none !important; }
  .answer-sheet__body { display: block !important; }
  .item { break-inside: avoid; box-shadow: none; }
}
