/* Kofie Studios client portal: same palette and type as kofiestudios.co.uk */
:root {
  --ink: #0F0E0C;
  --surface: #1A1916;
  --bone: #F1ECE2;
  --muted: rgba(241, 236, 226, 0.62);
  --line: rgba(241, 236, 226, 0.12);
  --ember: #FF5A1F;
  --ok: #7BD389;
  --radius: 20px;
  --radius-sm: 12px;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--bone);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; }
img { max-width: 100%; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 40px);
  border-bottom: 1px solid var(--line);
}
.wordmark { font-weight: 600; letter-spacing: 0.18em; font-size: 13px; text-decoration: none; }
.topnav { display: flex; gap: 20px; align-items: center; font-size: 14px; }
.topnav a { text-decoration: none; color: var(--muted); }

.app {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) clamp(20px, 5vw, 40px) 80px;
}
.foot {
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
  padding: 24px clamp(20px, 5vw, 40px);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}

/* Layout */
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 40px; }
.narrow { max-width: 480px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.stack > *, .stack-sm > *, .stack-lg > * { margin-bottom: 0; }

/* Type */
h1, h2, p, ol, ul, dl { margin: 0; }
.eyebrow { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.display { font: 400 clamp(40px, 9vw, 64px)/1.02 var(--serif); letter-spacing: -0.01em; }
.title { font: 400 26px/1.2 var(--serif); }
.lead { font-size: 18px; color: var(--muted); }
.muted { color: var(--muted); }
.fine, .small { font-size: 13px; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.loading { color: var(--muted); }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }

/* Surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 5vw, 32px);
}

/* Forms */
.field { display: block; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--bone);
  font: 16px var(--sans);
}
.input:focus { outline: none; border-color: var(--ember); }
.input:disabled { color: var(--muted); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ember); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  border: 0; border-radius: 999px;
  background: var(--ember); color: var(--ink);
  font: 600 16px var(--sans);
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-ghost { background: transparent; color: var(--bone); border: 1px solid var(--line); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 14px; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }

.error { color: #FF8A65; }
.ok { color: var(--ok); }

/* Steps (client dashboard) */
.steps { list-style: none; padding: 0; display: grid; gap: 12px; }
.step-link {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none;
}
a.step-link:active { transform: scale(0.99); }
.step-ready .step-link { border-color: var(--ember); }
.step-locked .step-link { opacity: 0.55; }
.step-num { font: 400 28px/1 var(--serif); color: var(--muted); min-width: 36px; }
.step-ready .step-num { color: var(--ember); }
.step-body > * + * { margin-top: 6px; }
.step-title { font: 600 18px/1.3 var(--sans); }

.pill {
  display: inline-block; margin-top: 10px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid var(--line); color: var(--muted);
}
.pill-ready { background: var(--ember); color: var(--ink); border-color: var(--ember); }
.pill-signed { color: var(--ember); border-color: var(--ember); }
.pill-complete { color: var(--ok); border-color: rgba(123, 211, 137, 0.5); }

/* Contract */
.contract p { color: rgba(241, 236, 226, 0.86); }
.contract .clause strong { color: var(--bone); }

/* Signature */
.sig-tap { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.sig-box {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; padding: 12px;
  background: #fff; border-radius: var(--radius-sm);
}
.sig-box img { max-height: 110px; }
.sig-empty { border: 2px dashed rgba(15, 14, 12, 0.25); color: #6b6b6b; font-weight: 500; }

.sheet-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0);
  transition: background 0.25s ease;
}
.sheet-overlay.open { background: rgba(0, 0, 0, 0.6); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 760px; margin: 0 auto;
  background: var(--surface); color: var(--bone);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pad-wrap { position: relative; background: #fff; border-radius: var(--radius-sm); }
.pad { display: block; width: 100%; height: min(42vh, 260px); touch-action: none; cursor: crosshair; }
.pad-line { position: absolute; left: 24px; right: 24px; bottom: 28%; border-bottom: 1px solid #d9d4ca; pointer-events: none; }
.pad-hint { position: absolute; left: 0; right: 0; top: 40%; text-align: center; color: #9a958c; pointer-events: none; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 14px; }

/* Admin */
.client-list, .admin-steps { list-style: none; padding: 0; display: grid; gap: 12px; }
.client-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; text-decoration: none; }
.dots { display: flex; gap: 6px; margin-top: 8px; }
.dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; border: 1px solid var(--line); color: var(--muted);
}
.dot-ready { background: var(--ember); color: var(--ink); border-color: var(--ember); }
.dot-signed { border-color: var(--ember); color: var(--ember); }
.dot-complete { background: rgba(123, 211, 137, 0.18); color: var(--ok); border-color: rgba(123, 211, 137, 0.5); }
.admin-step { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
.admin-step strong, .client-row strong, .client-row .muted { display: block; }
.admin-step .pill { margin-top: 8px; }
.record { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.record dt { color: var(--muted); }
.record dd { margin: 0; }

/* Stage 2 */
.display-sm { font: 400 clamp(30px, 7vw, 44px)/1.08 var(--serif); }
.section-title { font: 600 17px/1.35 var(--sans); color: var(--bone); margin-top: 12px; }
.doc-head { padding-top: 32px; border-top: 1px solid var(--line); }
.doc-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.doc-row { width: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left; color: var(--bone); font: 600 16px var(--sans); cursor: pointer; }
details.card summary { cursor: pointer; color: var(--muted); }
details.card[open] summary { margin-bottom: 20px; }
.ticks { list-style: none; padding: 0; font-size: 14px; color: var(--muted); }
.ticks li + li { margin-top: 6px; }
.countersign { background: var(--ink); width: 100%; }
.admin-step > .stack { width: 100%; }
a.btn { text-decoration: none; }
