/* Doorline Sign. Brand: Indigo #3A2A8F, Gold #C2952F, Ink #1D1650, Lavender #B8ACF4 */
@font-face { font-family: "Inter"; src: url("fonts/inter-var-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Sora"; src: url("fonts/sora-var-latin.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Dancing Script"; src: url("fonts/DancingScript.ttf") format("truetype"); font-weight: 400 700; font-display: block; }
:root { --indigo: #3A2A8F; --indigo-600: #31237A; --indigo-50: #EEEBFB; --gold: #C2952F; --ink: #1D1650; --bg: #F6F5FB; --card: #fff; --line: #E4E1F2; --muted: #625C86; --danger: #B3261E; --ok: #1E7A4C; --radius: 12px; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3 { font-family: Sora, Inter, sans-serif; line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; margin-top: .4em; }
a { color: var(--indigo); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: Sora, sans-serif; font-size: 1.05rem; }
.brand b { color: var(--indigo); }
.nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 500; }
main { max-width: 1000px; margin: 24px auto; padding: 0 16px; }
main.wide { max-width: 1200px; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { display: block; font-weight: 500; margin: 10px 0; }
input, textarea, select { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #CFCBE6; border-radius: 8px; font: inherit; color: inherit; background: #fff; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--lavender, #B8ACF4); outline-offset: 1px; }
input[type=checkbox] { display: inline; width: auto; margin: 0 8px 0 0; }
label.check { display: flex; align-items: flex-start; font-weight: 400; }
.checks { display: grid; gap: 4px; }
.btn { display: inline-block; background: var(--indigo); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font: 600 15px Inter, sans-serif; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--indigo-600); }
.btn.ghost { background: #fff; color: var(--indigo); border: 1px solid var(--indigo); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--indigo); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
form.inline input { width: 200px; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.mono { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.flash { padding: 10px 14px; border-radius: 8px; }
.flash.error { background: #FCEEEE; color: var(--danger); }
.flash.ok { background: #E9F6EF; color: var(--ok); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--indigo-50); color: var(--indigo); }
.b-completed, .b-signed { background: #E9F6EF; color: var(--ok); }
.b-declined, .b-voided, .b-blocked, .b-failed { background: #FCEEEE; color: var(--danger); }
.b-draft, .b-pending, .b-outbox { background: #F3F1EA; color: #6B5A1E; }
fieldset.rec { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 6px 14px; }
.grid4 { display: grid; grid-template-columns: 2fr 2fr 1.3fr 1fr; gap: 10px; }
@media (max-width: 700px) { .grid4 { grid-template-columns: 1fr 1fr; } }
.consent { background: var(--indigo-50); border-radius: 10px; padding: 4px 16px; margin: 12px 0; }
.qr { display: block; margin: 10px auto; }
details.mail { border-bottom: 1px solid var(--line); padding: 6px 0; } details pre { white-space: pre-wrap; font-size: 13px; }
ul.docs { list-style: none; padding: 0; display: grid; gap: 8px; }

/* Editor and signer */
.toolbar { position: sticky; top: 0; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar select, .toolbar input[type=text] { width: auto; display: inline-block; margin: 0; }
.toolbar .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.toolbar .seg button { border: 0; background: #fff; padding: 8px 12px; font: 500 14px Inter, sans-serif; cursor: pointer; color: var(--ink); }
.toolbar .seg button[aria-pressed=true] { background: var(--indigo); color: #fff; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; cursor: pointer; font: 500 14px Inter, sans-serif; }
.tabs button[aria-selected=true] { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.pages { display: grid; gap: 16px; justify-content: center; }
.page { position: relative; box-shadow: 0 2px 10px rgba(29,22,80,.12); background: #fff; }
.page canvas { display: block; width: 100%; height: auto; }
.overlay { position: absolute; inset: 0; }
.overlay.placing { cursor: crosshair; }
.fld { position: absolute; border: 2px solid; border-radius: 4px; font: 600 11px Inter, sans-serif; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; cursor: move; user-select: none; touch-action: none; }
.fld.sel { box-shadow: 0 0 0 3px rgba(58,42,143,.35); }
.fld .h { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; background: currentColor; cursor: nwse-resize; }
.sfld { position: absolute; border: 2px dashed var(--gold); background: rgba(242,193,78,.18); border-radius: 4px; font: 600 12px Inter, sans-serif; color: #6B5A1E; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; overflow: hidden; }
.sfld.done { border-style: solid; border-color: var(--ok); background: rgba(30,122,76,.06); }
.sfld img { max-width: 100%; max-height: 100%; }
.sfld input { width: 100%; height: 100%; margin: 0; border: 0; padding: 2px 4px; background: transparent; font-size: 12px; }
.signbar { position: sticky; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: 0 -4px 12px rgba(29,22,80,.06); }
.modal { position: fixed; inset: 0; background: rgba(19,14,51,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal .box { background: #fff; border-radius: var(--radius); padding: 20px; width: min(560px, 100%); }
.modal canvas.pad { width: 100%; height: 180px; border: 1px dashed #CFCBE6; border-radius: 8px; touch-action: none; background: #fff; }
.typed { font-family: "Dancing Script", cursive; font-size: 40px; padding: 10px; border: 1px dashed #CFCBE6; border-radius: 8px; min-height: 70px; }
.spacer { flex: 1; }
