
@font-face {
	font-family: 'UPF Sign Dancing Script';
	src: url('../fonts/dancing-script.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'UPF Sign Caveat';
	src: url('../fonts/caveat.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'UPF Sign Pacifico';
	src: url('../fonts/pacifico.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* Sign management popup */
.signature_mgmt_popup .upf_inner {
	width: 500px;
	max-width: 92vw;
}

.upfp_sign_tabs {
	display: flex;
	gap: 8px;
	margin: 15px 0;
	border-bottom: 1px solid #e0e0e0;
}
.upfp_sign_tab_btn {
	padding: 8px 14px;
	cursor: pointer;
	color: var(--secondary-color, #555);
	border-bottom: 2px solid transparent;
}
.upfp_sign_tab_btn.active {
	color: var(--hover-color, #2271b1);
	border-bottom-color: var(--hover-color, #2271b1);
	font-weight: 600;
}

.upfp_sign_tab_content {
	display: none;
}
.upfp_sign_tab_content.active {
	display: block;
}

#upfp_sign_draw_canvas,
#upfp_sign_type_canvas {
	width: 100%;
	max-width: 460px;
	height: 180px;
	border: 1px dashed #bbb;
	border-radius: 4px;
	background: #fff;
	touch-action: none;
	cursor: crosshair;
}

.upfp_sign_actions {
	margin-top: 8px;
	text-align: right;
}
.upfp_sign_actions a {
	cursor: pointer;
	color: var(--secondary-color, #555);
}

#upfp_sign_image_input {
	display: block;
	margin-bottom: 10px;
}
.upfp_sign_image_preview_wrap {
	border: 1px dashed #bbb;
	border-radius: 4px;
	min-height: 100px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
}
#upfp_sign_image_preview {
	display: none;
	max-width: 100%;
	max-height: 160px;
}

#upfp_sign_type_input {
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 10px;
	padding: 8px;
}
#upfp_sign_font_select {
	margin-bottom: 10px;
}

.upfp_sign_current_row {
	margin-top: 15px;
	font-size: 13px;
}
#upfp_sign_current_status img {
	max-height: 50px;
	vertical-align: middle;
	margin-left: 6px;
}

#upfp_sign_save_btn {
	margin-top: 10px;
}

.upfp_sign_error {
    padding: 10px 0px;
}

/* Sign mode in doc view */
#upfp_sign_mode_container {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	text-align: left;
}

.upfp_sign_mode_toolbar {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 10px 15px;
	background: #fff;
	border-bottom: 1px solid #e0e0e0;
}

.upfp_sign_mode_hint {
	font-size: 13px;
	color: var(--secondary-color, #555);
	flex: 1 1 auto;
	order: 1;
}

.upfp_sign_mode_toolbar_btns {
	display: flex;
	gap: 10px;
	flex: 0 0 auto;
	margin-left: auto;
	order: 2;
}

.upfp_sign_pdf_pages {
	position: relative;
	width: 100%;
	background: #525659;
}

.upfp_sign_overlay {
	position: absolute;
	border: 2px dashed #2271b1;
	background: rgba(34, 113, 177, 0.08);
	cursor: move;
	touch-action: none;
	box-sizing: border-box;
}
.upfp_sign_overlay img {
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}
#upfp_sign_overlay_resize {
	position: absolute;
	right: -7px;
	bottom: -7px;
	width: 16px;
	height: 16px;
	background: #2271b1;
	border: 2px solid #fff;
	border-radius: 50%;
	cursor: nwse-resize;
	touch-action: none;
}

.upfp_sign_mode_err {
	flex: 1 1 100%;
	order: 3;
	margin: 0;
	padding: 0;
}
#upfp_sign_place_cancel,
#upfp_sign_place_save {
	cursor: pointer;
	display: inline-block;
	padding: 9px 20px;
	font-weight: 600;
	font-size: 13px;
	line-height: 1;
	text-decoration: none;
}
#upfp_sign_place_cancel {
	background: transparent;
	border: 1px solid #ccc;
	color: var(--secondary-color, #555);
}
#upfp_sign_place_cancel:hover {
	background: #f2f2f2;
}
#upfp_sign_place_save {
	background: var(--primary-color);
	border: 1px solid var(--primary-color);
	color: #fff;
}
#upfp_sign_place_save:hover {
	background: var(--hover-color);
}

/* Right sidebar - Signing History */
.upfp_sign_logs_wrapper {
	margin-top: 15px;
}
.upfp_sign_logs_wrapper h4 {
	margin-bottom: 8px;
}
.upfp_sign_logs_list {
	display: flex;
	flex-direction: column;
	gap: 5px;
	background: white;
	padding: 15px;
	height: 300px;
	overflow: auto;
	font-size: 10pt;
}
.upfp_sign_log_row {
	padding: 6px 0;
	border-bottom: 1px solid #eee;
}
.upfp_sign_log_row:last-child {
	border-bottom: none;
}
.upfp_sign_log_meta {
	font-size: 9pt;
	color: var(--secondary-color, #777);
}