/* Novita eSign — shared styles. System font only, one accent (Novita violet), Title Case labels. */
:root {
  --bg: #F4F4F6;
  --card: #FFFFFF;
  --ink: #111114;
  --muted: #8A8A93;
  --line: #E6E6EA;
  --panel: #0B0B0F;
  --panel-ink: #FFFFFF;
  --panel-muted: #9B9BA6;
  --accent: #6230FF;
  --accent-ink: #FFFFFF;
  --accent-soft: #EFE9FF;
  --ok: #12804A;
  --ok-soft: #E6F5EC;
  --warn: #A35F00;
  --warn-soft: #FFF3E0;
  --danger: #C4321C;
  --danger-soft: #FDECEA;
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

/* Dark panel with a faint dot grid */
.panel {
  background-color: var(--panel); color: var(--panel-ink);
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.2px);
  background-size: 14px 14px;
}
.topbar { padding: 14px 16px; }
.topbar .inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--panel-ink); text-decoration: none; font-weight: 600; }
.brand img { width: 28px; height: 28px; }
.brand span { color: var(--panel-muted); font-weight: 500; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a, .topbar nav button {
  color: var(--panel-muted); text-decoration: none; font: 500 14px var(--font); padding: 7px 12px; border-radius: 10px; white-space: nowrap;
  background: none; border: 0; cursor: pointer;
}
@media (max-width: 640px) { .topbar nav { margin-left: -12px; width: calc(100% + 12px); flex-wrap: nowrap; overflow-x: auto; } }
.topbar nav a:hover, .topbar nav button:hover, .topbar nav a.on { color: var(--panel-ink); background: rgba(255, 255, 255, .08); }

.hero { padding: 28px 16px 72px; }
.hero .inner { max-width: 760px; margin: 0 auto; }
.hero h1 { margin: 0; font-size: clamp(26px, 5vw, 38px); line-height: 1.12; letter-spacing: -.02em; font-weight: 700; }
.hero h1 .dim, h1 .dim, h2 .dim { color: var(--panel-muted); }
.hero p { color: var(--panel-muted); margin: 10px 0 0; }

.wrap { max-width: 760px; margin: -48px auto 40px; padding: 0 16px; }
.wrap.wide { max-width: 1080px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.card h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.01em; }
h2 .dim, h3 .dim { color: var(--muted); }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .card { padding: 18px; } }
.break { overflow-wrap: anywhere; word-break: break-word; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font: 600 15px var(--font); cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); transition: filter .15s, opacity .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.danger { background: var(--card); color: var(--danger); border-color: var(--line); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }

/* Forms */
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], textarea, select {
  width: 100%; font: 16px var(--font); color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 84px; }
.code-input { font-size: 28px !important; letter-spacing: .3em; text-align: center; font-weight: 600; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check.on { border-color: var(--accent); background: var(--accent-soft); }

/* Segmented control */
.seg { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; font: 500 14px var(--font); padding: 8px 14px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

.notice { padding: 12px 14px; border-radius: 14px; background: var(--bg); font-size: 14px; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; } }

/* PDF pages */
.pages { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 8px 24px rgba(0, 0, 0, .06); border-radius: 6px; overflow: hidden; max-width: 100%; }
.page canvas { display: block; width: 100%; height: auto; }
.page .num { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: var(--muted); background: rgba(255, 255, 255, .85); padding: 1px 6px; border-radius: 6px; }
.box {
  position: absolute; border: 2px dashed var(--accent); background: rgba(98, 48, 255, .08); border-radius: 6px;
  color: var(--accent); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.1; overflow: hidden;
}
.box img { max-width: 100%; max-height: 100%; }

/* Signature pad */
.pad { position: relative; border: 1px solid var(--line); border-radius: 14px; background: #fff; touch-action: none; }
.pad canvas { display: block; width: 100%; height: 180px; border-radius: 14px; cursor: crosshair; }
.pad .hint { position: absolute; left: 16px; right: 16px; bottom: 34px; border-top: 1px solid var(--line); pointer-events: none; }
.pad .hint::after { content: "Sign Here"; position: absolute; left: 0; top: 4px; font-size: 12px; color: var(--muted); }
.typed-preview { min-height: 90px; display: flex; align-items: center; padding: 8px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: 40px; color: #111;
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive; overflow: hidden; white-space: nowrap; }

.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--accent); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }

.drop { display: block; border: 2px dashed var(--line); border-radius: 16px; padding: 28px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 8px 16px 32px; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100% - 32px); }
.sticky-bar { position: sticky; bottom: 0; background: rgba(244, 244, 246, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 12px 0; margin-top: 8px; z-index: 5; }
