/* esign-20261113: «Подпись PDF» (admin + signer page). Uses site theme variables, own fallbacks on the standalone signer page. */
.es-standalone { --surface: #fff; --surface-2: #f6f5fb; --surface-3: #efedf7; --border: #e4e0f0; --text: #17151f; --text-dim: #6f6b80; --accent: #6c47ff; --accent-grad: linear-gradient(135deg, #6c47ff, #ff4d9d); --bg: #f4f2fb; }
html[data-theme="dark"] .es-standalone { --surface: #1b1922; --surface-2: #211f2a; --surface-3: #2a2734; --border: #34303f; --text: #eeecf5; --text-dim: #a19cb3; --bg: #121016; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .es-standalone { --surface: #1b1922; --surface-2: #211f2a; --surface-3: #2a2734; --border: #34303f; --text: #eeecf5; --text-dim: #a19cb3; --bg: #121016; } }
.es-standalone { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; padding-bottom: 150px; }
.es-standalone .muted { color: var(--text-dim); } .es-standalone .small { font-size: .85em; }
.es-standalone .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--border); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--surface); color: var(--text); }
.es-standalone .btn-primary { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 10px 26px rgba(108, 71, 255, .28); }
.es-standalone .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.es-standalone .btn-sm { min-height: 40px; padding: 0 16px; }
.es-top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px; }
.es-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; }
.es-logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-grad); color: #fff; display: grid; place-items: center; font-size: 15px; }
.es-logo-img { width: 28px; height: 28px; border-radius: 8px; display: block; }
.es-signbar { max-width: 920px; margin: 16px auto 8px; padding: 0 14px; }
.es-sb-l { display: flex; flex-direction: column; } .es-sb-l b { font-size: 1.15em; }
.es-signwrap { max-width: 920px; margin: 0 auto; padding: 0 10px; }
.es-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px 16px; align-items: center; justify-content: center; flex-wrap: wrap; box-shadow: 0 -8px 24px rgba(0, 0, 0, .06); }
.es-prog { font-weight: 700; } .es-consent { display: flex; gap: 8px; align-items: center; font-size: .9em; max-width: 420px; cursor: pointer; }
.es-consent input { width: 20px; height: 20px; flex: none; accent-color: #6c47ff; }
.es-center { max-width: 520px; margin: 12vh auto; text-align: center; padding: 0 20px; } .es-done { font-size: 54px; } .es-center h1 { margin: 8px 0; }

/* pages + fields (shared) */
.es-doc { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.es-page { position: relative; width: 100%; background: #fff; border-radius: 6px; box-shadow: 0 2px 14px rgba(20, 16, 40, .14); overflow: hidden; }
.es-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.es-layer { position: absolute; inset: 0; }
.es-doc.placing .es-layer { cursor: crosshair; background: rgba(108, 71, 255, .05); }
.es-pnum { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #888; background: rgba(255, 255, 255, .85); padding: 1px 6px; border-radius: 6px; pointer-events: none; }
.es-loading { padding: 60px 20px; text-align: center; color: var(--text-dim, #888); border: 1px dashed var(--border, #ddd); border-radius: 12px; }
.es-field { position: absolute; box-sizing: border-box; border: 0; background: rgba(108, 71, 255, .16); border-radius: 6px; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; color: #3b21b8; font-size: clamp(9px, 1.4vw, 13px); font-weight: 700; }
.es-doc[data-mode="edit"] .es-field { cursor: move; }
.es-field.drag { box-shadow: 0 6px 18px rgba(108, 71, 255, .35); z-index: 2; }
.es-flabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; pointer-events: none; }
.es-del { position: absolute; top: -11px; right: -11px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #e5484d; color: #fff; font-size: 15px; line-height: 20px; cursor: pointer; padding: 0; }
.es-rs { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; background: #6c47ff; border: 0; border-radius: 3px; cursor: nwse-resize; }
.es-field.signer.t-signature { cursor: pointer; animation: es-pulse 1.6s ease-in-out infinite; }
.es-field.signer.filled { animation: none; background: rgba(108, 71, 255, .06); }
.es-field.signer img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.es-field.signer input { width: 100%; height: 100%; border: 0; background: transparent; font: inherit; font-weight: 600; color: #101850; padding: 0 4px; outline: none; }
.es-ftext { color: #101850; font-weight: 600; white-space: nowrap; overflow: hidden; }
@keyframes es-pulse { 50% { background: rgba(108, 71, 255, .3); } }

/* modal */
.es-modal { position: fixed; inset: 0; z-index: 50; background: rgba(10, 8, 20, .55); display: flex; align-items: flex-end; justify-content: center; }
.es-modal[hidden] { display: none; }
.es-modal-card { width: 100%; max-width: 620px; background: var(--surface); color: var(--text); border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) { .es-modal { align-items: center; } .es-modal-card { border-radius: 18px; } }
.es-tabs { display: flex; gap: 6px; background: var(--surface-3); padding: 4px; border-radius: 12px; }
.es-tabs button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 9px; font: inherit; font-weight: 700; color: var(--text-dim); cursor: pointer; }
.es-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.es-pad { width: 100%; height: 200px; background: #fff; border: 1px solid var(--border); border-radius: 12px; touch-action: none; display: block; }
.es-padline { margin-top: -38px; margin-bottom: 18px; border-top: 1px dashed #c9c4da; margin-left: 24px; margin-right: 24px; padding-top: 4px; font-size: 12px; color: #9a96aa; pointer-events: none; text-align: center; position: relative; }
.es-pane input, .es-namein input { width: 100%; box-sizing: border-box; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font: inherit; background: var(--surface); color: var(--text); margin-bottom: 8px; }
.es-namein { display: flex; flex-direction: column; gap: 4px; font-size: .85em; color: var(--text-dim); }
.es-typedprev { height: 130px; }
.es-modal-actions { display: flex; gap: 8px; } .es-modal-actions span { flex: 1; }
body.es-noscroll { overflow: hidden; }

/* admin */
.es-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; margin-top: 14px; }
.es-panel { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.es-panel .box { margin: 0; } .es-panel h3 { margin: 0 0 8px; font-size: 1.02em; }
.es-toolbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.es-tool { min-height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.es-tool.on { border-color: #6c47ff; background: rgba(108, 71, 255, .12); color: #6c47ff; box-shadow: 0 0 0 3px rgba(108, 71, 255, .18); }
.es-count { margin-top: 8px; }
.es-sendform label, .es-upload label:not(.es-drop) { display: flex; flex-direction: column; gap: 4px; font-size: .88em; font-weight: 600; margin-bottom: 10px; }
.es-sendform input, .es-sendform textarea, .es-upload input:not([type=file]) { font-weight: 400; }
.es-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .es-actions form { margin: 0; }
.es-actions.es-col { flex-direction: column; align-items: stretch; } .es-actions.es-col .btn { width: 100%; }
.es-err { color: #e5484d; margin-top: 6px; min-height: 1em; }
.es-head h1 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 2px; font-size: 1.5em; }
.es-upload { display: flex; flex-direction: column; gap: 14px; }
.es-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border: 2px dashed var(--border); border-radius: 14px; cursor: pointer; text-align: center; transition: .15s; }
.es-drop:hover, .es-drop.over { border-color: #6c47ff; background: rgba(108, 71, 255, .06); }
.es-drop.has { border-style: solid; border-color: #0e9f6e; }
.es-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.es-drop-ic { font-size: 30px; } .es-drop-name { font-weight: 700; color: #0e9f6e; }
.es-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .es-grid2 label { margin: 0 !important; }
.es-events { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.es-events li { display: flex; flex-direction: column; border-left: 3px solid #6c47ff; padding-left: 8px; }
.es-hash { display: flex; flex-direction: column; gap: 2px; } .es-hash code { word-break: break-all; font-size: 11px; }
.es-linkbox input { width: 100%; margin-top: 6px; font-family: monospace; }
.es-table td { vertical-align: top; }
@media (max-width: 900px) { .es-wrap { grid-template-columns: 1fr; } .es-panel { position: static; order: -1; } .es-grid2 { grid-template-columns: 1fr; } }
.es-panel .kv { grid-template-columns: 88px minmax(0, 1fr); } .es-panel .kv > div { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 640px) { .es-table th:nth-child(1), .es-table td:nth-child(1), .es-table th:nth-child(5), .es-table td:nth-child(5) { display: none; } .es-table td:last-child .btn { margin-top: 4px; } }
.es-crypto-ok { color: #0e9f6e; }

/* esignlang-20261114: certificate language on the signer page + paid note */
.es-lang { display: flex; flex-direction: column; gap: 4px; min-width: 210px; }
.es-lang-l { font-size: .8em; font-weight: 700; color: var(--text-dim); }
.es-lang-tabs { min-width: 210px; }
.es-price-note { margin: 0 0 10px; font-size: .9em; }
.es-price-note b { white-space: nowrap; }
.flash.err .btn { margin-left: 8px; vertical-align: middle; }
@media (max-width: 640px) {
  .es-footer { align-items: stretch; }
  .es-lang { width: 100%; min-width: 0; }
  .es-lang-tabs { width: 100%; }
  .es-consent { max-width: none; }
  .es-footer .btn-primary { width: 100%; }
}

/* public landing /podpis-pdf */
.es-land { max-width: 820px; }
.es-land .page-head h1 { margin: 6px 0 10px; }
.es-land-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 8px; }
.es-land-steps, .es-land-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 10px; }
.es-land .hsec { margin-top: 18px; }


/* ux-20261118: flat look — one accent color, no frames; buttons follow the left rail (flat, 8px, soft hover, no lift/shadow) */
.es-flat .btn { border: 0; box-shadow: none; transform: none; border-radius: 8px; min-height: 38px; padding: 0 16px; font-size: .9rem; font-weight: 700; transition: background .15s; }
.es-flat .btn:hover { transform: none; box-shadow: none; }
.es-flat .btn-sm, .es-flat .btn-xs { min-height: 32px; padding: 0 12px; font-size: .84rem; }
.es-flat .btn-primary { background: #6c47ff; color: #fff; }
.es-flat .btn-primary:hover { background: #5b38ea; }
.es-flat .btn-ghost { background: var(--surface-2); color: var(--text); border: 0; }
.es-flat .btn-ghost:hover { background: var(--surface-3); border: 0; }
.es-flat .btn-danger { background: var(--surface-2); color: #d13438; border: 0; }
.es-flat .btn-danger:hover { background: rgba(209, 52, 56, .12); }
.es-flat .box { border: 0; box-shadow: none; background: var(--surface-2); border-radius: 14px; }
.es-flat .table-wrap { border: 0; background: transparent; }
.es-flat .t th, .es-flat .t td { border: 0; }
.es-flat .t tbody tr:hover { background: var(--surface-2); }
.es-flat input:not([type=file]):not([type=checkbox]), .es-flat textarea { border: 0; background: var(--surface-3); border-radius: 8px; }
.es-flat input:focus-visible, .es-flat textarea:focus-visible { outline: 2px solid #6c47ff; outline-offset: 0; }
.es-flat .es-drop { border: 0; background: var(--surface-2); }
.es-flat .es-drop:hover, .es-flat .es-drop.over { background: var(--surface-3); }
.es-flat .es-drop.has { background: rgba(108, 71, 255, .12); }
.es-flat .es-drop-name { color: #6c47ff; }
.es-flat .es-tool { border: 0; background: var(--surface-3); border-radius: 8px; min-height: 38px; font-size: .9rem; }
.es-flat .es-tool:hover { background: rgba(108, 71, 255, .12); }
.es-flat .es-tool.on { background: rgba(108, 71, 255, .22); color: #6c47ff; box-shadow: none; }
.es-flat .es-events li { border-left: 0; padding-left: 0; }
.es-crypto-ok { color: #6c47ff; }
.es-flat .hsec { margin-top: 14px; }

/* sample page + step-by-step guide */
.es-how { display: grid; grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); gap: 28px; align-items: start; margin-bottom: 8px; }
.es-sample { background: var(--surface-2); border-radius: 14px; padding: 14px; }
.es-flat .box .es-sample { background: var(--surface-3); }
.es-sample-cap { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px; }
.es-sample-page { position: relative; aspect-ratio: 3 / 4; background: #fff; border-radius: 6px; padding: 16px 14px; box-shadow: 0 1px 8px rgba(20, 16, 40, .10); }
.es-sample-page .l { display: block; height: 5px; border-radius: 3px; background: #e9e7f0; margin: 0 0 9px; }
.es-sample-page .w50 { width: 50%; } .es-sample-page .w60 { width: 60%; } .es-sample-page .w70 { width: 70%; } .es-sample-page .w80 { width: 80%; } .es-sample-page .w90 { width: 90%; }
.es-sample-page .f { position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(108, 71, 255, .16); color: #4a2fd0; font-size: .68rem; font-weight: 800; }
.es-sample-page .f-sig { left: 10%; bottom: 24%; width: 46%; height: 12%; }
.es-sample-page .f-name { left: 10%; bottom: 11%; width: 46%; height: 8%; }
.es-sample-page .f-date { right: 9%; bottom: 11%; width: 26%; height: 8%; }
.es-how-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.es-how-steps li { display: flex; gap: 12px; align-items: flex-start; }
.es-how-steps li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.es-how-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(108, 71, 255, .14); color: #4a2fd0; font-weight: 800; font-size: .85rem; display: grid; place-items: center; }
html[data-theme="dark"] .es-how-n { color: #d8ceff; }
@media (max-width: 700px) { .es-how { grid-template-columns: 1fr; gap: 18px; } .es-sample { max-width: 260px; } }
.es-how + p, .es-how + .muted { margin-top: 18px; }

/* sample of the finished signed document */
.es-result { margin-top: 26px; }
.es-shots { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 12px; }
.es-shot { display: block; width: min(100%, 240px); line-height: 0; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 14px rgba(20, 16, 40, .16); background: #fff; }
.es-shot img { width: 100%; height: auto; display: block; }
.es-result-note { margin: 0 0 12px; max-width: 520px; }
.es-result + p, .es-result + .muted { margin-top: 22px; }
