/* Signer flow: one column, three steps, a dock with the next action and the promise. */

body[data-shell="signer"] .shell { display: block; }
body[data-shell="signer"] #view { max-width: none; margin: 0; padding: 0; }
.signer { min-height: 100vh; min-height: 100dvh; background: var(--surface-alt); }
.s-head { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--border); }
.s-head .brand { padding: 0; font-size: 1rem; }
.secure { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; color: var(--ink-muted); min-width: 0; }
.secure span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secure svg { color: var(--accent); width: 14px; height: 14px; }
.s-wrap { max-width: 720px; margin: 0 auto; padding: 28px 24px 200px; }
.s-intro { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.s-intro .av { width: 40px; height: 40px; font-size: 14px; background: color-mix(in srgb, var(--accent) 70%, var(--ink)); color: #fff; }
.s-intro p { margin: 0; color: var(--ink-muted); font-size: 0.93rem; overflow-wrap: anywhere; }
.s-intro h1 { margin: 0; font-size: 1.3rem; line-height: 1.35; overflow-wrap: anywhere; }

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.stepper li { display: flex; flex-direction: column; gap: 8px; font-size: 0.93rem; font-weight: 500; color: var(--ink-muted); }
.stepper li::before { content: ""; height: 3px; border-radius: 3px; background: var(--border); transition: background .4s cubic-bezier(.16, 1, .3, 1); }
.stepper li span { display: flex; align-items: center; gap: 6px; }
.stepper .n { font: 500 11px var(--font-mono); }
.stepper li.ok { color: var(--ink-2); }
.stepper li.ok::before { background: var(--accent); }
.stepper li.on { color: var(--ink); }
.stepper li.on::before { background: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.signer .step { display: block; animation: rise .45s cubic-bezier(.16, 1, .3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.signer .step h2:focus { outline: none; }

.review-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
.review-bar .count { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.review-bar .count i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--signer-1); color: #fff; font: 600 11px var(--font-mono); font-style: normal; }
.review-bar .pg { margin-left: auto; color: var(--ink-muted); font: 0.86rem var(--font-mono); }
.review-doc { display: flex; flex-direction: column; align-items: center; gap: 16px; max-height: 620px; overflow: auto; padding: 20px; background: var(--surface-muted); border-radius: 0 0 12px 12px; }
.r-sheet { max-width: 100%; }
.here {
  position: absolute; display: flex; align-items: center; justify-content: flex-start; gap: 6px; min-height: 0; padding: 0 8px;
  border: 1.5px solid #e2b93b; border-radius: 4px; background: #fff8d6; color: #6b4f00; box-shadow: none;
  font: 600 clamp(10px, 2cqw, 13px)/1 var(--font-ui); white-space: nowrap; animation: pulse 2.2s cubic-bezier(.16, 1, .3, 1) infinite;
}
.here:hover { background: #fff1b8; border-color: #c99a1b; color: #4d3800; }
.here.date { animation: none; border-style: dashed; background: rgba(255, 248, 214, .7); font-weight: 500; }
.here svg.i { width: clamp(11px, 2cqw, 15px); height: clamp(11px, 2cqw, 15px); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 185, 59, 0); } 50% { box-shadow: 0 0 0 4px rgba(226, 185, 59, .28); } }
.phone-qr { margin-top: 16px; }
.phone-qr summary { gap: 8px; }
.phone-qr summary svg { color: var(--accent); }

.sign-card { padding: 20px; }
.sign-card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.sign-card > p { margin: 0 0 16px; color: var(--ink-muted); }
.fill-in { margin: 0 0 16px; padding: 12px 14px 2px; }
.sign-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 3px; margin-bottom: 14px; background: var(--surface-muted); border-radius: 9px; }
.sign-tabs button { min-height: 38px; border: 0; border-radius: 7px; box-shadow: none; background: transparent; color: var(--ink-muted); }
.sign-tabs button:hover { background: transparent; color: var(--ink); border-color: transparent; }
.sign-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.field-in { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field-in label { margin: 0; font-size: 0.86rem; }
.field-in input { min-height: 44px; font-size: 16px; }
.sig-preview { position: relative; display: grid; place-items: center; height: 150px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: #0f2a4a; }
.sig-preview .script { padding: 0 16px; font: 60px/1 "Mrs Saint Delafield", "Brush Script MT", cursive; white-space: nowrap; }
.sig-preview .base { position: absolute; left: 24px; right: 24px; bottom: 30px; border-top: 1px solid #d6d6db; }
.sig-preview .x { position: absolute; left: 24px; bottom: 34px; font-size: 13px; color: #8b8b93; }
.sig-preview.pad { height: 190px; }
.sig-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; border: 0; }
.sig-preview .ph { position: absolute; top: 12px; left: 0; right: 0; text-align: center; font-size: 0.86rem; color: #6b6b73; pointer-events: none; }
.pad-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.86rem; color: var(--ink-muted); }
.pad-tools button { min-height: 32px; padding: 0 10px; border: 0; box-shadow: none; background: none; color: var(--ink-2); }
.consent { display: flex; align-items: flex-start; gap: 12px; margin: 16px 0 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-alt); font-weight: 400; color: var(--ink-2); cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; }
.adopts { margin: 10px 0 0; text-align: center; font-size: 0.86rem; color: var(--ink-muted); }

.done-card { padding: 28px 20px 20px; text-align: center; }
.done-card h1 { font-size: 1.3rem; }
.check { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--accent-soft); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 6%, transparent); animation: pop .5s cubic-bezier(.16, 1, .3, 1); }
.check svg { width: 32px; height: 32px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.check svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .6s .15s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.done-card h2 { margin: 0 0 6px; font-size: 1.3rem; }
.done-card h2:focus { outline: none; }
.done-card > p { margin: 0 auto 20px; max-width: 52ch; color: var(--ink-muted); }
.receipt { text-align: left; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); animation: slide .7s .35s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes slide { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.receipt header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px dashed var(--border-strong); }
.receipt header svg { color: var(--accent); }
.receipt header span { margin-left: auto; font: 0.82rem var(--font-mono); color: var(--ink-muted); }
.receipt dl { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px 12px; margin: 0; padding: 12px 14px; font-size: 0.93rem; }
.receipt dt { color: var(--ink-muted); }
.receipt dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.receipt dd.mono { font-size: 0.86rem; }
.timeline-wrap { padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.timeline-wrap h3 { margin: 0 0 10px; font-size: 0.86rem; font-weight: 500; color: var(--ink-muted); }
.timeline-wrap .timeline { padding: 0; }
.timeline-wrap .timeline li { grid-template-columns: 14px minmax(0, 1fr) auto; }
.timeline-wrap time { font: 0.86rem var(--font-mono); color: var(--ink-muted); white-space: nowrap; }

.s-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(8px);
}
.s-dock > div { display: flex; gap: 8px; max-width: 672px; margin: 0 auto; }
.s-dock .primary { flex: 1; }
.s-dock .trust { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 0 auto 10px; }
.dock-note { flex: 1; margin: 0; text-align: center; font-size: 0.93rem; color: var(--ink-2); }

@media (max-width: 640px) {
  .s-head { padding: 0 16px; }
  .secure span { max-width: 160px; }
  .s-wrap { padding: 20px 16px 190px; }
  .s-intro h1 { font-size: 1.15rem; }
  .review-doc { max-height: none; overflow: visible; padding: 12px; }
  .sig-preview .script { font-size: 48px; }
  .receipt dl { grid-template-columns: 92px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .check svg path { stroke-dashoffset: 0; }
  .here { animation: none; }
}
