/**
 * Stili frontend del modulo persone–enti.
 *
 * Il file viene caricato soltanto nel tab Enti e nei relativi flussi. Le regole
 * migliorano la gerarchia visiva mantenendo colori ereditati dal tema, focus
 * visibili e controlli utilizzabili anche da tastiera.
 */
.tspe-form-box {
	border: 2px solid currentColor;
	border-radius: .5rem;
	padding: 1rem;
	background: rgba(127, 127, 127, .08);
}

.tspe-form-box > legend {
	float: none;
	width: auto;
	padding: 0 .4rem;
	margin: 0 0 .5rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.tspe-new-entity-callout {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem;
	border: 2px solid currentColor;
	border-inline-start-width: .45rem;
	border-radius: .5rem;
	background: rgba(127, 127, 127, .12);
	box-shadow: 0 .2rem .7rem rgba(0, 0, 0, .12);
}

.tspe-new-entity-callout__content {
	min-width: 0;
}

.tspe-new-entity-callout__button {
	flex: 0 0 auto;
	font-weight: 700;
	white-space: nowrap;
}

.tspe-entity-update-action {
	font-weight: 700;
	box-shadow: 0 .15rem .45rem rgba(0, 0, 0, .16);
}

.tspe-entity-update-action:focus-visible,
.tspe-new-entity-callout__button:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.tspe-profile-sections-overview-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: .65rem;
}

.tspe-profile-section-link,
.tspe-profile-section-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	border: 1px solid currentColor;
	border-radius: .4rem;
	padding: .75rem 1rem;
	text-decoration: none;
}

.tspe-profile-section-link:hover,
.tspe-profile-section-link:focus-visible,
.tspe-profile-section-summary:hover,
.tspe-profile-section-summary:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.tspe-profile-section {
	border: 1px solid rgba(127, 127, 127, .65);
	border-radius: .5rem;
	overflow: clip;
	scroll-margin-top: 7rem;
}

.tspe-profile-section-summary {
	cursor: pointer;
	font-weight: 700;
	border: 0;
	border-radius: 0;
	background: rgba(127, 127, 127, .12);
}

.tspe-profile-section-count {
	display: inline-flex;
	min-width: 2rem;
	min-height: 2rem;
	align-items: center;
	justify-content: center;
	padding: .15rem .45rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-weight: 700;
}

.tspe-profile-section-content {
	padding: 1rem;
}

.tspe-parent-search-results {
	display: grid;
	gap: .5rem;
	margin-top: .5rem;
}

.tspe-parent-search-result {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	width: 100%;
	text-align: left;
	padding: .7rem;
	border: 1px solid currentColor;
	border-radius: .35rem;
	background: rgba(127, 127, 127, .12);
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.tspe-parent-search-result:hover,
.tspe-parent-search-result:focus-visible {
	background: rgba(127, 127, 127, .24);
	color: inherit;
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.tspe-parent-search-result > span:first-child {
	min-width: 0;
	overflow-wrap: anywhere;
}

.tspe-parent-search-result > span:last-child {
	flex: 0 0 auto;
	font-weight: 700;
	text-decoration: underline;
}

.tspe-parent-selected {
	padding: .65rem;
	border-left: 4px solid currentColor;
}

@media (max-width: 767px) {
	.tspe-new-entity-callout {
		align-items: stretch;
		flex-direction: column;
	}

	.tspe-new-entity-callout__button {
		width: 100%;
		white-space: normal;
	}
}


.tspe-profile-sections-overview {
	width: 100%;
}

.tspe-profile-sections-overview-grid {
	margin: 0;
}

.tspe-profile-admin-note {
	max-width: 52rem;
	white-space: normal;
}

[data-tspe-entity-type-custom-field][hidden] {
	display: none !important;
}

/* Messaggi di validazione frontend accessibili e visibili anche nei temi scuri. */
.tspe-validation-summary {
	margin-bottom: 1rem;
}

.tspe-field-error {
	margin-top: .35rem;
	font-weight: 600;
}

.tspe-profile-update-request-fields {
	display: grid;
	gap: .65rem;
	margin-top: .75rem;
}

.tspe-profile-update-request-field {
	padding: .65rem;
	border: 1px solid rgba(127, 127, 127, .55);
	border-radius: .35rem;
}

.tspe-profile-update-request-field dl {
	margin: 0;
}

.tspe-profile-update-request-field dt,
.tspe-profile-update-request-field dd {
	margin: 0;
}

.tspe-profile-update-request-field dd + dt {
	margin-top: .4rem;
}

[data-tspe-own-fiscal-field][hidden],
[data-tspe-no-fiscal-reason-section][hidden] {
	display: none !important;
}

/*
 * Richiesta aggiornamento anagrafica ente.
 * I blocchi separano chiaramente valore attuale, proposta e motivazione.
 */
.tspe-entity-update-fields {
	display: grid;
	gap: 1rem;
}

.tspe-entity-update-field {
	margin: 0;
	padding: 1rem;
	border: 1px solid currentColor;
	border-radius: .5rem;
}

.tspe-entity-update-field.is-changed {
	box-shadow: 0 0 0 2px rgba(13, 110, 253, .3);
}

.tspe-entity-update-changed-label[hidden] {
	display: none !important;
}

.tspe-entity-update-current {
	padding: .75rem;
	border-inline-start: .25rem solid currentColor;
	background: rgba(127, 127, 127, .08);
}

.tspe-entity-update-readonly {
	padding: 1rem;
	border: 1px dashed currentColor;
	border-radius: .5rem;
}


/* Scheda completa dell'ente nel profilo della persona collegata. */
.tspe-profile-entity-sheet {
	border: 1px solid rgba(127, 127, 127, .65);
	border-radius: .5rem;
	overflow: hidden;
}

.tspe-profile-entity-sheet__summary,
.tspe-profile-entity-sheet__subsection > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	padding: .75rem 1rem;
	font-weight: 700;
	cursor: pointer;
	background: rgba(127, 127, 127, .12);
}

.tspe-profile-entity-sheet__summary:hover,
.tspe-profile-entity-sheet__summary:focus-visible,
.tspe-profile-entity-sheet__subsection > summary:hover,
.tspe-profile-entity-sheet__subsection > summary:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.tspe-profile-entity-sheet__content {
	padding: 1rem;
}

.tspe-profile-entity-sheet__definition-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: .65rem;
	margin: 0;
}

.tspe-profile-entity-sheet__definition-row {
	padding: .65rem;
	border: 1px solid rgba(127, 127, 127, .45);
	border-radius: .35rem;
	min-width: 0;
}

.tspe-profile-entity-sheet__definition-row dt {
	font-weight: 700;
}

.tspe-profile-entity-sheet__definition-row dd {
	margin: .25rem 0 0;
	overflow-wrap: anywhere;
}

.tspe-profile-entity-sheet__subsection {
	border: 1px solid rgba(127, 127, 127, .45);
	border-radius: .35rem;
	overflow: hidden;
}

.tspe-profile-entity-sheet__table-wrap {
	overflow-x: auto;
	padding: .75rem;
}

.tspe-profile-entity-sheet__table-wrap table {
	min-width: 42rem;
	color: inherit;
}

.tspe-profile-entity-sheet__table-wrap th,
.tspe-profile-entity-sheet__table-wrap td {
	color: inherit;
	background: transparent;
	vertical-align: top;
}


/* Cantiere 17 - switch ad alto contrasto su fondo scuro. */
.tspe-vp-switch .form-check-input,
.tspe-volunteer-profile-wizard .form-switch .form-check-input {
	min-width: 2.75rem;
	height: 1.45rem;
	border: 2px solid rgba(255, 255, 255, .88);
	background-color: #343a40;
	background-image: var(--bs-form-switch-bg);
	box-shadow: none;
}
.tspe-vp-switch .form-check-input:checked,
.tspe-volunteer-profile-wizard .form-switch .form-check-input:checked {
	background-color: var(--bs-success, #198754);
	border-color: #fff;
}
.tspe-vp-switch .form-check-input:focus-visible,
.tspe-volunteer-profile-wizard .form-switch .form-check-input:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}
.tspe-vp-entity-tools {
	border-block: 1px solid rgba(255,255,255,.28);
	padding-block: 1rem;
}


/* Cantiere 17 - affinamento UX 10/09/2026: separazione netta tra switch e testo. */
.tspe-vp-switch {
	display: grid;
	grid-template-columns: 3rem minmax(0, 1fr);
	column-gap: .85rem;
	align-items: center;
	padding-left: 0;
}
.tspe-vp-switch .form-check-input {
	float: none;
	margin: 0;
	justify-self: start;
}
.tspe-vp-switch .form-check-label {
	margin: 0;
	line-height: 1.35;
	cursor: pointer;
}
.tspe-vp-switch .form-text {
	grid-column: 2;
	margin-top: .25rem;
}
.tspe-role-change-request > details > summary.btn {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	border-width: 2px;
}
.tspe-role-change-request > details > summary.btn:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}
.tspe-vp-entity-context {
	border: 1px solid rgba(255,255,255,.35);
	padding: 1rem;
}
