/* ─── Full-screen scanning overlay ─── */
.gf-ocr-btb-scan-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999998 !important;
	pointer-events: auto !important;
	visibility: visible !important;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 11, 0.45);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.28s ease;
}

.gf-ocr-btb-scan-overlay--visible {
	opacity: 1;
}

.gf-ocr-btb-scan-overlay--visible .gf-ocr-btb-scan-overlay__panel {
	opacity: 1;
	transform: scale(1) translateY(0);
}

.gf-ocr-btb-scan-overlay__panel {
	position: relative;
	overflow: hidden;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
	padding: 36px 40px;
	min-width: 280px;
	max-width: 90vw;
	text-align: center;
	opacity: 0;
	transform: scale(0.92) translateY(16px);
	transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1), transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.gf-ocr-btb-scan-overlay__ring {
	width: 72px;
	height: 72px;
	margin: 0 auto 20px;
	border-radius: 50%;
	background: conic-gradient(from 0deg, #7c3aed, #a78bfa, #c4b5fd, #7c3aed);
	animation: gf-ocr-btb-spin 0.9s linear infinite;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.gf-ocr-btb-scan-overlay__ring-inner {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #fff;
}

.gf-ocr-btb-scan-overlay__title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	color: #18181b;
	font-family: "Inter", system-ui, sans-serif;
}

.gf-ocr-btb-scan-overlay__hint {
	margin: 0 0 16px;
	font-size: 13px;
	color: #71717a;
	font-family: "Inter", system-ui, sans-serif;
}

.gf-ocr-btb-scan-overlay__dots {
	display: flex;
	justify-content: center;
	gap: 6px;
}

.gf-ocr-btb-scan-overlay__dots span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #7c3aed;
	animation: gf-ocr-btb-dot 1.2s ease-in-out infinite;
}

.gf-ocr-btb-scan-overlay__dots span:nth-child(2) {
	animation-delay: 0.15s;
}

.gf-ocr-btb-scan-overlay__dots span:nth-child(3) {
	animation-delay: 0.3s;
}

.gf-ocr-btb-scan-overlay__scanline {
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.7), transparent);
	top: 0;
	animation: gf-ocr-btb-scanline 2s ease-in-out infinite;
	pointer-events: none;
}

.gfield.gf-ocr-btb-scanning-field .gpfup,
.gfield.gf-ocr-btb-scanning-field .gform_fileupload_multifile,
.gfield.gf-ocr-btb-scanning-field .ginput_container_fileupload {
	box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.35);
	border-radius: 10px;
	transition: box-shadow 0.25s ease;
}

/* ─── Error popup ─── */
.gf-ocr-btb-modal {
	position: fixed;
	inset: 0;
	z-index: 9999999 !important;
	pointer-events: auto !important;
	visibility: visible !important;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.gf-ocr-btb-modal--visible {
	opacity: 1 !important;
	visibility: visible !important;
	display: flex !important;
}

.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__backdrop {
	opacity: 1 !important;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__box {
	opacity: 1 !important;
	transform: scale(1) translateY(0) !important;
}

.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__icon span,
.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__title,
.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__text,
.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__status,
.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__matches-wrap,
.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__btn {
	opacity: 1 !important;
	transform: none;
}

.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__icon span {
	animation: gf-ocr-btb-icon-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__title {
	animation: gf-ocr-btb-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.16s forwards;
}

.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__text {
	animation: gf-ocr-btb-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards;
}

.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__matches-wrap {
	animation: gf-ocr-btb-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.28s forwards;
}

.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__btn {
	animation: gf-ocr-btb-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.36s forwards;
}

.gf-ocr-btb-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 15, 18, 0.62);
	opacity: 0;
	backdrop-filter: blur(0);
	-webkit-backdrop-filter: blur(0);
	transition: opacity 0.35s ease, backdrop-filter 0.35s ease, -webkit-backdrop-filter 0.35s ease;
}

.gf-ocr-btb-modal__box {
	position: relative;
	z-index: 1;
	background: #ffffff;
	border-radius: 20px;
	box-shadow:
		0 0 0 1px rgba(185, 28, 28, 0.08),
		0 24px 64px rgba(0, 0, 0, 0.22),
		0 8px 24px rgba(185, 28, 28, 0.08);
	max-width: 460px;
	width: 100%;
	padding: 32px 28px 26px;
	text-align: center;
	font-family: "Inter", system-ui, -apple-system, sans-serif;
	opacity: 0;
	transform: scale(0.9) translateY(28px);
	transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1), transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.gf-ocr-btb-modal--visible .gf-ocr-btb-modal__status {
	animation: gf-ocr-btb-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

.gf-ocr-btb-modal__status {
	display: inline-block;
	margin: 0 0 12px;
	padding: 6px 14px;
	border-radius: 999px;
	background: #991b1b;
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	box-shadow: 0 4px 12px rgba(153, 27, 27, 0.35);
}

.gf-ocr-btb-modal__icon {
	width: 60px;
	height: 60px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
	border: 2px solid #fecaca;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gf-ocr-btb-modal__icon span {
	display: block;
	color: #b91c1c;
	font-size: 28px;
	font-weight: 800;
	line-height: 1;
}

.gf-ocr-btb-modal__title {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	color: #991b1b;
	letter-spacing: -0.02em;
}

.gf-ocr-btb-modal__text {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.55;
	color: #52525b;
	text-align: center;
}

.gf-ocr-btb-modal__matches-wrap {
	margin: 0 0 24px;
	text-align: left;
}

.gf-ocr-btb-modal__matches-heading {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #71717a;
}

.gf-ocr-btb-modal__matches {
	margin: 0;
	padding: 0;
	list-style: none;
	background: linear-gradient(180deg, #fff5f5 0%, #fef2f2 100%);
	border: 1px solid #fecaca;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.gf-ocr-btb-modal__matches li {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 14px 16px;
	border-bottom: 1px solid #fee2e2;
	animation: gf-ocr-btb-match-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.gf-ocr-btb-modal__matches li:last-child {
	border-bottom: none;
}

.gf-ocr-btb-modal__match-icon {
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #b91c1c;
	color: #fff;
	font-size: 13px;
	line-height: 24px;
	text-align: center;
	font-weight: 800;
	box-shadow: 0 2px 6px rgba(185, 28, 28, 0.35);
}

.gf-ocr-btb-modal__match-word {
	flex: 1;
	font-size: 18px;
	font-weight: 700;
	color: #991b1b;
	word-break: break-word;
	letter-spacing: -0.01em;
	padding: 4px 10px;
	background: #ffffff;
	border: 1px solid #fecaca;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(185, 28, 28, 0.08);
}

.gf-ocr-btb-modal__btn {
	background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
	color: #fff;
	border: none;
	border-radius: 12px;
	padding: 13px 40px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(185, 28, 28, 0.28);
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.gf-ocr-btb-modal__btn:hover {
	background: linear-gradient(180deg, #b91c1c 0%, #991b1b 100%);
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(185, 28, 28, 0.34);
}

.gf-ocr-btb-modal__btn:focus-visible {
	outline: 2px solid #b91c1c;
	outline-offset: 3px;
}

.gfield.gf-ocr-btb-blocked .ginput_container_fileupload,
.gfield.gf-ocr-btb-blocked .gpfup,
.gfield.gf-ocr-btb-blocked .gform_fileupload_multifile {
	outline: 2px solid #b91c1c;
	outline-offset: 2px;
	border-radius: 10px;
}

.gpfup,
.gpfup__droparea,
.gform_fileupload_multifile {
	position: relative;
}

@keyframes gf-ocr-btb-spin {
	to { transform: rotate(360deg); }
}

@keyframes gf-ocr-btb-dot {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40% { transform: scale(1); opacity: 1; }
}

@keyframes gf-ocr-btb-scanline {
	0% { top: 0; opacity: 0; }
	15% { opacity: 1; }
	85% { opacity: 1; }
	100% { top: 100%; opacity: 0; }
}

@keyframes gf-ocr-btb-panel-in {
	from { transform: scale(0.92) translateY(14px); opacity: 0; }
	to { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes gf-ocr-btb-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes gf-ocr-btb-icon-pop {
	0% { transform: scale(0.4); opacity: 0; }
	60% { transform: scale(1.08); opacity: 1; }
	100% { transform: scale(1); opacity: 1; }
}

@keyframes gf-ocr-btb-fade-up {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes gf-ocr-btb-match-in {
	from { opacity: 0; transform: translateY(8px) scale(0.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
