/* Client invoice page (/i/{token}). Brand colour comes from the invoice design (--brand). */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/pjs-latin.woff2") format("woff2"); }
:root { --ink: #1b1733; --mut: #6f6a8a; --line: #ebe7f6; --bg: #f6f4fb; --ok: #15803d; --bad: #b91c1c; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg);
  background-image: radial-gradient(900px 420px at 50% -120px, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%); min-height: 100vh; }
.pv { max-width: 760px; margin: 0 auto; padding: 32px 16px 40px; display: grid; gap: 16px; }
.pv-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: 0 30px 60px -48px rgba(40, 20, 90, .5); animation: pv-up .5s cubic-bezier(.2,.8,.2,1) both; }
.pv-card:nth-of-type(2) { animation-delay: .08s; } .pv-card:nth-of-type(3) { animation-delay: .16s; }
@keyframes pv-up { from { opacity: 0; transform: translateY(14px); } }
.pv-hero { position: relative; overflow: hidden; }
.pv-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 40%, #ff5a1f)); }
.pv-from { display: flex; align-items: center; gap: 12px; }
.pv-from div { display: grid; min-width: 0; } .pv-from b { font-size: 16px; } .pv-from small { color: var(--mut); overflow: hidden; text-overflow: ellipsis; }
.pv-logo { max-height: 44px; max-width: 120px; object-fit: contain; }
.pv-mono { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; background: var(--brand); flex: none; }
.pv-status { margin-left: auto; padding: 4px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 800; background: #eef2ff; color: #3730a3; white-space: nowrap; }
.pv-status--paid, .pv-status--accepted { background: #dcfce7; color: var(--ok); }
.pv-status--overdue, .pv-status--expired, .pv-status--declined { background: #fee2e2; color: var(--bad); }
.pv-status--partial { background: #fef3c7; color: #92400e; }
.pv-due { display: grid; justify-items: center; gap: 2px; padding: 26px 0 18px; text-align: center; }
.pv-due small { font-size: 13px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.pv-due strong { font-size: clamp(36px, 9vw, 52px); letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pv-due span { color: var(--mut); }
.pv-pay { display: grid; gap: 10px; }
.pv-btn { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; text-decoration: none; color: var(--ink); background: #fff; border: 1.5px solid var(--line); transition: transform .2s, box-shadow .2s, border-color .2s; }
.pv-btn:first-child { color: #fff; border-color: transparent; background: linear-gradient(110deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #e9388e)); box-shadow: 0 18px 34px -18px var(--brand); }
.pv-btn:first-child small { color: rgba(255,255,255,.85); }
.pv-btn:first-child img { background: #fff; border-radius: 6px; padding: 2px 4px; }
.pv-btn:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 18px 34px -20px var(--brand); }
.pv-btn img { width: 64px; height: 26px; object-fit: contain; flex: none; }
.pv-btn span { display: grid; flex: 1; min-width: 0; } .pv-btn b { font-size: 15.5px; } .pv-btn small { color: var(--mut); font-size: 12.5px; }
.pv-btn i { font-style: normal; font-size: 20px; transition: transform .2s; } .pv-btn:hover i { transform: translateX(4px); }
.pv-safe { margin: 4px 0 0; font-size: 12.5px; color: var(--mut); text-align: center; }
.pv-acts { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pv-ghost { padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; background: #fff; }
.pv-ghost:hover { border-color: var(--brand); color: var(--brand); }
.pv-parties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.pv-parties div { display: grid; gap: 1px; align-content: start; font-size: 13.5px; overflow-wrap: anywhere; }
.pv-parties small { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin-bottom: 3px; }
.pv-parties span { color: var(--mut); }
.pv-table { display: grid; margin-top: 8px; }
.pv-tr { display: grid; grid-template-columns: minmax(0, 1fr) 60px 100px 110px; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pv-tr span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.pv-tr span:first-child { display: grid; } .pv-tr small { color: var(--mut); font-size: 12.5px; }
.pv-th { font-size: 11.5px; font-weight: 800; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; padding-top: 4px; }
.pv-tot { margin: 14px 0 0 auto; max-width: 300px; display: grid; gap: 6px; }
.pv-tot div { display: flex; justify-content: space-between; gap: 12px; } .pv-tot dt { color: var(--mut); } .pv-tot dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.pv-tot__big { padding-top: 8px; border-top: 1px solid var(--line); font-size: 17px; } .pv-tot__big dt { color: var(--ink); font-weight: 800; } .pv-tot__big dd { font-weight: 800; }
.pv-notes { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: #faf8ff; color: #48435f; font-size: 14px; }
.pv-card h2 { margin: 0 0 12px; font-size: 17px; }
.pv-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.pv-method { padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: #fcfbff; display: grid; gap: 6px; font-size: 14px; }
.pv-method pre { margin: 0; white-space: pre-wrap; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: #3b3757; overflow-wrap: anywhere; }
.pv-method a { color: var(--brand); font-weight: 700; text-decoration: none; }
.pv-note { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); font-size: 14.5px; animation: pv-up .4s both; }
.pv-note div { display: grid; } .pv-note span { color: var(--mut); }
.pv-note--ok { border-color: #bbf7d0; background: linear-gradient(110deg, #f0fdf4, #fff); }
.pv-note--bad { border-color: #fecaca; background: #fef2f2; color: var(--bad); }
.pv-tick { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--ok); position: relative; animation: pv-pop .6s cubic-bezier(.2,1.6,.4,1) both; }
.pv-tick::after { content: ""; position: absolute; left: 13px; top: 9px; width: 9px; height: 16px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
@keyframes pv-pop { from { transform: scale(0); } }
.pv-foot { text-align: center; font-size: 12.5px; color: var(--mut); padding-top: 4px; }
.pv-foot a { color: var(--brand); font-weight: 700; text-decoration: none; }
@media (max-width: 600px) {
  .pv { padding-top: 16px; } .pv-card { padding: 18px; border-radius: 20px; }
  .pv-parties { grid-template-columns: 1fr 1fr; } .pv-parties div:last-child { grid-column: 1 / -1; }
  .pv-tr { grid-template-columns: minmax(0, 1fr) auto; } .pv-tr span:nth-child(2), .pv-tr span:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.pv-decide { display: grid; gap: 8px; } .pv-decide form { margin: 0; display: grid; }
.pv-btn--accept { width: 100%; font: inherit; cursor: pointer; text-align: left; color: #fff !important; border: 0 !important; background: linear-gradient(110deg, #16a34a, #0d9488) !important; box-shadow: 0 18px 34px -18px #16a34a !important; }
.pv-btn--accept small { color: rgba(255,255,255,.85) !important; }
.pv-decide .pv-ghost { justify-self: center; font: inherit; font-weight: 700; cursor: pointer; }
/* portal */
.pt-list { display: grid; gap: 8px; }
.pt-doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s, border-color .2s; }
.pt-doc:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 16px 30px -22px var(--brand); }
.pt-doc span:nth-child(2) { display: grid; min-width: 0; } .pt-doc small { color: var(--mut); font-size: 12.5px; }
.pt-type { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px 9px; border-radius: 99px; background: #f1eafe; color: #6d28d9; }
.pt-doc b.pt-amt { font-variant-numeric: tabular-nums; }
.pt-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.pt-sum div { padding: 14px; border-radius: 16px; background: #faf8ff; display: grid; text-align: center; } .pt-sum small { color: var(--mut); font-size: 12px; font-weight: 700; } .pt-sum b { font-size: 20px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .pt-doc { grid-template-columns: minmax(0, 1fr) auto; } .pt-doc .pt-type, .pt-doc .pv-status { display: none; } .pt-sum { grid-template-columns: 1fr; } }
/* join */
.jn { max-width: 440px; margin: 60px auto; } .jn form { display: grid; gap: 12px; margin-top: 16px; }
.jn label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.jn input { padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); font: inherit; } .jn input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.jn button { padding: 14px; border: 0; border-radius: 14px; font: inherit; font-weight: 800; color: #fff; cursor: pointer; background: linear-gradient(110deg, #6c2bf2, #e9388e); box-shadow: 0 16px 30px -16px #6c2bf2; }
/* Money controls: deposit notes, part-payment amount, late fee and deposit rows */
.pv-dep { display: block; margin-top: 8px; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--ink) !important; background: color-mix(in srgb, var(--brand) 10%, #fff); max-width: 460px; }
.pv-dep--ok { background: #dcfce7; color: #166534 !important; }
.pv-amt { display: grid; gap: 6px; text-align: left; }
.pv-amt span { font-size: 13px; font-weight: 700; color: var(--mut); }
.pv-amt input { font: inherit; font-size: 20px; font-weight: 700; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); width: 100%; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.pv-amt input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.pv-amt small { font-size: 12.5px; color: var(--mut); }
.pv-btn--btn { width: 100%; font: inherit; cursor: pointer; text-align: left; }
.pv-pay .pv-btn--btn:first-of-type { color: #fff; border-color: transparent; background: linear-gradient(110deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #e9388e)); box-shadow: 0 18px 34px -18px var(--brand); }
.pv-pay .pv-btn--btn:first-of-type small { color: rgba(255,255,255,.85); }
.pv-pay .pv-btn--btn:first-of-type img { background: #fff; border-radius: 6px; padding: 2px 4px; }
.pv-pay .pv-btn--btn:not(:first-of-type) { color: var(--ink); background: #fff; }
.pv-tot__late dt, .pv-tot__late dd { color: #b45309 !important; }
.pv-tot__dep { padding: 6px 8px; margin: 0 -8px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 9%, #fff); }
.pv-tot__dep dt { color: var(--ink) !important; font-weight: 700; }
.pt-credit { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #dcfce7; color: #166534; font-weight: 600; font-size: 14px; }
