/* Multi-step forms (book.html, declare.html): progress steps, step panels, the review summary and the
   confirmation card. Builds on tokens.css; the form controls come from components.css and book.css. */

.flow-panel { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.flow-step, .flow-form { display: grid; gap: var(--space-6); }
.flow-step[hidden] { display: none; }
.flow-step__title { margin: 0; font-size: 22px; line-height: 30px; font-weight: 700; }
.flow-step__title:focus, .flow-done__title:focus, .sr-only:focus { outline: none; }

/* Progress steps */
.flow-steps { display: flex; margin: 0 0 var(--space-6); padding: 0 0 var(--space-6); border-bottom: 1px solid var(--line); list-style: none; counter-reset: none; }
.flow-steps__item { position: relative; display: flex; flex: 1; align-items: center; gap: var(--space-2); color: var(--ink-muted); font-size: 14px; line-height: 20px; font-weight: 600; }
.flow-steps__item + .flow-steps__item { padding-left: var(--space-4); }
.flow-steps__item + .flow-steps__item::before { content: ""; flex: 0 0 24px; height: 2px; margin-right: var(--space-2); background: var(--line); }
.flow-steps__num { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; border: 2px solid var(--line-strong); border-radius: 50%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.flow-steps__item.is-current { color: var(--ink); }
.flow-steps__item.is-current .flow-steps__num { border-color: var(--ink); background: var(--signal); color: var(--ink); }
.flow-steps__item.is-done { color: var(--ink); }
.flow-steps__item.is-done .flow-steps__num { border-color: var(--action); background: var(--action); color: var(--on-action); }
.flow-steps__item.is-done + .flow-steps__item::before { background: var(--action); }
@media (max-width: 639px) {
  /* Only the current step keeps its label on phones. */
  .flow-steps__item { flex: none; }
  .flow-steps__item:not([aria-current]) .flow-steps__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .flow-steps__item[aria-current] { flex: 1; }
}

/* Review summary */
.flow-summary { position: relative; display: grid; gap: var(--space-4); padding: var(--space-4) var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
@media (min-width: 640px) { .flow-summary { grid-template-columns: 1fr 1fr; } }
.flow-summary__title { margin: 0 0 var(--space-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.flow-summary__list { margin: 0; padding: 0; list-style: none; }
.flow-summary__list li { display: flex; justify-content: space-between; gap: var(--space-4); padding: 2px 0; }
.flow-summary__list li span:last-child { color: var(--ink-muted); }
.flow-summary__text { margin: 0; overflow-wrap: anywhere; }
.flow-summary__text + .flow-summary__text { margin-top: var(--space-2); }
.flow-summary__notes { color: var(--ink-muted); white-space: pre-line; }
.flow-summary__edit { position: absolute; top: var(--space-2); right: var(--space-2); min-height: 32px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.flow-summary__edit:hover { background: var(--surface-alt); }
.flow-summary__edit:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

/* Confirmation */
.flow-done { justify-items: center; padding: var(--space-12) var(--space-4); text-align: center; }
.flow-done__icon { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 50%; background: var(--signal); color: var(--ink); box-shadow: 0 0 0 8px var(--surface-alt); }
.flow-done__icon svg { width: 36px; height: 36px; }
.flow-done__title { margin: 0; font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -.01em; }
.flow-done__ref { margin: 0; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); background: var(--action); color: var(--on-action); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px; line-height: 28px; letter-spacing: .06em; }
.flow-done__ref span { color: var(--signal); font-weight: 700; white-space: nowrap; }
.flow-done__text { max-width: 520px; margin: 0; color: var(--ink-muted); }
.flow-done__text strong { color: var(--ink); overflow-wrap: anywhere; }
.flow-done__text .flow-nowrap { white-space: nowrap; }
