/* Creators Dept brand: #080806 black · #737373 gray · #4CBB17 green · #E3DAC9 sand · #FCFBFA off-white */
@font-face {
  font-family: "GetVoIP Grotesque";
  src: url("fonts/GetVoIPGrotesque.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
:root {
  --cd-black: #080806;
  --cd-gray: #737373;
  --cd-green: #4cbb17;
  --cd-sand: #e3dac9;
  --cd-white: #fcfbfa;

  --bg: #f4f1ea;
  --surface: #fcfbfa;
  --ink: #080806;
  --muted: #5f5f5c;
  --rule: #e3dac9;
  --accent: #4cbb17;
  --accent-ink: #080806;
  --accent-soft: #e4f5da;
  --link: #2f7a0c;
  --ok: #2f7a0c;
  --ok-soft: #e4f5da;
  --warn: #7a5c1e;
  --warn-soft: #efe7d6;
  --bad: #b3261e;
  --bad-soft: #f8e4e1;
  --radius: 4px;
  --font: "Open Sauce Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "GetVoIP Grotesque", "Open Sauce Sans", sans-serif;
  --serif: "Open Sauce Sans", -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080806; --surface: #131311; --ink: #fcfbfa; --muted: #a3a3a0; --rule: #2a2925;
    --accent: #4cbb17; --accent-ink: #080806; --accent-soft: #1b2b12; --link: #6fd63c;
    --ok: #6fd63c; --ok-soft: #1b2b12; --warn: #e3dac9; --warn-soft: #2b2822;
    --bad: #ff8a7a; --bad-soft: #3a1c18;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-family: var(--display); font-weight: 700; }
h1 { font-size: 26px; text-transform: uppercase; letter-spacing: .02em; }
h2 { text-transform: uppercase; letter-spacing: .02em; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: var(--cd-black); color: var(--cd-white); border-bottom: 3px solid var(--cd-green); }
.topbar .btn:not(.primary) { background: transparent; color: var(--cd-white); border-color: #3a3a36; }
.topbar .btn:not(.primary):hover { border-color: var(--cd-white); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--cd-white) !important; text-decoration: none !important; }
.brand img { height: 30px; display: block; }
.brand .product { font-family: var(--display); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cd-green); padding-left: 12px; border-left: 1px solid #3a3a36; }
@media (max-width: 560px) { .brand img { height: 22px; } .brand .product { display: none; } }
.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 24px 60px; }
.narrow { max-width: 760px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 3px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
form.inline { display: inline; }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.notice { background: var(--warn-soft); color: var(--warn); padding: 8px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

.tabs { display: flex; gap: 4px; margin: 16px 0; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 3px; color: var(--muted); font-size: 14px; }
.tabs a.active { background: var(--ink); color: var(--bg); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
table.list td { padding: 14px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.clickable:hover { background: var(--bg); cursor: pointer; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pill.draft, .pill.pending { background: var(--rule); color: var(--muted); }
.pill.sent { background: var(--cd-sand); color: var(--cd-black); }
.pill.viewed { background: var(--ink); color: var(--bg); }
.pill.signed, .pill.completed { background: var(--ok-soft); color: var(--ok); }
.pill.voided, .pill.declined { background: var(--bad-soft); color: var(--bad); }

.progress { height: 6px; background: var(--rule); border-radius: 999px; overflow: hidden; width: 120px; }
.progress span { display: block; height: 100%; background: var(--cd-green); }

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea.body { min-height: 480px; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }

.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor .preview { max-height: 560px; overflow: auto; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.paper { background: #fff; color: #080806; border: 1px solid var(--rule); border-top: 4px solid var(--cd-green); border-radius: 4px;
  padding: 48px 56px; font-family: var(--serif); font-size: 16px; line-height: 1.65;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05); }
.paper h1.doc-title { font-family: var(--display); font-size: 26px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .02em; }
.paper h2, .paper h3 { font-family: var(--font); margin-top: 1.4em; text-transform: none; letter-spacing: 0; }
.paper h2 { font-size: 19px; } .paper h3 { font-size: 16px; }
.paper hr { border: 0; border-top: 1px solid #e3dac9; margin: 24px 0; }
.paper .field { background: #fff4c2; padding: 0 4px; border-radius: 3px; font-family: var(--font); font-size: .9em; }
@media (max-width: 600px) { .paper { padding: 28px 22px; } }

.signer { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.signer:last-child { border-bottom: 0; }
.signer .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--cd-black); color: var(--cd-green); font-family: var(--display);
  display: grid; place-items: center; font-weight: 700; flex: none; }
.signer .info { flex: 1; min-width: 0; }
.signer .meta { font-size: 12px; color: var(--muted); }
.linkbox { display: flex; gap: 6px; margin-top: 6px; }
.linkbox input { font-size: 12px; padding: 5px 8px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--rule); }
.timeline li:last-child::after { display: none; }
.timeline li.signed::before, .timeline li.completed::before { background: var(--ok); }
.timeline li.viewed::before, .timeline li.email_opened::before { background: var(--warn); }
.timeline li.sent::before, .timeline li.emailed::before, .timeline li.copy_emailed::before, .timeline li.reminded::before { background: var(--accent); }
.timeline li.voided::before, .timeline li.declined::before { background: var(--bad); }
.timeline .t { color: var(--muted); font-size: 12px; }

/* signer page */
.sign-bar { position: sticky; top: 0; z-index: 5; background: var(--cd-black); border-bottom: 3px solid var(--cd-green);
  padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sigpad-wrap { border: 1.5px dashed var(--rule); border-radius: 8px; background: #fff; position: relative; touch-action: none; }
.sigpad-wrap canvas { display: block; width: 100%; height: 170px; cursor: crosshair; }
.sigpad-wrap .baseline { position: absolute; left: 24px; right: 24px; bottom: 40px; border-top: 1px solid #c9ccd4; pointer-events: none; }
.sigpad-wrap .x { position: absolute; left: 10px; bottom: 42px; color: #9aa0ae; font-size: 18px; pointer-events: none; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { margin-top: 4px; }
.done-hero { text-align: center; padding: 40px 20px; }
.done-hero .icon { width: 56px; height: 56px; border-radius: 50%; background: var(--cd-green); color: var(--cd-black);
  display: grid; place-items: center; font-size: 28px; margin: 0 auto 12px; }
.sig-img { max-height: 70px; background: #fff; border-radius: 4px; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }

.flash.ok { border-left: 3px solid var(--cd-green); }
.flash.error { border-left: 3px solid var(--bad); }
.tagline { font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: var(--muted); text-align: center; margin: 40px 0 0; }
@media (prefers-color-scheme: dark) { .login-icon { filter: invert(1); } }

/* section editor */
.tpl-picker { margin: 16px 0 4px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.editor-head label { margin: 0; }
.section-card { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--cd-green); border-radius: 4px; padding: 12px; margin-bottom: 10px; }
.section-card .sec-top { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.section-card .sec-num { font-family: var(--display); font-size: 11px; color: var(--muted); letter-spacing: .1em; min-width: 22px; }
.section-card input.sec-heading { font-weight: 700; font-size: 15px; padding: 8px 10px; }
.section-card textarea.sec-text { min-height: 90px; resize: vertical; font: 14px/1.55 var(--font); }
.section-card .sec-tools { display: flex; gap: 4px; flex: none; }
.section-card .sec-tools .btn { padding: 4px 8px; font-size: 12px; }
.add-section { width: 100%; justify-content: center; border-style: dashed; }
textarea.body[hidden] { display: none; }
