/* 1st Capital Title Keeper Customer Portal - phone first */
:root {
  --ink: #142033; --muted: #5b677a; --line: #d7dde6; --bg: #f2f4f8; --card: #fff;
  --brand: #0f3d6e; --brand2: #164f8c; --ok: #12784a; --okbg: #e7f6ee; --err: #b42318; --errbg: #fdecea;
  --warn: #8a5300; --warnbg: #fff4dc; --focus: #3b82f6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand2); }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

/* header: the 1st Capital Finance logo, the lender on the papers, and the secure-page badge */
.top { background: var(--card); border-bottom: 3px solid #c8191f; box-shadow: 0 1px 6px rgba(20, 32, 51, .05); }
.top .wrap { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "logo secure" "lender lender";
  align-items: center; gap: 6px 12px; padding-top: 10px; padding-bottom: 10px; }
.logo { grid-area: logo; display: block; height: 40px; width: auto; }
.lender { grid-area: lender; min-width: 0; font-size: 14px; line-height: 1.35; color: var(--muted); }
.lender b { color: var(--ink); font-weight: 700; }
.lender small { font-size: 14px; }
.lender small::before { content: " · "; }
.secure { grid-area: secure; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ok);
  background: var(--okbg); padding: 4px 10px 4px 9px; border-radius: 999px; white-space: nowrap; }
.lk { position: relative; width: 11px; height: 13px; flex: none; }
.lk::before { content: ""; position: absolute; left: 2px; top: 0; width: 7px; height: 6px; border: 2px solid currentColor;
  border-bottom: 0; border-radius: 4px 4px 0 0; box-sizing: border-box; }
.lk::after { content: ""; position: absolute; left: 0; top: 5px; width: 11px; height: 8px; background: currentColor; border-radius: 2px; }

/* progress */
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 18px 0 14px; }
.steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative;
  font-size: 13px; color: var(--muted); text-align: center; }
.steps li::before { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps .dot { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid;
  place-items: center; font-weight: 700; font-size: 14px; z-index: 1; }
.steps li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done::before, .steps li.now::before { background: var(--ok); }
.steps li.now .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px rgba(15, 61, 110, .12); }
.steps li.now { color: var(--ink); font-weight: 600; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px; margin: 0 0 16px;
  box-shadow: 0 1px 2px rgba(20, 32, 51, .04), 0 6px 24px rgba(20, 32, 51, .05); }
.card.center { text-align: center; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 22px 0 10px; }
.card > h2:first-child { margin-top: 0; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 15px; }
.small { font-size: 14px; }

/* forms */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.grid { display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-size: 15px; font-weight: 600; }
.fld input, .fld select { width: 100%; min-height: 50px; padding: 10px 14px; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid #c3ccd8; border-radius: 12px; }
.fld input:focus, .fld select:focus, canvas:focus { outline: 3px solid rgba(59, 130, 246, .35); border-color: var(--focus); }
.fld.bad input, .fld.bad select { border-color: var(--err); background: #fffafa; }
.req { color: var(--err); font-style: normal; font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; }
.ferr { color: var(--err); font-size: 14px; font-weight: 600; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; padding: 4px 0; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 22px;
  font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1.2; text-align: center; color: #fff; background: var(--brand); border: 0; border-radius: 12px; text-decoration: none; cursor: pointer;
  width: 100%; }
.btn:hover { background: var(--brand2); }
.btn[disabled] { background: #9aa8ba; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.ghost:hover { background: #f1f5fb; }
.btn.small { min-height: 40px; width: auto; }
.link { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 15px; color: var(--brand2); text-decoration: underline;
  cursor: pointer; }
.inline { display: inline; }
.row { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* messages */
.notice { padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-size: 16px; }
.notice.err { background: var(--errbg); color: var(--err); border: 1px solid #f5c2bd; }
.notice.warn { background: var(--warnbg); color: var(--warn); border: 1px solid #f3d79a; }
.notice.ok { background: var(--okbg); color: var(--ok); }

/* consent */
ul.consent { padding-left: 20px; margin: 0 0 16px; }
ul.consent li { margin-bottom: 8px; }
.sample { background: #f6f8fb; border: 1px dashed #b9c4d3; border-radius: 12px; padding: 14px; margin: 6px 0 4px; }
.sample p { margin-bottom: 10px; }

/* uploads */
.upl { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 0 0 12px; background: #fbfcfe; }
.upl-h { margin-bottom: 4px; }
.upl .muted { margin-bottom: 8px; }
ul.got { list-style: none; padding: 0; margin: 0 0 10px; font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
ul.got li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; background: var(--okbg);
  border-radius: 10px; }
ul.got li .link { padding: 4px 0; }
.ok { color: var(--ok); font-weight: 700; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.upl-msg { display: block; margin-top: 8px; font-size: 15px; color: var(--muted); }
.upl-msg.bad { color: var(--err); font-weight: 600; }

/* review */
table.review { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 16px; }
table.review th, table.review td { text-align: left; vertical-align: top; padding: 9px 0; border-bottom: 1px solid var(--line); }
table.review th { font-weight: 600; color: var(--muted); width: 45%; padding-right: 12px; }
table.review td { overflow-wrap: anywhere; }
h2.rv { font-size: 16px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); margin: 18px 0 2px; }

/* signing */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
.summary div { background: #f4f7fb; border-radius: 12px; padding: 10px 12px; }
.summary span { display: block; font-size: 13px; color: var(--muted); }
.summary b { font-size: 18px; }
ul.docs { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
ul.docs li + li { border-top: 1px solid var(--line); }
ul.docs a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; padding: 14px 16px;
  text-decoration: none; color: var(--ink); }
ul.docs a:hover { background: #f6f9fd; }
ul.docs .dt { grid-column: 1 / -1; font-weight: 600; line-height: 1.35; }
ul.docs .st { justify-self: end; color: var(--brand2); font-weight: 600; font-size: 15px; white-space: nowrap; }
ul.docs li.seen .st { color: var(--ok); }
.tag { justify-self: start; font-size: 12.5px; font-weight: 700; line-height: 1.3; padding: 3px 10px; border-radius: 999px;
  background: #e8eef8; color: var(--brand); }
.tag.read { background: #eef2f6; color: #44536a; }
.tag.ink { background: var(--warnbg); color: var(--warn); }
.padwrap { position: relative; border: 1.5px dashed #9fb0c6; border-radius: 14px; background: #fff; padding: 10px 10px 4px; }
.padwrap::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 44px; border-bottom: 1.5px solid #c7d0dc; pointer-events: none; }
.padlbl { display: block; font-size: 14px; color: var(--muted); }
canvas#sigpad { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; -webkit-user-select: none;
  user-select: none; }
.padwrap.inked { border-style: solid; border-color: var(--brand2); }
.padfoot { display: flex; justify-content: space-between; align-items: center; }
.opts { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fbfcfe; }
.opts p { margin-bottom: 8px; }
.opts .check { font-size: 15px; }

/* done */
.big-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--okbg); color: var(--ok); display: grid; place-items: center;
  font-size: 34px; font-weight: 700; margin: 0 auto 10px; }
ol.next { padding-left: 22px; margin: 0 0 14px; }
.track { background: #f6f8fb; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 4px 0 18px; }
.track .fld { flex: 1; }
ol.next > li { margin-bottom: 12px; }
ul.ink { margin: 6px 0; padding-left: 20px; }
.addr { display: inline-block; margin-top: 4px; padding: 8px 12px; background: #f4f7fb; border-radius: 10px; }
.contact { font-size: 15px; color: var(--muted); margin-top: 14px; }
.opening { padding: 30px 0; }
.spin { width: 38px; height: 38px; border: 4px solid #d6deea; border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 14px;
  animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { color: var(--muted); font-size: 13px; padding-top: 6px; padding-bottom: 40px; }
.foot .contact { font-size: 14px; }

@media (min-width: 620px) {
  .top .wrap { grid-template-columns: auto 1fr auto; grid-template-areas: "logo lender secure"; min-height: 72px; }
  .logo { height: 46px; }
  .lender { border-left: 2px solid #c8191f; padding-left: 14px; }
  .lender b, .lender small { display: block; }
  .lender b { font-size: 16px; }
  .lender small { font-size: 13px; }
  .lender small::before { content: none; }
  .card { padding: 28px 30px; }
  h1 { font-size: 27px; }
  .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .grid .fld.wide { grid-column: 1 / -1; }
  .row { flex-direction: row; }
  .row .btn { width: auto; }
  .track { align-items: flex-end; }
  .track > .btn { align-self: flex-end; min-width: 140px; }
  .form > .btn { width: auto; align-self: flex-start; min-width: 220px; }
  .summary { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
