/* WP Form eSign — signing page */
.wpfe-app {
	--wpfe-primary: #38bdf8;
	--wpfe-primary-dark: #0ea5e9;
	--wpfe-primary-deep: #075985;
	--wpfe-ink: #0f172a;
	--wpfe-muted: #64748b;
	--wpfe-line: #e2e8f0;
	--wpfe-bg: #f0f9ff;
	--wpfe-red: #dc2626;
	max-width: 880px;
	margin: 0 auto;
	color: var(--wpfe-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	box-sizing: border-box;
}
.wpfe-app *, .wpfe-app *::before, .wpfe-app *::after { box-sizing: border-box; }

.wpfe-card {
	background: #fff;
	border: 1px solid var(--wpfe-line);
	border-radius: 14px;
	padding: 28px 32px;
	margin: 0 0 20px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(2, 132, 199, .18);
}
.wpfe-paper { padding: 36px 44px; }
@media (max-width: 640px) {
	.wpfe-card, .wpfe-paper { padding: 20px 16px; border-radius: 10px; }
}

.wpfe-header { display: flex; gap: 16px; align-items: center; border-bottom: 3px solid var(--wpfe-primary); padding-bottom: 16px; margin-bottom: 20px; }
.wpfe-logo { width: 54px; height: 54px; object-fit: contain; border-radius: 10px; flex: none; }
.wpfe-company { font-size: 13px; color: var(--wpfe-muted); text-transform: uppercase; letter-spacing: .06em; }
.wpfe-title { font-size: 26px; line-height: 1.25; margin: 2px 0 0; color: var(--wpfe-primary-deep); }
.wpfe-desc { margin: 4px 0 0; color: var(--wpfe-muted); font-size: 15px; }
.wpfe-intro { background: var(--wpfe-bg); border-left: 4px solid var(--wpfe-primary); padding: 10px 14px; border-radius: 6px; font-size: 15px; }

.wpfe-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.wpfe-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wpfe-badge { display: inline-block; background: #fef3c7; color: #92400e; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.wpfe-badge.is-done { background: #dcfce7; color: #166534; }

.wpfe-doc-body { overflow-wrap: anywhere; }
.wpfe-doc-body img { max-width: 100%; height: auto; }
.wpfe-doc-body table { max-width: 100%; }

/* Fields */
.wpfe-field { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 2px; vertical-align: middle; }
.wpfe-field-block { display: flex; flex-direction: column; align-items: stretch; margin: 10px 0; }
.wpfe-field-label { font-size: 13px; color: var(--wpfe-muted); font-weight: 600; }
.wpfe-field-label em, .wpfe-req, .wpfe-label em { color: var(--wpfe-red); font-style: normal; }
.wpfe-app input[type=text], .wpfe-app input[type=email], .wpfe-app input[type=url], .wpfe-app input[type=number], .wpfe-app input[type=date], .wpfe-app input[type=password], .wpfe-app select, .wpfe-app textarea {
	border: 1.5px solid #bae6fd;
	background: #f8fdff;
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 15px;
	color: var(--wpfe-ink);
	min-height: 40px;
	max-width: 100%;
	font-family: inherit;
	transition: border-color .15s, box-shadow .15s;
}
.wpfe-field input:not([type=checkbox]):not([type=radio]):not([type=file]), .wpfe-field select { min-width: 180px; }
.wpfe-field-block textarea { width: 100%; }
.wpfe-app input:focus, .wpfe-app select:focus, .wpfe-app textarea:focus { outline: none; border-color: var(--wpfe-primary-dark); box-shadow: 0 0 0 3px rgba(56, 189, 248, .25); background: #fff; }
.wpfe-app input[readonly] { background: #f1f5f9; color: var(--wpfe-muted); }
.wpfe-initials { width: 90px; min-width: 90px !important; text-align: center; font-weight: 700; letter-spacing: .1em; }
.wpfe-choices { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.wpfe-choice { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.wpfe-choice input { width: 18px; height: 18px; accent-color: var(--wpfe-primary-dark); }
.wpfe-today { font-weight: 600; border-bottom: 1px solid #94a3b8; padding: 0 4px; }
.wpfe-help { color: var(--wpfe-muted); font-size: 12px; }
.wpfe-field-owner { font-size: 11px; background: var(--wpfe-bg); color: var(--wpfe-primary-deep); padding: 1px 8px; border-radius: 999px; }
.wpfe-invalid input, .wpfe-invalid select, .wpfe-invalid textarea, .wpfe-invalid.wpfe-choices, .wpfe-invalid .wpfe-choices { border-color: var(--wpfe-red) !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); border-radius: 8px; }
.wpfe-value { display: inline; }
.wpfe-filled { font-weight: 600; border-bottom: 1px solid #94a3b8; padding: 0 4px; }
.wpfe-blank { display: inline-block; min-width: 140px; border-bottom: 1px solid #94a3b8; }
.wpfe-check { margin-right: 12px; white-space: nowrap; }
.wpfe-merge-tag { background: #e0f2fe; color: var(--wpfe-primary-deep); border-radius: 4px; padding: 0 6px; font-size: .9em; }
.wpfe-page-break { border-top: 1px dashed var(--wpfe-line); margin: 24px 0; }

/* Signature blocks */
.wpfe-signatures { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px 32px; margin-top: 36px; }
.wpfe-sigblock { min-width: 0; }
.wpfe-sigimg { height: 86px; display: flex; align-items: flex-end; }
.wpfe-sigimg img { max-height: 82px; max-width: 100%; }
.wpfe-sig-empty, .wpfe-sig-placeholder { color: #94a3b8; font-style: italic; font-size: 14px; padding-bottom: 6px; }
.wpfe-sigblock.is-current .wpfe-sigimg { background: repeating-linear-gradient(-45deg, #f0f9ff, #f0f9ff 8px, #e0f2fe 8px, #e0f2fe 16px); border-radius: 8px 8px 0 0; padding: 6px 10px; }
.wpfe-sig-placeholder.has-sig { background: transparent; }
.wpfe-sigline { border-top: 1.5px solid #334155; }
.wpfe-signame { font-weight: 700; margin-top: 4px; }
.wpfe-sigmeta { font-size: 12px; color: var(--wpfe-muted); }

/* Sign panel */
.wpfe-sign-panel h2 { margin: 0 0 18px; font-size: 22px; color: var(--wpfe-primary-deep); }
.wpfe-row { margin-bottom: 18px; }
.wpfe-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.wpfe-row > input { width: 100%; }
.wpfe-sig-tabs { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 4px; margin-bottom: 10px; }
.wpfe-tab { border: 0; background: transparent; padding: 7px 18px; border-radius: 7px; font-weight: 600; color: var(--wpfe-muted); cursor: pointer; font-size: 14px; }
.wpfe-tab.is-active { background: #fff; color: var(--wpfe-primary-deep); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.wpfe-sig-pane { display: none; }
.wpfe-sig-pane.is-active { display: block; }
.wpfe-pad-wrap { position: relative; border: 2px dashed #7dd3fc; border-radius: 12px; background: #fff; }
.wpfe-pad { display: block; width: 100%; height: 200px; cursor: crosshair; border-radius: 12px; }
.wpfe-pad-hint { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; color: #94a3b8; pointer-events: none; border-top: 1px solid #e2e8f0; margin: 0 28px; padding-top: 6px; font-size: 13px; }
.wpfe-pad-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
#wpfe-typed { width: 100%; margin-bottom: 10px; }
.wpfe-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.wpfe-font { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--wpfe-line); border-radius: 10px; padding: 10px 14px; cursor: pointer; min-height: 70px; overflow: hidden; }
.wpfe-font:has(input:checked) { border-color: var(--wpfe-primary-dark); background: var(--wpfe-bg); }
.wpfe-font span { font-size: 32px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpfe-terms label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.wpfe-terms input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--wpfe-primary-dark); flex: none; }
.wpfe-link { background: none; border: 0; padding: 0; color: var(--wpfe-primary-deep); text-decoration: underline; cursor: pointer; font: inherit; }

/* Buttons */
.wpfe-btn, .wpfe-app a.wpfe-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--wpfe-primary-dark); color: #fff !important; border: 0; border-radius: 10px;
	padding: 10px 20px; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
	transition: background .15s, transform .05s;
}
.wpfe-btn:hover { background: var(--wpfe-primary-deep); }
.wpfe-btn:active { transform: translateY(1px); }
.wpfe-btn:disabled { opacity: .6; cursor: wait; }
.wpfe-btn-lg { width: 100%; padding: 16px 24px; font-size: 17px; text-transform: uppercase; letter-spacing: .04em; }
.wpfe-btn-ghost { background: #fff; border: 1.5px solid #bae6fd; color: var(--wpfe-primary-deep); border-radius: 8px; padding: 7px 14px; font-weight: 600; cursor: pointer; font-size: 14px; }
.wpfe-btn-ghost:hover { background: var(--wpfe-bg); }
.wpfe-secure { text-align: center; color: var(--wpfe-muted); font-size: 13px; margin: 12px 0 0; }

/* Messages */
.wpfe-errors, .wpfe-client-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 10px 14px; border-radius: 8px; margin: 14px 0; font-size: 14px; }
.wpfe-errors ul { margin: 0; padding-left: 18px; }
.wpfe-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 14px 18px; border-radius: 12px; margin-bottom: 16px; }
.wpfe-success p { margin: 4px 0 0; }
.wpfe-notice { text-align: center; padding: 40px 28px; }
.wpfe-notice-logo { width: 64px; height: 64px; border-radius: 14px; margin-bottom: 10px; }
.wpfe-notice h2 { margin: 6px 0; color: var(--wpfe-primary-deep); }
.wpfe-notice p { color: var(--wpfe-muted); }
.wpfe-notice form { text-align: left; max-width: 340px; margin: 16px auto 0; }
.wpfe-code-form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.wpfe-code-form input { flex: 1 1 200px; }
.wpfe-mydocs { list-style: none; padding: 0; margin: 0; }
.wpfe-mydocs li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--wpfe-line); }

/* Modal */
.wpfe-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.wpfe-modal[hidden] { display: none; }
.wpfe-modal-box { background: #fff; border-radius: 14px; padding: 24px; max-width: 620px; width: 100%; max-height: 90vh; overflow: auto; }
.wpfe-modal-body { font-size: 14px; color: #334155; margin-bottom: 16px; }
.wpfe-modal-box .wpfe-btn-ghost { margin-left: 6px; }

/* Audit */
.wpfe-audit-wrap summary { cursor: pointer; font-weight: 700; color: var(--wpfe-primary-deep); }
.wpfe-audit { font-size: 13px; margin-top: 14px; }
.wpfe-audit-head td { padding-bottom: 10px; border-bottom: 3px solid var(--wpfe-primary); }
.wpfe-audit-table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.wpfe-audit-table th, .wpfe-audit-table td { border: 1px solid var(--wpfe-line); padding: 7px 10px; text-align: left; vertical-align: top; }
.wpfe-audit-table th { background: var(--wpfe-bg); }
.wpfe-audit-sub { font-size: 15px; color: var(--wpfe-primary-deep); margin: 18px 0 4px; }
.wpfe-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }

@media print {
	.wpfe-toolbar, .wpfe-sign-panel, .wpfe-success, .wpfe-audit-wrap > summary { display: none !important; }
	.wpfe-card { box-shadow: none; border: 0; padding: 0; }
	.wpfe-audit-wrap { display: block; }
	.wpfe-audit-wrap[open] .wpfe-audit, .wpfe-audit-wrap .wpfe-audit { display: block; page-break-before: always; }
	.wpfe-field input, .wpfe-field select, .wpfe-field textarea { border: 0; border-bottom: 1px solid #000; background: transparent; }
}

/* ---- 1.1.0: field sizes, layouts, display styles, avatars ---- */
.wpfe-size-small input, .wpfe-size-small select { width: 130px; min-width: 0 !important; }
.wpfe-size-medium input, .wpfe-size-medium select { width: 260px; }
.wpfe-size-large input, .wpfe-size-large select, .wpfe-size-large textarea { width: 440px; max-width: 100%; }
.wpfe-size-full { display: flex; width: 100%; }
.wpfe-size-full input, .wpfe-size-full select, .wpfe-size-full textarea { width: 100%; }
.wpfe-size-small textarea { min-height: 60px; }
.wpfe-size-large textarea { min-height: 160px; }
.wpfe-layout-vertical .wpfe-choices { flex-direction: column; gap: 6px; }
.wpfe-style-border .wpfe-filled { border: 1px solid #94a3b8; border-radius: 4px; padding: 1px 8px; }
.wpfe-style-plain .wpfe-filled, .wpfe-style-plain .wpfe-blank { border: 0; padding: 0; }
.wpfe-style-plain .wpfe-blank { min-width: 0; }
.wpfe-signer-id { display: flex; gap: 12px; align-items: center; margin: -6px 0 18px; padding: 10px 12px; background: var(--wpfe-bg); border-radius: 10px; font-size: 14px; }
.wpfe-signer-id img { border-radius: 50%; }
.wpfe-signer-id span { color: var(--wpfe-muted); }
.wpfe-pass-form { display: grid; gap: 10px; max-width: 360px; margin: 16px auto 0; }
.wpfe-forgot-form { margin-top: 12px; text-align: center; }
.wpfe-forgot-form .wpfe-link { font-size: 14px; }
/* Dashboard (1.1.0) */
.wpfe-dash-title { margin: 0 0 14px; color: var(--wpfe-primary-deep); }
.wpfe-dash-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.wpfe-dash-table th { text-align: left; font-size: 13px; color: var(--wpfe-muted); border-bottom: 2px solid var(--wpfe-line); padding: 8px; }
.wpfe-dash-table td { border-bottom: 1px solid var(--wpfe-line); padding: 10px 8px; vertical-align: middle; }
.wpfe-dash-actions { text-align: right; white-space: nowrap; }
.wpfe-dash-actions a { margin-left: 6px; text-decoration: none; display: inline-block; }
.wpfe-badge.is-wait { background: #e0f2fe; color: #075985; }
.wpfe-muted { color: var(--wpfe-muted); }
@media (max-width: 640px) {
	.wpfe-dash-table thead { display: none; }
	.wpfe-dash-table tr { display: block; border-bottom: 1px solid var(--wpfe-line); padding: 8px 0; }
	.wpfe-dash-table td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 0; }
	.wpfe-dash-table td::before { content: attr(data-label); color: var(--wpfe-muted); font-size: 13px; }
	.wpfe-dash-actions { justify-content: flex-start !important; }
	.wpfe-dash-actions::before { display: none; }
}
