/* ==========================================================================
   /form-d81/example/ — the worked-example stepper.

   Everything here is <details>/<summary>, so all five sections' content ships
   in the static HTML and works with no JavaScript. d81-example.js only adds:
   closing a section when another opens, the progress count, and the funnel
   events. Reuses .callout, .table-scroll and the button classes from
   site.css rather than redefining them.
   ========================================================================== */

.d81ex { padding-block: clamp(2.5rem, 7vw, 4rem) 5rem; }

.d81ex h1 {
  font-size: var(--text-3xl); font-weight: 800;
  letter-spacing: -.03em; margin-top: .75rem;
}

.d81ex__lede {
  margin-top: 1.1rem; font-size: var(--text-md); line-height: 1.7; color: var(--ink-soft);
  max-width: 62ch;
}

/* ── Disclaimers ── */
.d81ex-disclaimer {
  margin-top: 1.5rem; padding: 1.1rem 1.3rem;
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--warn-text);
}
.d81ex-disclaimer p { margin: 0; }
.d81ex-disclaimer a { color: inherit; text-decoration: underline; }
.d81ex-disclaimer--foot { margin-top: 2.5rem; }

/* ── Meet the couple ── */
.d81ex-couple {
  margin-top: 2.25rem; padding: 1.5rem 1.6rem;
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.d81ex-couple h2 { font-size: var(--text-lg); font-weight: 800; }
.d81ex-couple__facts {
  margin-top: 1rem; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.d81ex-couple__facts dt {
  font-size: var(--text-xs); font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--sage);
}
.d81ex-couple__facts dd {
  margin: .25rem 0 0; font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.5;
}

/* ── Progress ── */
.d81ex-progress { margin-top: 2rem; }
.d81ex-progress__label { font-size: var(--text-sm); font-weight: 700; color: var(--ink); }
.d81ex-progress__track {
  margin-top: .5rem; height: 8px; background: var(--border);
  border-radius: 999px; overflow: hidden;
}
.d81ex-progress__fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #61917B);
  border-radius: 999px; transition: width .25s ease;
}
.d81ex-progress__dots {
  margin-top: .75rem; display: flex; gap: .5rem; list-style: none; padding: 0;
}
.d81ex-progress__dots a {
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 999px; background: var(--cream); border: 1px solid var(--border);
  color: var(--sage); font-size: var(--text-xs); font-weight: 800; text-decoration: none;
}
.d81ex-progress__dots a:hover { border-color: var(--accent); color: var(--accent); }
.d81ex-progress__dots li[data-visited] a {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* ── Steps ── */
.d81ex-steps { margin-top: 1.75rem; border-top: 1px solid var(--border); }

.d81ex-step {
  border-bottom: 1px solid var(--border);
}

.d81ex-step > summary {
  list-style: none; cursor: pointer;
  padding: 1.4rem .25rem; display: flex; gap: 1rem; align-items: flex-start;
  position: relative;
}
.d81ex-step > summary::-webkit-details-marker { display: none; }
.d81ex-step > summary::after {
  content: "+"; position: absolute; right: .25rem; top: 1.35rem;
  font-size: 1.6rem; font-weight: 400; color: var(--accent); line-height: 1;
}
.d81ex-step[open] > summary::after { content: "\2212"; }

.d81ex-step__num {
  flex: 0 0 auto; width: 2.25rem; height: 2.25rem;
  display: grid; place-items: center; margin-top: .1rem;
  background: var(--pine); color: var(--brand-on-dark);
  border-radius: 999px; font-size: var(--text-sm); font-weight: 800;
}
.d81ex-step[open] .d81ex-step__num { background: var(--accent); color: #fff; }

.d81ex-step__title { padding-right: 2rem; }
.d81ex-step__title strong { display: block; font-size: var(--text-md); font-weight: 800; color: var(--ink); }
.d81ex-step__title span { display: block; margin-top: .2rem; font-size: var(--text-sm); color: var(--sage); }

.d81ex-step__body { padding: 0 .25rem 2rem calc(2.25rem + 1rem + .25rem); }
.d81ex-step__body > * + * { margin-top: 1rem; }

.d81ex-step__sub {
  font-size: var(--text-xs); font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--sage); margin-top: 1.5rem !important;
}
.d81ex-step__body > .d81ex-step__sub:first-child { margin-top: 0 !important; }

.d81ex-step__body p { color: var(--ink-soft); line-height: 1.7; }

.d81ex-step__link a { font-weight: 700; }

.d81ex-step__nav {
  display: flex; gap: .75rem; flex-wrap: wrap; padding-top: .5rem;
}

/* ── Example field facsimile ── */
.d81ex-field {
  display: grid; gap: .35rem;
  padding: .85rem 1rem; background: var(--cream);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.d81ex-field + .d81ex-field { margin-top: .6rem !important; }
.d81ex-field__label {
  font-size: var(--text-xs); font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--sage);
}
.d81ex-field__value { font-size: var(--text-sm); color: var(--ink); line-height: 1.55; }

/* ── Plain English vs legal wording ── */
.d81ex-plain-legal { display: grid; gap: 1rem; }
@media (min-width: 44em) { .d81ex-plain-legal { grid-template-columns: 1fr 1fr; } }
.d81ex-plain-legal__col {
  padding: 1.1rem 1.2rem; border-radius: var(--radius-sm);
  background: var(--paper); border: 1px solid var(--border);
}
.d81ex-plain-legal__label {
  display: block; font-size: var(--text-xs); font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent); margin-bottom: .5rem;
}
.d81ex-plain-legal__col p { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.6; margin: 0; }

/* ── Tables ── */
.d81ex-table {
  width: 100%; min-width: 34rem; border-collapse: collapse; font-size: var(--text-sm);
}
.d81ex-table caption { caption-side: bottom; text-align: left; font-size: var(--text-sm); color: var(--sage); padding-top: .75rem; }
.d81ex-table th, .d81ex-table td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.d81ex-table thead th {
  background: var(--cream); color: var(--ink); font-weight: 800; font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--border-firm);
}
.d81ex-table tbody th { font-weight: 700; color: var(--ink); }
.d81ex-num { font-variant-numeric: tabular-nums; }

/* ── Funnel exit ── */
.d81ex-exit { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.d81ex-exit h2 { font-size: var(--text-xl); font-weight: 800; }
.d81ex-exit__cards {
  margin-top: 1.25rem; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.d81ex-exit__card {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.4rem 1.5rem; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--border);
  text-decoration: none; transition: box-shadow .15s ease, transform .15s ease;
}
.d81ex-exit__card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.d81ex-exit__card-title { font-size: var(--text-md); font-weight: 800; color: var(--ink); }
.d81ex-exit__card-body { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.55; }
.d81ex-exit__card-link { margin-top: auto; padding-top: .5rem; font-size: var(--text-sm); font-weight: 800; color: var(--accent); }

@media (max-width: 30em) {
  .d81ex-step__body { padding-left: .25rem; }
}
