/* TRIVOX e-Sign — dark-premium, single-purpose UI */
:root {
  --bg: #0d0f12;
  --panel: #14171c;
  --panel-2: #1b1f26;
  --line: #262b33;
  --text: #e6e9ee;
  --muted: #8b93a1;
  --accent: #00c2a8;   /* TRIVOX teal */
  --accent-2: #ffb020; /* date stamp / warn */
  --danger: #ff5470;
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark { font-weight: 800; letter-spacing: 2px; }
.brand-sub { color: var(--accent); font-weight: 600; }
.doc-name { color: var(--muted); font-size: 13px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 360px 1fr; height: calc(100% - 53px); }
.panel { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 16px; }
.viewer { position: relative; overflow: auto; padding: 24px; background: #0a0c0f; }

/* ---------- steps ---------- */
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; background: var(--panel-2); }
.step h2 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #042; font-weight: 800; font-size: 12px;
}
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; line-height: 1.4; }

/* ---------- inputs / buttons ---------- */
.filebtn {
  display: block; text-align: center; cursor: pointer;
  background: var(--accent); color: #042; font-weight: 700;
  padding: 10px; border-radius: var(--radius);
}
.presets { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.preset-btn {
  display: block; width: 100%; text-align: center; cursor: pointer;
  background: var(--accent); color: #042; padding: 11px 10px;
  border: 0; border-radius: var(--radius); font: inherit; font-weight: 700;
}
.preset-btn:hover { filter: brightness(1.06); }
.preset-btn:disabled { opacity: .6; cursor: default; }
.filebtn-alt {
  background: transparent; color: var(--muted, #9aa6bf);
  border: 1px solid rgba(255,255,255,.16); font-weight: 600;
}
.text-input {
  width: 100%; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: #0f1216; color: var(--text);
}
.tool-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tool-btn, .ghost-btn, .primary-btn {
  flex: 1; cursor: pointer; padding: 9px; border-radius: 8px;
  border: 1px solid var(--line); background: #0f1216; color: var(--text); font-size: 13px;
}
.tool-btn:hover, .ghost-btn:hover { border-color: var(--accent); }
.tool-btn.active { background: var(--accent); color: #042; font-weight: 700; border-color: var(--accent); }
.tool-btn.date.active { background: var(--accent-2); color: #321; }
.primary-btn {
  width: 100%; background: var(--accent); color: #042; font-weight: 800; padding: 12px;
}
.primary-btn:disabled { background: #2a2f37; color: var(--muted); cursor: not-allowed; }
.size-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.size-row input { flex: 1; }
.active-tool { font-size: 12px; color: var(--accent); margin: 8px 0 0; }

/* ---------- signature pads ---------- */
.pad-group { margin-bottom: 12px; }
.pad-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pad-wrap { background: #fff; border-radius: 8px; padding: 2px; }
.sigpad { width: 100%; height: 150px; touch-action: none; display: block; border-radius: 6px; }
.sigpad.initials { height: 110px; }

/* ---------- viewer / pages ---------- */
.viewer-empty { color: var(--muted); text-align: center; margin-top: 80px; }
.page-stage { position: relative; margin: 0 auto 22px; box-shadow: 0 4px 24px rgba(0,0,0,.5); width: fit-content; }
.page-stage canvas { display: block; }
.page-overlay { position: absolute; inset: 0; cursor: crosshair; }
.page-overlay.placing { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* placed marks (preview only — burned into PDF on export) */
.placed { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.placed img { display: block; width: 100%; height: auto; }
.placed .stamp {
  font-size: 9px; color: #0a4; text-align: center;
  background: rgba(255,255,255,.7); border-radius: 3px; padding: 1px 3px; margin-top: 1px;
}
.placed.date-mark .datebox {
  font-size: 12px; color: #321; background: rgba(255,176,32,.85);
  padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}
