:root {
  --green: #156e37; --green-d: #0f5129; --blue: #284384; --ink: #1f2328; --muted: #5a6069;
  --line: #dfe4e8; --bg: #f3f5f4; --card: #fff; --err: #b3261e; --err-bg: #fdecea; --ok-bg: #e8f3ec;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Rubik, Arial, sans-serif; padding-bottom: 96px; }
a { color: var(--blue); }
.skip { position: absolute; right: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { right: 8px; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border-bottom: 3px solid var(--green); }
.logo { width: 92px; height: auto; flex: none; }
.top .co { font-size: 13px; color: var(--muted); }
.top h1 { margin: 0; font-size: 20px; color: var(--blue); line-height: 1.25; }

.steps { list-style: none; display: flex; gap: 6px; margin: 14px auto 0; padding: 0 16px; max-width: 760px; }
.steps li { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
.steps .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-size: 13px; font-weight: 700; flex: none; }
.steps li.on { color: var(--ink); border-color: var(--green); }
.steps li.on .num { background: var(--green); color: #fff; }
.steps li.done .num { background: var(--ok-bg); color: var(--green); }

main { max-width: 760px; margin: 0 auto; padding: 14px 16px; outline: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 10px; font-size: 19px; color: var(--green); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 20px; border-radius: 12px; border: 0; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; width: 100%; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-d); }
.btn.primary[aria-disabled="true"] { background: #9db8a6; }
.btn.wa { background: #1fa855; color: #fff; }
.btn.small-btn { min-height: 46px; }
.btn:focus-visible, input:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.link { background: none; border: 0; color: var(--blue); text-decoration: underline; font: inherit; cursor: pointer; padding: 4px; }

.waiting { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 15px; margin: 12px 0 4px; }
.waiting.ok { color: var(--green); font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #1fa855; animation: pulse 1.2s infinite; }
.waiting.ok .dot { animation: none; background: var(--green); }
@keyframes pulse { 50% { opacity: .25; } }
.manual { margin-top: 10px; font-size: 15px; }
.code { font-size: 22px; background: var(--bg); border-radius: 10px; padding: 8px; text-align: center; }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--green); margin: 10px auto; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pdf canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: #fff; }
.terms-body { font-size: 15.5px; }
.terms-body p { margin: 0 0 8px; text-align: justify; }
.terms-body .bu { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.terms-body .b { font-weight: 700; }
.terms-body ol.c { list-style: none; padding: 0; margin: 0; }
.terms-body ol.c li { display: flex; gap: 6px; margin: 0 0 8px; }
.terms-body ol.c li > .n { flex: none; min-width: 30px; font-weight: 700; color: var(--green); }
.terms-body ol.c li > .t { flex: 1; text-align: justify; }
.terms-body ol.c ol.c { margin-top: 6px; }
.terms-body .fill { display: inline-block; min-width: 40px; border-bottom: 1px solid var(--ink); text-align: center; font-weight: 700; color: var(--blue); }
.terms-body .card { border: 1px dashed var(--line); background: #fafbfc; padding: 8px; margin: 6px 0; border-radius: 8px; }
.terms-end { height: 1px; }

.readbar { position: fixed; inset: auto 0 0 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,.06); z-index: 5; }
.readbar .btn { max-width: 728px; margin: 0 auto; display: flex; }
.progress { height: 4px; background: var(--line); border-radius: 4px; max-width: 728px; margin: 0 auto 8px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--green); transition: width .2s; }

.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.field label { font-size: 15px; font-weight: 600; }
.field input[type=text], .field input[type=tel], .field input[type=date], .field input[type=time] {
  font: inherit; font-size: 17px; padding: 12px; border: 1.5px solid #c9d0d6; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; min-height: 50px;
}
.field input[type=date], .field input[type=time] { direction: rtl; }
.field input.invalid { border-color: var(--err); background: var(--err-bg); }
.field input[type=file] { font-size: 15px; }
.err { color: var(--err); font-size: 14px; min-height: 0; }
.err:empty { display: none; }
.err.summary { background: var(--err-bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.err.summary ul { margin: 6px 0 0; padding-inline-start: 20px; }
.err.summary a { color: var(--err); }

.stamp-preview { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.stamp-preview img { max-height: 70px; max-width: 160px; border: 1px solid var(--line); border-radius: 6px; }

.sig-block { margin-top: 16px; }
.sig-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sig-head .label { font-weight: 700; }
.sig-pad { position: relative; border: 2px dashed #b9c3cb; border-radius: 12px; background: #fcfdfc; height: 190px; touch-action: none; user-select: none; -webkit-user-select: none; }
.sig-pad.has { border-style: solid; border-color: var(--blue); }
.sig-pad.invalid { border-color: var(--err); }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; border-radius: 10px; }
.sig-pad .hint { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa4ad; pointer-events: none; font-size: 16px; }
.sig-pad .line { position: absolute; right: 18px; left: 18px; bottom: 42px; border-bottom: 1px solid #c9d0d6; pointer-events: none; }
.sig-tools { display: flex; justify-content: space-between; margin-top: 4px; font-size: 15px; }
.typed { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.typed input { font: inherit; padding: 12px; border: 1.5px solid #c9d0d6; border-radius: 10px; }

.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row input { width: 24px; height: 24px; margin-top: 2px; flex: none; accent-color: var(--green); }
.check-row label { font-size: 15.5px; }
.check-row.invalid label { color: var(--err); }
.privacy { margin-top: 8px; font-size: 14px; color: var(--muted); }

.submit-bar { margin: 6px 0 20px; }
.saved { text-align: center; margin-top: 8px; min-height: 20px; }
.verify-box { background: var(--bg); border-radius: 12px; padding: 12px; margin-bottom: 12px; }

.check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--green); font-size: 36px; display: grid; place-items: center; margin: 6px auto 8px; font-weight: 700; }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 10px 16px 24px; }
.nowrap { white-space: nowrap; unicode-bidi: isolate; }
.terms-body .add-title { color: var(--green); font-size: 18px; margin: 18px 0 8px; }
