/* Apprifi client portal. Values come from the Apprifi Design System (tokens.json, light theme).
   Pages for people outside the office are always light, per docs/brand.md in the Apprifi platform. */

@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #172138;
  --navy-soft: #eceffa;
  --on-navy: #ffffff;
  --mark: #526bd1;
  --action: #3e56be;
  --action-deep: #3247a3;
  --on-action: #ffffff;
  --mint: #b5dde5;
  --mint-soft: #eef7f9;
  --heading: #172138;
  --ink: #202b44;
  --ink-2: #627088;
  --ink-3: #627088;
  --paper: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --line: #d9dfeb;
  --line-2: #e6e9f2;
  --line-control: #6f7891;
  --ok: #1a7050;
  --ok-soft: #e4f2ec;
  --wait: #9a5b00;
  --wait-soft: #fbf0df;
  --red: #c0392b;
  --red-text: #a3261e;
  --red-soft: #fbe7e5;
  --radius-control: 8px;
  --radius-box: 8px;
  --radius-card: 12px;
  --shadow: 0 1px 2px rgba(23, 33, 56, 0.06);
  --touch: 44px;
  --reading: 760px;
  --admin-max: 1120px;
  --font-sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
}
body.admin { font-size: 16px; }

h1, h2, h3 { color: var(--heading); font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; margin-top: 20px; }
p { margin: 0 0 12px; }
a { color: var(--action); text-underline-offset: 2px; }
a:hover { color: var(--action-deep); }

:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

/* Header: white bar with the lockup, a mint rule under it. */
.top { background: var(--surface); border-bottom: 3px solid var(--mint); }
.top-in {
  max-width: var(--reading);
  margin: 0 auto;
  padding: 14px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.admin .top-in, .admin .wrap { max-width: var(--admin-max); }
.logo { display: block; height: 34px; width: auto; }
.top-label { color: var(--ink-2); font-size: 15px; font-weight: 600; letter-spacing: 0.04em; padding-left: 14px; border-left: 1px solid var(--line); }
.signout { margin-left: auto; }

.wrap {
  max-width: var(--reading);
  margin: 0 auto;
  padding: 20px 16px 40px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card > :last-child { margin-bottom: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }

.eyebrow { color: var(--action); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 6px; }
.sub { color: var(--ink-2); margin-top: -4px; }
.fine { color: var(--ink-2); font-size: 15px; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 18px; }
.facts dt { color: var(--ink-2); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
.facts dd { margin: 0; font-weight: 600; }

/* Where the order stands: three steps, each with its word. */
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.step { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.step:last-child { border-bottom: 0; }
.step-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-control); background: var(--surface); }
.step-done .step-dot { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--surface); }
.step-now .step-dot { border-color: var(--action); box-shadow: inset 0 0 0 4px var(--surface); background: var(--action); }
.step-label { font-weight: 600; }
.step-next .step-label { color: var(--ink-2); font-weight: 500; }
.step-word { font-size: 15px; color: var(--ink-2); text-align: right; }
.step-done .step-word { color: var(--ok); font-weight: 600; }
.step-now .step-word { color: var(--action); font-weight: 600; }

.asked { margin: 0 0 16px; padding-left: 22px; }
.asked li { margin: 4px 0; }

/* Upload box: a large target to tap, which takes dropped files on a computer. */
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 24px 16px;
  border: 2px dashed var(--line-control);
  border-radius: var(--radius-box);
  background: var(--surface-2);
  cursor: pointer;
  margin-bottom: 12px;
}
.drop:hover, .drop.over { border-color: var(--action); background: var(--navy-soft); }
.drop-title { color: var(--action); font-weight: 700; font-size: 18px; }
.drop-hint { color: var(--ink-2); font-size: 15px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.drop:focus-within { outline: 3px solid var(--action); outline-offset: 2px; }
.picked { color: var(--ink); font-size: 15px; min-height: 1em; }
.progress { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progress-bar { height: 100%; width: 0; background: var(--action); transition: width 300ms ease-out; }

.filelist { list-style: none; padding: 0; margin: 0; }
.filelist li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.filelist li:last-child { border-bottom: 0; }
.filelist a { word-break: break-word; font-weight: 600; }
.file-meta { color: var(--ink-3); font-size: 15px; }

/* Buttons: 44px tall, verbs first. */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 10px 18px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.25;
}
.btn-primary { background: var(--action); color: var(--on-action); }
.btn-primary:hover { background: var(--action-deep); color: var(--on-action); }
.btn-quiet { background: var(--surface-2); color: var(--heading); border-color: var(--line-control); }
.btn-quiet:hover { background: var(--navy-soft); color: var(--heading); }
.btn-danger { background: var(--surface); color: var(--red-text); border-color: var(--red-text); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 15px; }
.btn-block { width: 100%; margin-bottom: 10px; }
.btn-sub { font-weight: 400; font-size: 14px; opacity: 0.9; word-break: break-word; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* Status chips: a word always, colour second. */
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-wait { background: var(--wait-soft); color: var(--wait); }
.chip-neutral { background: var(--navy-soft); color: var(--heading); }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

.fee { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; margin: 6px 0 14px; border-radius: var(--radius-box); background: var(--mint-soft); border: 1px solid var(--mint); }
.fee-label { font-weight: 600; }
.fee-amount { font-size: 24px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; }

.locked { list-style: none; margin: 14px 0 0; padding: 0; }
.locked li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); font-weight: 600; }
.locked-word { margin-left: auto; color: var(--ink-2); font-weight: 400; font-size: 15px; }
.lock { width: 14px; height: 12px; border: 2px solid var(--ink-2); border-radius: 2px; position: relative; margin-top: 5px; }
.lock::before { content: ""; position: absolute; left: 1px; top: -9px; width: 8px; height: 8px; border: 2px solid var(--ink-2); border-bottom: 0; border-radius: 5px 5px 0 0; }

.notice { padding: 12px 16px; border-radius: var(--radius-box); margin-bottom: 16px; font-weight: 600; }
.notice-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #b9dccb; }
.notice-wait { background: var(--wait-soft); color: var(--wait); border: 1px solid #ecd9a8; }
.field-error { color: var(--red-text); background: var(--red-soft); padding: 10px 14px; border-radius: var(--radius-box); font-weight: 600; }

.foot { color: var(--ink-2); font-size: 15px; padding: 8px 4px; }

/* Forms. */
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--heading); }
.field-hint { display: block; color: var(--ink-2); font-size: 14px; margin-top: 4px; }
input[type="text"], input:not([type]), input[type="password"], input[inputmode], textarea, select {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 12px;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-control);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
}
textarea { resize: vertical; }
input[type="file"]:not(.drop input) { font: inherit; font-size: 15px; max-width: 100%; }

/* Admin. */
.row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.row-head h1 { margin: 0; }
.backlink { font-weight: 600; }
.backlink::before { content: "\2039\00a0"; }
.grid2 { display: grid; gap: 16px; }
.grid2 > div > .card { margin-bottom: 16px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.linkbox { display: flex; gap: 8px; margin-bottom: 12px; }
.linkbox input { flex: 1; min-width: 0; font-size: 15px; background: var(--surface-2); }
.post-slot + .fine { margin-top: 12px; }
.post-slot { border-top: 1px solid var(--line-2); padding-top: 4px; margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 14px; color: var(--ink-2); font-weight: 600; letter-spacing: 0.03em; background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table a { font-weight: 600; }

/* Phones: one column, everything at least 44px, tables become labelled cards. */
@media (max-width: 640px) {
  h1 { font-size: 23px; }
  .card { padding: 16px; }
  .top-label { font-size: 14px; }
  .btn-sm { min-height: var(--touch); }
  .step { grid-template-columns: 22px 1fr; }
  .step-word { grid-column: 2; text-align: left; margin-top: -8px; }
  .linkbox { flex-direction: column; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table td { padding: 4px 0; border: 0; }
  .table td::before { content: attr(data-label); display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; letter-spacing: 0.04em; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Payments that need the appraiser, and the file fingerprint they can compare with Studio's. */
.alerts { border-color: var(--red-text); }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.alert-list li:first-child { border-top: 0; padding-top: 0; }
.alert-list p { margin: 0 0 6px; }
.hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }

/* The Venmo choice under the card payment button. */
.alt-pay { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; display: grid; gap: 10px; }
.alt-pay h3, .alt-pay p { margin: 0; }
