:root {
  --navy: #0f2340; --accent: #1f9d6b; --accent-dark: #178056; --ink: #1c2430;
  --muted: #5b6676; --line: #e3e8ef; --bg: #ffffff; --bg-soft: #f5f7fa; --err: #c0392b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
       color: var(--ink); background: var(--bg-soft); line-height: 1.5; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header { background: #fff; border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 800; font-size: 19px; color: var(--navy); text-decoration: none; }
.logo span { color: var(--accent); }
.secure { font-size: 13px; color: var(--muted); }

.progress { display: flex; list-style: none; padding: 0; margin: 28px 0 20px; gap: 6px; counter-reset: s; }
.progress li { flex: 1; font-size: 13px; color: var(--muted); padding-top: 10px; border-top: 4px solid var(--line); counter-increment: s; }
.progress li::before { content: counter(s) ". "; }
.progress li.active, .progress li.done { color: var(--navy); border-color: var(--accent); font-weight: 600; }

form, .done { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; margin-bottom: 24px; }
h1 { font-size: 24px; color: var(--navy); margin: 0 0 6px; letter-spacing: -.3px; }
.hint { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.step { display: none; }
.step.active { display: block; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid .full { grid-column: 1 / -1; }
.grid .half { }
label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--navy); gap: 6px; }
input, select { font: inherit; font-size: 15px; font-weight: 400; padding: 11px 12px; border: 1px solid #cfd7e2;
                border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 2px solid rgba(31,157,107,.35); border-color: var(--accent); }
input.bad, select.bad { border-color: var(--err); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; color: var(--ink); margin-top: 18px; }
label.check input { width: auto; margin-top: 3px; }

.drop { position: relative; border: 2px dashed #cfd7e2; border-radius: 12px; padding: 30px; text-align: center; background: var(--bg-soft); }
.drop.over { border-color: var(--accent); background: #eef8f3; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop p { margin: 0 0 4px; } .drop small { color: var(--muted); }
.filelist { list-style: none; padding: 0; margin: 14px 0 0; }
.filelist li { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.filelist button { border: 0; background: none; color: var(--err); cursor: pointer; font: inherit; }

.review { background: var(--bg-soft); border-radius: 10px; padding: 16px; font-size: 14px; margin-bottom: 18px; }
.review dl { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; margin: 0; }
.review dt { color: var(--muted); } .review dd { margin: 0; }
.terms { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 14px; margin-bottom: 16px; }
.sigwrap { margin-top: 14px; }
canvas#sig { width: 100%; height: 160px; border: 1px solid #cfd7e2; border-radius: 8px; background: #fff; touch-action: none; display: block; }
.sigwrap small { color: var(--muted); font-size: 12px; margin-left: 8px; }
.link { border: 0; background: none; color: var(--accent-dark); cursor: pointer; font: inherit; font-size: 13px; padding: 6px 0; }

.error { color: var(--err); font-size: 14px; min-height: 20px; margin-top: 16px; }
.actions { display: flex; justify-content: space-between; margin-top: 10px; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 13px 26px; font: inherit; font-weight: 600; font-size: 16px; cursor: pointer; }
.btn:hover { background: var(--accent-dark); } .btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost[hidden] { display: inline-block; visibility: hidden; }
.foot { font-size: 12px; color: var(--muted); padding-bottom: 32px; }
.foot a { color: var(--muted); }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  form, .done { padding: 20px 16px; }
  .review dl { grid-template-columns: 1fr; }
  .progress li { font-size: 11px; }
}
