/**
 * Notai Bergamo — Stili frontend (solo layout e struttura, nessuna sovrascrittura del tema)
 */

/* === Layout generale === */
.notai-bg-wrap {
	max-width: 960px;
	margin: 0 auto;
}

/* === Form ricerca === */
.notai-bg-form {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	margin-bottom: 24px;
	padding: 20px;
}

.notai-bg-form .notai-bg-field {
	display: flex;
	flex-direction: column;
	flex: 1 1 150px;
	min-width: 0;
}

.notai-bg-form .notai-bg-field label {
	margin-bottom: 4px;
}

/* === Tabella risultati === */
.notai-bg-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
}

.notai-bg-table th,
.notai-bg-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid #dee2e6;
}

.notai-bg-table tr:hover {
	cursor: pointer;
}

.notai-bg-table th.notai-bg-sortable {
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

.notai-bg-table th.notai-bg-sortable:hover {
	opacity: 0.7;
}

.notai-bg-sort-arrow {
	margin-left: 4px;
	font-size: 0.75em;
	opacity: 0.4;
}

.notai-bg-sortable.attivo .notai-bg-sort-arrow {
	opacity: 1;
}

/* === Dettaglio fallimento === */
.notai-bg-dettaglio {
	display: none;
	padding: 20px;
	margin-bottom: 24px;
}

.notai-bg-dettaglio.attivo {
	display: block;
}

.notai-bg-dettaglio h3 {
	margin: 20px 0 10px;
	padding-bottom: 6px;
}

.notai-bg-dettaglio h3:first-child {
	margin-top: 0;
}

.notai-bg-dettaglio dl {
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: 6px 12px;
	margin: 0;
}

.notai-bg-dettaglio dd {
	margin: 0;
}

/* === Paginazione === */
.notai-bg-paginazione {
	display: flex;
	gap: 6px;
	justify-content: center;
	margin: 20px 0;
}

.notai-bg-paginazione button.attivo {
	font-weight: 700;
}

.notai-bg-paginazione button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* === Form modifica profilo === */
.notai-bg-profilo-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	padding: 20px;
}

.notai-bg-profilo-form .notai-bg-field {
	display: flex;
	flex-direction: column;
}

.notai-bg-profilo-form .notai-bg-field.full-width {
	grid-column: 1 / -1;
}

.notai-bg-profilo-form .notai-bg-field label {
	margin-bottom: 4px;
}

.notai-bg-profilo-form .notai-bg-sezione {
	grid-column: 1 / -1;
	margin: 10px 0 0;
	padding-bottom: 4px;
}

.notai-bg-profilo-form .notai-bg-sezione:first-child {
	margin-top: 0;
}

.notai-bg-profilo-form .notai-bg-checkbox-group {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.notai-bg-profilo-form .notai-bg-checkbox-group label {
	font-weight: 400;
	display: flex;
	align-items: center;
	gap: 4px;
}

.notai-bg-profilo-actions {
	grid-column: 1 / -1;
	display: flex;
	gap: 12px;
	align-items: center;
}

/* === Feedback === */
.notai-bg-feedback {
	padding: 8px 12px;
	border-radius: 4px;
	display: none;
}

.notai-bg-feedback.successo {
	display: block;
	background: #d1e7dd;
	color: #0f5132;
	border: 1px solid #badbcc;
}

.notai-bg-feedback.errore {
	display: block;
	background: #f8d7da;
	color: #842029;
	border: 1px solid #f5c2c7;
}

/* === Mappa notai === */
.notai-bg-mappa-wrap {
	display: flex;
	gap: 20px;
	margin-top: 20px;
}

.notai-bg-lista-notai {
	flex: 0 0 50%;
	max-height: 500px;
	overflow-y: auto;
	overflow-x: hidden;
}

.notai-bg-mappa-container {
	flex: 1;
	height: 500px;
}

.notai-bg-card-notaio {
	padding: 12px 16px;
	border-bottom: 1px solid #eee;
}

.notai-bg-card-notaio:last-child {
	border-bottom: none;
}

.notai-bg-card-notaio .dettagli {
	margin-top: 4px;
	line-height: 1.5;
	overflow-wrap: break-word;
}

.notai-bg-filtri-mappa {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: flex-end;
	margin-bottom: 16px;
}

.notai-bg-filtri-mappa input,
.notai-bg-filtri-mappa select {
	flex: 1 1 200px;
}

.notai-bg-nessun-risultato {
	padding: 20px;
	text-align: center;
}

/* === Accesso negato === */
.notai-bg-accesso-negato {
	text-align: center;
	padding: 40px 20px;
}

/* === Login === */
.notai-bg-login-wrap {
	max-width: 400px;
	margin: 0 auto;
	padding: 30px;
}

.notai-bg-login-wrap .login-remember {
	margin-bottom: 14px;
}

.notai-bg-login-lost {
	text-align: center;
	margin-top: 14px;
}

.notai-bg-login-ok {
	text-align: center;
	padding: 30px 20px;
}

.notai-bg-login-wrap .notai-bg-feedback {
	margin-bottom: 16px;
}

/* === Loading === */
.notai-bg-loading {
	text-align: center;
	padding: 20px;
}

.notai-bg-caricamento {
	position: relative;
	pointer-events: none;
}

.notai-bg-caricamento::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.65);
	z-index: 10;
}

.notai-bg-caricamento::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 32px;
	height: 32px;
	margin: -16px 0 0 -16px;
	border: 3px solid #dee2e6;
	border-top-color: #0d6efd;
	border-radius: 50%;
	animation: notaiBgSpin 0.6s linear infinite;
	z-index: 11;
}

@keyframes notaiBgSpin {
	to { transform: rotate(360deg); }
}

/* === Mappa profilo (geocoding) === */
.notai-bg-mappa-profilo {
	height: 350px;
	border-radius: 4px;
	border: 1px solid #dee2e6;
	margin-top: 8px;
}

.notai-bg-geocode-row {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
}

.notai-bg-geocode-btn {
	white-space: nowrap;
}

.notai-bg-geocode-status {
	font-size: 0.9em;
}

.notai-bg-geocode-status.successo {
	color: #0f5132;
}

.notai-bg-geocode-status.errore {
	color: #842029;
}

.notai-bg-mappa-hint {
	margin: 6px 0 0;
	font-size: 0.85em;
	opacity: 0.7;
}

/* === Admin credenziali === */
.notai-bg-progress {
	width: 100%;
	height: 24px;
	background: #e9ecef;
	border-radius: 4px;
	overflow: hidden;
	margin: 12px 0;
	display: none;
}

.notai-bg-progress-bar {
	height: 100%;
	background: #0d6efd;
	transition: width 0.3s;
	line-height: 24px;
	text-align: center;
	color: #fff;
	font-size: 12px;
}

.notai-bg-log {
	max-height: 300px;
	overflow-y: auto;
	background: #1e1e1e;
	color: #d4d4d4;
	font-family: monospace;
	font-size: 12px;
	padding: 12px;
	border-radius: 4px;
	margin-top: 12px;
	display: none;
}

/* === Responsive === */
@media (max-width: 768px) {
	.notai-bg-form {
		flex-direction: column;
	}

	.notai-bg-profilo-form {
		grid-template-columns: 1fr;
	}

	.notai-bg-mappa-wrap {
		flex-direction: column;
	}

	.notai-bg-lista-notai {
		flex: none;
		max-height: 300px;
	}

	.notai-bg-mappa-container {
		flex: none;
		height: 350px;
	}

	.notai-bg-mappa-profilo {
		height: 250px;
	}

	.notai-bg-dettaglio dl {
		grid-template-columns: 1fr;
	}
}
