:root {
  --green: #66cc00;
  --green-deep: #3f8a00;
  --green-wash: #f1f8e8;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #6b6b6b;
  --line: #e2e2dc;
  --bg: #f6f6f2;
  --card: #ffffff;
  --error: #c62828;
  --error-wash: #fdeeee;
  --warn-wash: #fff7e0;
  --radius: 12px;
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
  --nav-h: 76px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; scroll-padding-bottom: 100px; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.5; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
a { color: var(--green-deep); text-underline-offset: 2px; font-weight: 500; }
a:hover { color: var(--ink); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 6px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; gap: 12px; }
.logo { height: 40px; width: auto; display: block; }
.lang { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 7px 14px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink); min-height: 36px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.progress { height: 4px; background: #ececec; }
.progress div { height: 100%; width: 0; background: var(--green); transition: width .35s ease; }
.steplabel { max-width: 1120px; margin: 0 auto; padding: 6px 20px; font-size: 13px; color: var(--muted); font-weight: 500; }
@media (min-width: 1000px) { .steplabel { display: none; } }

/* layout */
.layout { max-width: 1120px; margin: 0 auto; padding: 24px 20px 32px; display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 1000px) { .layout { grid-template-columns: 250px minmax(0, 1fr); padding-top: 36px; } }
main { max-width: 760px; width: 100%; outline: none; }
.sidenav { display: none; }
@media (min-width: 1000px) { .sidenav { display: block; position: sticky; top: 100px; align-self: start; } }
.sidenav ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.sidenav li button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.sidenav li button:disabled { cursor: default; opacity: .6; }
.sidenav li .n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.sidenav li.past button { color: var(--ink-2); }
.sidenav li.past .n { background: var(--green); border-color: var(--green); color: var(--ink); }
.sidenav li.current button { color: var(--ink); font-weight: 700; border-left-color: var(--ink); }
.sidenav li.current .n { background: var(--ink); border-color: var(--ink); color: #fff; }

/* headings */
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--green-deep); margin: 0 0 6px; }
h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 4.4vw, 34px); line-height: 1.1; margin: 0 0 10px; letter-spacing: -0.01em; outline: none; }
h3 { font-size: 18px; margin: 0 0 14px; font-weight: 700; }
h4 { font-size: 15px; margin: 18px 0 6px; font-weight: 700; }
.lead { color: var(--ink-2); margin: 0 0 4px; font-size: 16px; max-width: 62ch; }
.stephead { margin-bottom: 20px; }
.hero { padding: 8px 0 20px; }
.hero h2 { font-size: clamp(30px, 6vw, 44px); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card .lead { font-size: 14px; color: var(--muted); margin: -8px 0 12px; }
@media (min-width: 640px) { .card { padding: 24px 26px; } }
.callout { border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; font-size: 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ink); }
.callout.info { border-left-color: var(--green); background: var(--green-wash); border-color: #dcebc7; }
.callout.warn { border-left-color: #e0a800; background: var(--warn-wash); border-color: #f1e2b3; }
.callout.error-sum { border-left-color: var(--error); background: var(--error-wash); border-color: #f3c9c9; font-weight: 600; color: var(--error); }

/* fields */
.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.field { grid-column: span 12; margin-bottom: 14px; }
@media (min-width: 640px) {
  .w-2 { grid-column: span 2; } .w-3 { grid-column: span 3; } .w-4 { grid-column: span 4; } .w-5 { grid-column: span 5; }
  .w-6 { grid-column: span 6; } .w-9 { grid-column: span 9; } .w-12 { grid-column: span 12; }
}
@media (max-width: 639px) { .w-2, .w-3 { grid-column: span 6; } }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.req { color: var(--error); margin-left: 2px; }
.control { position: relative; }
.prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; pointer-events: none; }
input[type=text], input[type=tel], input[type=email], input[type=date], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1.5px solid #cfcfc8; border-radius: 9px; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
input.has-prefix { padding-left: 26px; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(102, 204, 0, .35); outline: none; }
.help { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.error { font-size: 13px; color: var(--error); margin: 6px 0 0; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); background: #fffafa; }

/* radios & checks */
fieldset.radios { border: 0; padding: 0; margin: 0 0 6px; }
fieldset.radios legend { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--ink-2); padding: 0; }
fieldset.radios legend:empty { display: none; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.choice:hover { border-color: #bdbdb4; }
.choice.on { border-color: var(--ink); background: var(--green-wash); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #9a9a92; flex: none; margin-top: 1px; display: grid; place-items: center; background: #fff; }
.choice.on .dot { border-color: var(--ink); }
.choice.on .dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.choice input:focus-visible + .dot { outline: 3px solid var(--green); outline-offset: 2px; }
.ctext { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.ctext strong { font-weight: 600; }
.ctext small { color: var(--muted); font-size: 13px; }
.radios.compact .choice { padding: 10px 12px; }
.radios.has-error .choice { border-color: #efb5b5; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; font-size: 15px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 24px; height: 24px; border: 2px solid #9a9a92; border-radius: 6px; flex: none; display: grid; place-items: center; background: #fff; color: transparent; margin-top: 0; transition: background .15s, border-color .15s; }
.check .box svg { width: 16px; height: 16px; }
.check.on .box { background: var(--green); border-color: var(--green); color: var(--ink); }
.check input:focus-visible + .box { outline: 3px solid var(--green); outline-offset: 2px; }
.check.has-error .box { border-color: var(--error); }
.check.ackbox { margin-top: 14px; padding: 14px; background: var(--green-wash); border-radius: 10px; font-weight: 600; }
.check.mini { padding: 6px 0; font-size: 13px; font-weight: 700; white-space: nowrap; }

.total { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--bg); border-radius: 9px; font-size: 14px; }
.total strong { font-size: 18px; font-variant-numeric: tabular-nums; }

/* welcome */
.ready { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ready li { display: flex; flex-direction: column; padding: 10px 0 10px 18px; border-bottom: 1px solid var(--line); position: relative; }
.ready li:last-child { border-bottom: 0; }
.ready li::before { content: ''; position: absolute; left: 0; top: 18px; width: 8px; height: 8px; background: var(--green); border-radius: 2px; }
.ready span { color: var(--muted); font-size: 14px; }
.toc { margin: 0; padding-left: 22px; columns: 1; font-size: 15px; }
@media (min-width: 640px) { .toc { columns: 2; column-gap: 32px; } }
.toc li { padding: 3px 0; break-inside: avoid; }

/* policies */
.counter { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.counter strong { color: var(--ink); font-size: 16px; }
details.policy { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
details.policy.done { border-color: #cfe5b3; }
details.policy.has-error { border-color: var(--error); }
details.policy summary { list-style: none; display: flex; gap: 14px; align-items: center; padding: 16px; cursor: pointer; }
details.policy summary::-webkit-details-marker { display: none; }
.pnum { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.policy.done .pnum { background: var(--green); }
.pnum svg { width: 16px; height: 16px; }
.ptitle { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ptitle strong { font-size: 15px; }
.ptitle small { color: var(--muted); font-size: 13px; }
.chev { width: 10px; height: 10px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); flex: none; margin-right: 4px; transition: transform .2s; }
details[open] .chev { transform: rotate(-135deg); }
.pbody { padding: 0 18px 18px 18px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2); max-height: none; }
.pbody ul, .agreement ul { padding-left: 20px; margin: 6px 0 10px; }
.pbody li, .agreement li { margin-bottom: 4px; }
.pbody p, .agreement p { margin: 10px 0; }
.agreement { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; font-size: 15px; color: var(--ink-2); }
.agreement h3 { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--ink); }
.agreement h4 { color: var(--ink); }

/* notices */
.notices { list-style: none; margin: 0 0 16px; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.notices li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notices li:last-child { border-bottom: 0; }
.notices li.has-error { background: var(--error-wash); }
.ninfo { display: flex; flex-direction: column; min-width: 0; }
.ninfo a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; font-size: 15px; }
.ninfo small { color: var(--muted); font-size: 12px; }
.notices .error { display: none; }

/* review */
.review { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.review header { display: flex; justify-content: space-between; align-items: center; }
.review h4 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.review dl { margin: 8px 0 0; display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 640px) { .review dl { grid-template-columns: 1fr 1fr; } }
.review dt { font-size: 12px; color: var(--muted); }
.review dd { margin: 0; font-size: 15px; word-break: break-word; }

/* signature */
.sigwrap { border: 1.5px dashed #9a9a92; border-radius: 10px; padding: 10px 12px 12px; background: #fff; margin-top: 6px; position: relative; }
.sigwrap.has-error { border-color: var(--error); }
.sighead { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink-2); }
#sigPad { width: 100%; height: 170px; display: block; touch-action: none; cursor: crosshair; background: transparent; }
.sigline { border-top: 1.5px solid var(--ink); margin: -36px 0 0; padding-top: 2px; font-size: 12px; color: var(--muted); pointer-events: none; position: relative; top: -2px; width: 100%; }

/* done */
.done .badge { width: 64px; height: 64px; border-radius: 50%; background: var(--green); display: grid; place-items: center; margin-bottom: 14px; }
.done .badge svg { width: 34px; height: 34px; }
.actions-grid { display: grid; gap: 10px; margin: 6px 0 10px; }
@media (min-width: 640px) { .actions-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.next { padding-left: 20px; margin: 0; }
.next li { margin-bottom: 10px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; border: 2px solid var(--ink); transition: transform .08s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2a2a; color: #fff; }
.btn.primary:disabled { opacity: .6; cursor: progress; }
.btn.secondary { background: #fff; color: var(--ink); }
.btn.secondary:hover { background: var(--bg); color: var(--ink); }
.link { background: none; border: 0; color: var(--green-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 4px 2px; font-size: 14px; }

/* bottom nav */
.navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.navbar[hidden] { display: none; }
.navbar-in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
@media (min-width: 1000px) { .navbar-in { padding-left: calc(20px + 250px + 32px); } }
.navbar .btn { flex: none; }
.navbar #nextBtn { margin-left: auto; min-width: 150px; }
.savenote { font-size: 12px; color: var(--muted); display: none; }
@media (min-width: 640px) { .savenote { display: inline; } }
#backBtn[hidden] { display: none; }
@media (max-width: 639px) { .navbar #nextBtn { flex: 1; } }

.foot { max-width: 1120px; margin: 0 auto; padding: 8px 20px 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.foot p { margin: 0; }
@media (min-width: 1000px) { .foot { padding-left: calc(20px + 250px + 32px); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.pads { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .pads { grid-template-columns: 2fr 1fr; } }
#iniPad { width: 100%; height: 170px; display: block; touch-action: none; cursor: crosshair; }
.warn-text { color: #a66f00; }

/* Fast Application additions */
.yn { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.yn:last-of-type { border-bottom: 0; }
.yn > span { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 18px; font-weight: 700; font-size: 14px; min-height: 40px; cursor: pointer; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.yn.has-error .seg { border-color: var(--error); }
.yn .error, .yn .sub { grid-column: 1 / -1; margin: 0; }
.yn .sub { margin-top: 4px; }
.done-actions { display: grid; gap: 10px; margin: 18px 0; }
@media (min-width: 640px) { .done-actions { grid-template-columns: 1fr 1fr; } }
.btn.green { background: var(--green); border-color: var(--green); color: var(--ink); }
.btn.green:hover { background: #5cb800; }
.btn.green:disabled { opacity: .6; cursor: progress; }
.status { border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.status.ok { background: var(--green-wash); border: 1px solid #cfe5b3; }
.status.bad { background: var(--error-wash); border: 1px solid #f3c9c9; color: var(--error); }
.status.wait { background: var(--warn-wash); border: 1px solid #f1e2b3; }
