/*
Table of contents:
1. Global smart field focus & transitions
2. GPS & location fields
3. Datalist lookup spinners
4. Scanner overlay & targeting grid
5. OCR review surface
6. Lookup badge & result chips
*/

/* ─────────────────────────────────────────────
   1. Global smart field focus & transitions
───────────────────────────────────────────── */
.ffos-smart-field {
	width: 100%;
	min-height: 50px;
	padding: 13px 15px;
	border: 1.5px solid rgba(15, 23, 42, 0.15);
	border-radius: 14px;
	background: #ffffff;
	color: #0f172a;
	font: inherit;
	font-size: 15px;
	transition:
		border-color 0.22s,
		box-shadow 0.22s,
		background 0.22s,
		transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
	-webkit-appearance: none;
	appearance: none;
}
.ffos-smart-field:hover { border-color: rgba(15, 23, 42, 0.28); }
.ffos-smart-field:focus {
	outline: none;
	border-color: #635bff;
	background: #ffffff;
	box-shadow:
		0 0 0 4px rgba(99, 91, 255, 0.14),
		0 0 0 1px rgba(99, 91, 255, 0.4),
		0 8px 24px rgba(99, 91, 255, 0.10);
	transform: translateY(-1px);
}

/* ─────────────────────────────────────────────
   2. GPS & location fields
───────────────────────────────────────────── */
.ffos-gps-wrapper {
	display: flex;
	gap: 10px;
	align-items: stretch;
	flex-wrap: wrap;
}
.ffos-gps-wrapper .ffos-smart-field { flex: 1 1 200px; }
.ffos-gps-trigger {
	flex-shrink: 0;
	min-height: 50px;
	padding: 0 18px;
	border: 1.5px solid rgba(99, 91, 255, 0.28);
	border-radius: 14px;
	background: rgba(99, 91, 255, 0.07);
	color: #635bff;
	cursor: pointer;
	font: 600 0.92rem / 1 inherit;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: background 0.15s, border-color 0.15s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s;
}
.ffos-gps-trigger:hover {
	background: rgba(99, 91, 255, 0.13);
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(99, 91, 255, 0.22);
}
.ffos-gps-trigger:active { transform: scale(0.97); }

/* ─────────────────────────────────────────────
   3. Datalist lookup spinners
───────────────────────────────────────────── */
.ffos-lookup-wrapper {
	position: relative;
}
.ffos-lookup-spinner {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(99, 91, 255, 0.2);
	border-top-color: #635bff;
	border-radius: 50%;
	animation: ffos-spin 0.65s linear infinite;
	display: none;
	pointer-events: none;
}
.ffos-lookup-wrapper.is-loading .ffos-lookup-spinner { display: block; }
.ffos-lookup-wrapper.is-loading .ffos-smart-field { padding-right: 42px; }
@keyframes ffos-spin { to { transform: translateY(-50%) rotate(360deg); } }

/* Result chips */
.ffos-lookup-result-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(99, 91, 255, 0.08);
	border: 1px solid rgba(99, 91, 255, 0.2);
	border-radius: 999px;
	color: #4f46e5;
	font-size: 12.5px;
	font-weight: 600;
	padding: 5px 12px;
	margin: 3px;
	transition: background 0.15s, border-color 0.15s;
}
.ffos-lookup-result-chip:hover { background: rgba(99, 91, 255, 0.14); }

/* ─────────────────────────────────────────────
   4. Scanner overlay & targeting grid
───────────────────────────────────────────── */
.ffos-scanner-container {
	position: relative;
	width: 100%;
	max-width: 480px;
	height: 320px;
	background: #000;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}
.ffos-scanner-grid {
	position: absolute;
	top: 10%;
	left: 10%;
	width: 80%;
	height: 80%;
	/* Corner bracket corners instead of a full dashed box */
	border: none;
	pointer-events: none;
}
/* Corner brackets — pure CSS */
.ffos-scanner-grid::before,
.ffos-scanner-grid::after {
	content: '';
	position: absolute;
	width: 28px;
	height: 28px;
	border-color: rgba(255, 255, 255, 0.9);
	border-style: solid;
}
.ffos-scanner-grid::before { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 3px 0 0 0; }
.ffos-scanner-grid::after  { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 3px 0; }

/* Animated laser line */
.ffos-scanner-laser {
	position: absolute;
	left: 10%;
	width: 80%;
	height: 2px;
	background: linear-gradient(90deg, transparent, #ff3b30, transparent);
	box-shadow: 0 0 10px #ff3b30, 0 0 20px rgba(255, 59, 48, 0.4);
	animation: ffos-scan-line 2.4s ease-in-out infinite;
	pointer-events: none;
}
@keyframes ffos-scan-line {
	0%, 100% { top: 10%; }
	50%       { top: 90%; }
}

/* ─────────────────────────────────────────────
   5. OCR review surface
───────────────────────────────────────────── */
.ffos-ocr-review-surface {
	background: #f8fafc;
	border: 1.5px dashed rgba(15, 23, 42, 0.16);
	border-radius: 14px;
	padding: 14px;
	display: grid;
	gap: 10px;
}
.ffos-ocr-confidence-bar {
	height: 4px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
}
.ffos-ocr-confidence-fill {
	height: 100%;
	background: linear-gradient(90deg, #10b981, #059669);
	border-radius: 999px;
	transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

/* ─────────────────────────────────────────────
   6. Lookup badge & result chips
───────────────────────────────────────────── */
.ffos-lookup-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: linear-gradient(135deg, #ecfdf5, #d1fae5);
	border: 1px solid #6ee7b7;
	border-radius: 999px;
	color: #065f46;
	font-size: 11.5px;
	font-weight: 700;
	padding: 4px 10px;
}
