/* Fill form (spec 14): pdf.js's form layer over the shared workspace pages */
.fill-loading { text-align: center; color: var(--text-secondary); margin-top: var(--sp-3); }
.fill-message { max-width: 40rem; margin: var(--sp-3) auto 0; padding: var(--sp-3) var(--sp-4); border-radius: 10px; background: var(--color-info-dim); font-size: var(--text-sm); }
.fill-message[hidden] { display: none; }
.fill-app { max-width: 1200px; margin: 0 auto var(--sp-6); padding: 0 var(--sp-4); }
.fill-app[hidden] { display: none; }
.fill-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.fill-count { font-weight: 600; margin: 0; }
.fill-target { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--text-secondary); }
.fill-target select { font: inherit; font-size: var(--text-sm); color: var(--text-primary); background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 6px; padding: .3rem .45rem; }
.fill-hint { font-size: var(--text-sm); color: var(--text-secondary); }
.fill-body { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.fill-thumbs { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.fill-pages-wrap { min-width: 0; }
.fill-pages { display: flex; flex-direction: column; align-items: center; gap: var(--sp-5); padding: var(--sp-4) 0; }
.fill-pager { display: none; }
.fill-save { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.fill-flatten { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); }

/* The parts of pdf.js's annotation layer CSS that form fields need (pdf_viewer.css is not vendored) */
.annotationLayer { position: absolute; top: 0; left: 0; pointer-events: none; transform-origin: 0 0; z-index: 1; }
/* pdf.js marks the layer with the page's /Rotate; the fields turn with the page */
.annotationLayer[data-main-rotation="90"] { transform: rotate(90deg) translateY(-100%); }
.annotationLayer[data-main-rotation="180"] { transform: rotate(180deg) translate(-100%, -100%); }
.annotationLayer[data-main-rotation="270"] { transform: rotate(270deg) translateX(-100%); }
.annotationLayer section { position: absolute; text-align: initial; pointer-events: auto; box-sizing: border-box; transform-origin: 0 0; }
.annotationLayer .linkAnnotation > a { position: absolute; inset: 0; }
.annotationLayer :is(.textWidgetAnnotation, .choiceWidgetAnnotation, .buttonWidgetAnnotation) :is(input, textarea, select) {
	position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; box-sizing: border-box;
	background: rgba(0, 54, 255, .13); border: 2px solid transparent; border-radius: 2px;
	font: calc(9px * var(--scale-factor)) sans-serif; color: #000; padding: 0 3px;
}
.annotationLayer .textWidgetAnnotation textarea { resize: none; padding: 2px 3px; }
.annotationLayer .choiceWidgetAnnotation select option { padding: 0; }
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input { appearance: none; -webkit-appearance: none; }
.annotationLayer .buttonWidgetAnnotation.radioButton input { border-radius: 50%; }
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {
	content: ''; position: absolute; left: 45%; height: 80%; top: 10%; width: 1px; background: #000;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before { transform: rotate(45deg); }
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after { transform: rotate(-45deg); }
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {
	content: ''; position: absolute; left: 30%; top: 30%; width: 40%; height: 40%; border-radius: 50%; background: #000;
}
.annotationLayer :is(input, textarea, select):focus { outline: none; border-color: #0d3fbf; background: rgba(0, 54, 255, .06); }
.annotationLayer :is(input, textarea, select):disabled { background: none; border-color: transparent; cursor: not-allowed; }
.annotationLayer .popupTriggerArea, .annotationLayer .popup { display: none; }

@media (max-width: 900px) {
	.fill-body { grid-template-columns: minmax(0, 1fr); }
	.fill-thumbs { display: none; }
	.fill-pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin-bottom: var(--sp-2); font-size: var(--text-sm); }
}
