:root {
  --navy: #182854;
  --navy-2: #24386f;
  --navy-soft: #e9edf6;
  --navy-tint: #f3f5fa;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1a2233;
  --muted: #5d6679;
  --line: #e2e6ee;
  --line-2: #cfd5e1;
  --ok: #1d7f56;
  --ok-soft: #e6f4ee;
  --warn: #9a6408;
  --warn-soft: #fdf3e1;
  --err: #b4351c;
  --err-soft: #fbece8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(24, 40, 84, .06), 0 8px 24px rgba(24, 40, 84, .06);
  --head: "Futura", "Futura PT", "Century Gothic", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
a { color: var(--navy-2); }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px;
}
.wordmark { height: 38px; width: auto; display: block; }
.secure-pill {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: 13px; font-weight: 600; color: var(--navy);
  background: var(--navy-soft); border-radius: 999px; padding: 6px 11px;
}
.secure-pill svg { width: 14px; height: 14px; fill: currentColor; }
.progress { max-width: 720px; margin: 0 auto; padding: 0 18px 10px; }
.progress-bar { height: 6px; background: var(--navy-soft); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy), var(--navy-2)); border-radius: 999px; transition: width .35s ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }
.save-state { display: inline-flex; align-items: center; gap: 5px; }
.save-state.ok { color: var(--ok); }
.save-state.busy { color: var(--muted); }
.save-state.bad { color: var(--err); }

/* Layout */
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 14px 8px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 20px; margin-bottom: 16px;
}
.card.center { text-align: center; padding: 34px 22px; }
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; border: 0; text-align: left; position: relative; overflow: hidden;
}
.hero h1, .hero p { color: #fff; }
.hero p { opacity: .9; }
.hero .seal { position: absolute; right: -30px; bottom: -30px; width: 170px; opacity: .12; }
h1, h2, h3 { font-family: var(--head); color: var(--navy); letter-spacing: .2px; line-height: 1.2; }
h1 { font-size: 27px; margin: 0 0 10px; font-weight: 600; }
h2 { font-size: 21px; margin: 0 0 6px; font-weight: 600; }
h3 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.step-kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-2); margin-bottom: 4px; }
.seal { width: 56px; height: 56px; }
.seal.big { width: 84px; height: 84px; margin-bottom: 12px; }

.checks { list-style: none; padding: 0; margin: 14px 0 4px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; }
.checks svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; fill: #b9c6e6; }
.hero .checks svg { fill: #c9d4ef; }

/* Fields */
.section-title { margin: 22px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-title:first-child { margin-top: 4px; padding-top: 0; border-top: 0; }
.grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid .full { grid-column: 1 / -1; }
}
.field { margin-bottom: 16px; min-width: 0; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: 13.5px; color: var(--muted); margin: -2px 0 8px; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--text);
  background: #fff; border: 1.5px solid var(--line-2); border-radius: 12px;
  padding: 12px 13px; min-height: 50px; appearance: none; -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type=date] { display: block; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23182854' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(24, 40, 84, .12); }
.money { position: relative; }
.money::before { content: "$"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money input { padding-left: 26px; }
.ssn-wrap { position: relative; }
.ssn-wrap input { padding-right: 70px; letter-spacing: .06em; }
.ssn-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--navy-tint); color: var(--navy); font: inherit; font-size: 13px; font-weight: 600; border-radius: 9px; padding: 8px 10px; cursor: pointer; }

/* Choice chips (radio / checkbox) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px;
  padding: 10px 16px; border: 1.5px solid var(--line-2); border-radius: 999px; background: #fff;
  font-size: 15.5px; font-weight: 500; color: var(--text); transition: all .15s; user-select: none;
}
.choice input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px rgba(24, 40, 84, .18); }
.choices.stack { flex-direction: column; }
.choices.stack .choice span { width: 100%; border-radius: 12px; }

/* Repeating groups */
.repeat-item { border: 1px solid var(--line); background: var(--navy-tint); border-radius: 14px; padding: 16px 14px 4px; margin-bottom: 12px; }
.repeat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.repeat-head h3 { margin: 0; }
.linkbtn { border: 0; background: none; color: var(--err); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 16.5px; min-height: 52px; padding: 12px 22px;
  border-radius: 14px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .06s, background .15s, box-shadow .15s;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(24, 40, 84, .22); }
.btn.primary:hover { background: var(--navy-2); }
.btn.primary[disabled] { opacity: .55; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line-2); }
.btn.light { background: #fff; color: var(--navy); }
.btn.soft { background: var(--navy-soft); color: var(--navy); min-height: 46px; font-size: 15.5px; padding: 10px 16px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.bottom-inner { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; }
.bottom-inner .btn { flex: 1; }
.bottom-inner .btn.ghost { flex: 0 0 34%; }

/* Documents */
.doc-group { margin-bottom: 16px; }
.doc-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.doc-count { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.doc { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; background: #fff; }
.doc.has { border-color: #bfe0d0; background: linear-gradient(0deg, #fbfefc, #fff); }
.doc.na { background: #fafbfc; }
.doc.na .doc-title { color: var(--muted); }
.doc-top { display: flex; gap: 12px; align-items: flex-start; }
.doc-icon { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--navy-soft); color: var(--navy); }
.doc.has .doc-icon { background: var(--ok-soft); color: var(--ok); }
.doc-icon svg { width: 18px; height: 18px; fill: currentColor; }
.doc-title { font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.doc-help { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.na-toggle { font-size: 14px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; padding: 8px 4px; cursor: pointer; }
.na-toggle input { width: 18px; height: 18px; accent-color: var(--navy); }
.files { list-style: none; padding: 0; margin: 10px 0 0; }
.files li { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 10px; background: var(--navy-tint); border-radius: 10px; margin-bottom: 6px; }
.files .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .fsize { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.files .ok { color: var(--ok); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.files .err { color: var(--err); font-weight: 600; font-size: 12.5px; }
.files .x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.bar { height: 5px; background: #dfe4ef; border-radius: 999px; overflow: hidden; width: 70px; flex-shrink: 0; }
.bar span { display: block; height: 100%; background: var(--navy); width: 0; transition: width .2s; }
.doc-note { margin-top: 10px; }
.doc-note textarea { min-height: 60px; font-size: 15px; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14.5px; margin-bottom: 14px; display: flex; gap: 10px; }
.notice.info { background: var(--navy-tint); color: var(--navy); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.err { background: var(--err-soft); color: var(--err); }
.error { color: var(--err); }

/* Review */
.review-list { list-style: none; padding: 0; margin: 0; }
.review-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-list li:last-child { border-bottom: 0; }
.tag { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.edit { border: 0; background: none; color: var(--navy-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px; }

.foot { max-width: 720px; margin: 8px auto 0; padding: 0 18px 20px; text-align: center; font-size: 13px; color: var(--muted); }
.foot p { margin: 0 0 4px; }
.foot a { color: inherit; }

@media (max-width: 380px) {
  .wordmark { height: 30px; }
  .secure-pill span { display: none; }
  h1 { font-size: 24px; }
}

.ssn.masked { -webkit-text-security: disc; }
