/* WAVERS waiver: plain, unbranded mechanics UI. Colours and fonts come from components/tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 16px/1.5 var(--wv-font-body);
  color: var(--wv-ink);
  background: var(--wv-bg);
}

.waiver { max-width: 40rem; margin: 0 auto; padding: 1rem; }
.waiver h1 { font-size: 1.5rem; margin: 0.25rem 0 0.25rem; }
.lede { margin: 0 0 0.75rem; }

/* progress */
.progress { margin: 0 0 1rem; }
.progress-text { margin: 0 0 0.35rem; font-weight: 700; }
.progress-steps { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.progress-steps li { flex: 1; height: 6px; border-radius: 3px; background: var(--wv-line); overflow: hidden; }
.progress-steps li.is-done, .progress-steps li[aria-current="step"] { background: var(--wv-ink); }
.progress-steps li span {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* steps */
.step { padding: 1rem; margin: 0 0 1rem; background: var(--wv-surface); border: var(--wv-border); border-radius: var(--wv-radius); }
.step-title { font-size: 1.25rem; margin: 0 0 0.5rem; }
.step p { margin: 0 0 0.75rem; }
.step-form { margin: 0; }
.step-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; margin-top: 1rem; }
.step-actions .btn { flex: 1 1 8rem; }
.step-actions-stack { flex-direction: column; }
.step-actions-stack .btn { flex: none; width: 100%; }

.btn {
  min-height: 48px; padding: 0.7rem 1rem; font: inherit; font-weight: 700;
  border: 2px solid var(--wv-ink); border-radius: 6px; cursor: pointer;
}
.btn-primary { color: var(--wv-surface); background: var(--wv-ink); }
.btn-secondary { color: var(--wv-ink); background: var(--wv-surface); }
.btn-small { min-height: 44px; padding: 0.4rem 0.9rem; color: var(--wv-ink); background: var(--wv-surface); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn:focus-visible, input:focus-visible, a:focus-visible, .step-title:focus-visible,
.articles:focus-visible, .hold-button:focus-visible, .sig-pad:focus-visible {
  outline: 3px solid var(--wv-focus);
  outline-offset: 2px;
}

/* form fields */
.form-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.form-field { display: grid; gap: 0.25rem; flex: 1 1 12rem; margin: 0 0 0.75rem; }
.form-field-initial { flex: 0 1 7rem; }
.form-field label { font-weight: 700; }
.form-field input {
  width: 100%; min-height: 48px; padding: 0.5rem 0.75rem; font: inherit; color: var(--wv-ink);
  background: var(--wv-surface); border: 2px solid var(--wv-ink-soft); border-radius: 6px;
}
.form-field input[aria-invalid="true"] { border-color: var(--wv-error-line); }

fieldset { min-width: 0; margin: 0 0 0.75rem; padding: 0; border: 0; }
legend { padding: 0; margin: 0 0 0.5rem; font-weight: 700; }
.choice { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.6rem 0.75rem; margin: 0 0 0.5rem; border: var(--wv-border); border-radius: 6px; }
.choice input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; }
.choice label span { display: block; color: var(--wv-ink-soft); }
.choices-inline { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.choices-inline legend { flex-basis: 100%; }
.choice-inline { display: flex; gap: 0.4rem; align-items: center; min-height: 44px; }
.choice-inline input { width: 1.25rem; height: 1.25rem; margin: 0; }
.check { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.5rem 0; }
.check input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; }

.hint { color: var(--wv-ink-soft); }
.error, .status { padding: 0.5rem 0.75rem; }
.error { color: var(--wv-error-ink); background: var(--wv-error-bg); border-left: 4px solid var(--wv-error-line); }
.status { background: var(--wv-bg); border-left: 4px solid var(--wv-ink); }
.error:empty, .status:empty { display: none; }

/* 3 · Articles (scroll-gated) */
.articles {
  max-height: 24rem; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 0 0.75rem; padding: 0.75rem 1rem;
  font-family: var(--wv-font-display); background: var(--wv-paper); border: var(--wv-border); border-radius: 6px;
}
.article { padding: 0 0 0.75rem; margin: 0 0 1rem; border-bottom: var(--wv-border); }
.article h3 { font-size: 1.05rem; margin: 0.25rem 0 0.5rem; }
.article .clause { margin: 0 0 0.5rem; }
.article .footnote { font-size: 0.85rem; color: var(--wv-ink-soft); }
.article .check { font-family: var(--wv-font-body); font-weight: 700; }
.fn-ref { font-size: 0.7em; line-height: 0; }
.articles-end { margin: 0; font-style: italic; color: var(--wv-ink-soft); }

/* 4 · Oath */
.oath-direction, .oath-note { color: var(--wv-ink-soft); }
.oath { margin: 0 0 0.75rem; padding: 0.75rem 1rem; font-family: var(--wv-font-display); font-size: 1.1rem; background: var(--wv-paper); border-left: 4px solid var(--wv-ink); }
.oath p { margin: 0 0 0.2rem; }
.hold { text-align: center; }
.hold-button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  width: 10rem; height: 10rem; margin: 0.5rem auto 0.75rem; padding: 1.5rem;
  font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--wv-ink);
  background: var(--wv-surface); border: 0; border-radius: 50%; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.hold-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.hold-track { fill: none; stroke: var(--wv-line); stroke-width: 8; }
.hold-fill { fill: none; stroke: var(--wv-ink); stroke-width: 8; stroke-linecap: round; }
.hold-hand .wv-hand { display: block; width: 3.25rem; height: 3.25rem; fill: currentColor; }
.hold-label { max-width: 6.5rem; line-height: 1.2; }
.hold-button.is-done { color: var(--wv-ok); }
.hold-button.is-done .hold-fill { stroke: var(--wv-ok); }
.hold-text { font-weight: 700; }
.hold-status:empty { display: none; }

/* 5 · Signature */
.sig-pad {
  display: block; width: 100%; aspect-ratio: 5 / 2;
  background: var(--wv-surface); border: 2px dashed var(--wv-ink-soft); border-radius: 6px;
  touch-action: none; cursor: crosshair;
}
.sig-tools { display: flex; gap: 0.5rem; justify-content: flex-end; margin: 0.5rem 0 0.75rem; }
.sig-preview { min-height: 3.5rem; margin: 0; font-family: var(--wv-font-hand); font-size: 2.25rem; line-height: 1.4; color: var(--wv-hand-ink); overflow-wrap: anywhere; }

/* 6 · Certificate + notary stamp */
.certificate-stage { position: relative; margin: 0 0 0.75rem; }
.notary-stamp { position: absolute; top: 4%; right: 4%; width: 18%; color: var(--wv-stamp-ink); opacity: 0.92; transform: rotate(-14deg); pointer-events: none; }
.notary-stamp.is-stamping { animation: stamp-down 520ms cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
@keyframes stamp-down {
  0% { opacity: 0; transform: translateY(-30%) scale(2.1) rotate(-4deg); }
  60% { opacity: 0.92; }
  100% { opacity: 0.92; transform: rotate(-14deg); }
}
.cert-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cert-actions .btn { flex: 1 1 10rem; }

/* 7 · Reveal */
.reveal-lede { font-size: 1.2rem; }
.price-options { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.waitlist { margin-top: 1.25rem; }
.counter { margin: 1rem 0 0; font-weight: 700; }

.waiver-footer { padding: 0.5rem 0 1.5rem; color: var(--wv-ink-soft); text-align: center; }
.waiver-footer p { margin: 0 0 0.25rem; }

/* Reduced motion: no stamp animation, and the Oath progress is text instead of a filling ring. */
.hold-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hold-ring { display: none; }
  .hold-button { border: 3px solid var(--wv-ink); }
  .hold-text { position: static; width: auto; height: auto; margin: 0 0 0.5rem; overflow: visible; clip: auto; white-space: normal; }
}
