:root {
  color-scheme: light;
  --ink: #11170f;
  --forest: #18331f;
  --paper: #f3f0e7;
  --surface: #fffdf8;
  --line: #d8d3c7;
  --muted: #6a6c63;
  --yellow: #f4c430;
  --yellow-soft: #fff1ad;
  --green: #197047;
  --red: #a0343f;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { min-height: 100vh; margin: 0; color: var(--ink); font: 16px/1.5 Manrope, ui-sans-serif, system-ui, -apple-system, sans-serif; }
button, input { font: inherit; }
button { border-radius: 0; }

.site-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1240px) / 2)); border-bottom: 1px solid var(--line); background: rgb(255 253 248 / 88%); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; background: var(--yellow); font-size: 22px; font-weight: 900; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; letter-spacing: .13em; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.secure-label { color: var(--muted); font-size: 13px; }

.page { display: grid; width: min(1240px, calc(100% - 48px)); min-height: calc(100vh - 152px); margin: 0 auto; grid-template-columns: minmax(330px, .82fr) minmax(520px, 1.18fr); }
.trust-panel { min-width: 0; padding: clamp(48px, 7vw, 92px) clamp(36px, 6vw, 84px) 56px 0; border-right: 1px solid var(--line); }
.workspace { min-width: 0; padding: clamp(48px, 7vw, 92px) 0 56px clamp(36px, 6vw, 84px); }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .17em; }
.trust-panel h1 { max-width: 520px; margin: 16px 0 22px; font-size: clamp(44px, 5vw, 72px); line-height: .98; letter-spacing: -.055em; }
.trust-panel > p { max-width: 490px; color: var(--muted); }
.steps { display: grid; gap: 0; margin: 52px 0 38px; padding: 0; list-style: none; }
.steps li { position: relative; display: grid; min-height: 68px; grid-template-columns: 38px 1fr; gap: 14px; color: var(--muted); }
.steps li::after { position: absolute; top: 37px; bottom: 0; left: 18px; width: 1px; background: var(--line); content: ''; }
.steps li:last-child::after { display: none; }
.steps li > span { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); background: var(--paper); font-size: 13px; font-weight: 800; }
.steps li div { display: flex; flex-direction: column; padding-top: 2px; }
.steps li strong { color: var(--ink); font-size: 14px; }
.steps li small { font-size: 12px; }
.steps li.active > span { border-color: var(--ink); background: var(--yellow); color: var(--ink); }
.steps li.done > span { border-color: var(--green); background: var(--green); color: white; }
.method-note { padding: 16px 0 0; border-top: 1px solid var(--line); font-size: 12px; }

.document-heading h2, .status-card h2 { margin: 10px 0 14px; font-size: clamp(31px, 4vw, 48px); line-height: 1.05; letter-spacing: -.04em; }
.document-heading > p, .status-card > p { color: var(--muted); }
.form-card, .document-card, .hash-card, .status-card { margin-top: 28px; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); background: var(--surface); box-shadow: 0 20px 55px rgb(44 39 26 / 6%); }
fieldset { display: grid; gap: 9px; margin: 0 0 28px; padding: 0; border: 0; }
legend { margin-bottom: 12px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.choice { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: center; padding: 15px; border: 1px solid var(--line); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ink); background: #faf5df; }
.choice input { width: 18px; height: 18px; accent-color: var(--ink); }
.choice span { display: flex; flex-direction: column; }
.choice small { color: var(--muted); }
.text-field { display: grid; gap: 8px; }
.text-field > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.text-field input { width: 100%; min-height: 58px; border: 1px solid #9b998f; background: white; padding: 0 15px; color: var(--ink); font-size: 18px; }
.text-field input:focus { border-color: var(--ink); outline: 3px solid rgb(244 196 48 / 32%); }
.privacy { color: var(--muted); font-size: 12px; }
.button { display: flex; width: 100%; min-height: 54px; align-items: center; justify-content: center; border: 1px solid var(--ink); background: var(--ink); color: white; padding: 0 20px; font-weight: 850; cursor: pointer; }
.button:hover { background: var(--forest); }
.button:disabled { cursor: wait; opacity: .55; }
.button.secondary { background: transparent; color: var(--ink); }
.button.secondary:hover { background: #f6f1df; }
.button.compact { width: auto; min-height: 42px; padding: 0 16px; }
.form-card > .button { margin-top: 22px; }
.form-message { padding: 13px; background: #fff0f2; color: var(--red); font-size: 13px; font-weight: 750; }

.document-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 15px; align-items: center; }
.document-card > div:not(.pdf-icon) { display: flex; min-width: 0; flex-direction: column; }
.document-card small { color: var(--muted); }
.pdf-icon { display: grid; width: 46px; height: 58px; place-items: center; background: var(--yellow-soft); font-size: 11px; font-weight: 900; }
.hash-card { display: grid; gap: 7px; margin-top: 12px; padding-block: 18px; box-shadow: none; }
.hash-card span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hash-card code { overflow-wrap: anywhere; font-size: 11px; }
.statement { margin: 0 0 22px; padding: 16px; border-left: 4px solid var(--yellow); background: #faf5df; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.acceptance { display: grid; grid-template-columns: 24px 1fr; gap: 12px; margin: 0 0 25px; cursor: pointer; }
.acceptance input { width: 21px; height: 21px; margin-top: 2px; accent-color: var(--ink); }
.code-field input { height: 68px; font-size: 29px; font-weight: 850; letter-spacing: .28em; text-align: center; }
.test-code { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 13px 15px; background: var(--yellow-soft); }
.test-code span { font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.test-code strong { font-size: 21px; letter-spacing: .16em; }

.status-card { text-align: center; }
.spinner { width: 38px; height: 38px; margin: 5px auto 16px; border: 4px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
.error { border-top: 5px solid var(--red); }
.success { border-top: 5px solid var(--green); }
.success-mark { display: grid; width: 62px; height: 62px; margin: 0 auto 18px; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: 31px; font-weight: 900; }
.success-actions { display: grid; gap: 9px; margin: 26px 0; }
.signers { display: grid; gap: 8px; text-align: left; }
.signers > div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; }
.signers strong { color: var(--green); }

footer { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
[hidden] { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .site-header { min-height: 68px; padding-inline: 18px; }
  .secure-label { display: none; }
  .page { width: min(100% - 28px, 680px); grid-template-columns: 1fr; }
  .trust-panel { padding: 34px 0 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .trust-panel h1 { font-size: clamp(40px, 12vw, 60px); }
  .trust-panel > p:not(.method-note) { display: none; }
  .steps { grid-template-columns: repeat(3, 1fr); margin: 28px 0 12px; }
  .steps li { min-height: 60px; grid-template-columns: 32px 1fr; gap: 8px; }
  .steps li::after { top: 16px; right: 0; bottom: auto; left: 32px; width: calc(100% - 24px); height: 1px; }
  .steps li > span { z-index: 1; width: 32px; height: 32px; }
  .steps li div { padding-top: 0; }
  .steps li small, .method-note { display: none; }
  .workspace { padding: 34px 0 48px; }
  footer { min-height: 64px; padding-inline: 18px; }
  footer span:last-child { display: none; }
}

@media (max-width: 520px) {
  .page { width: min(100% - 18px, 680px); }
  .trust-panel h1 { margin-bottom: 12px; }
  .steps li strong { font-size: 11px; }
  .form-card, .document-card, .hash-card, .status-card { padding: 20px; }
  .document-card { grid-template-columns: 42px 1fr; }
  .document-card .button { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
