/* Timeline di lavorazione e badge nello spazio cliente. */

.pcr-egest-tracking {
	margin: 0 0 2em;
	padding: 1.25em 1.25em 1em;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	background: #fafafa;
}

.pcr-egest-tracking h2 {
	font-size: 1.15em;
	margin: 0 0 1.25em;
}

.pcr-egest-steps {
	display: flex;
	list-style: none;
	margin: 0 0 0.75em;
	padding: 0;
}

.pcr-egest-steps li {
	flex: 1;
	position: relative;
	text-align: center;
	padding: 0 4px;
	margin: 0;
}

/* Colore per stato: la stessa palette dei badge, cosi' la timeline si legge
   a colori come la colonna "Lavorazione". Il valore di partenza vale per gli
   stati aggiunti via filtro pcr_egest_states, che non hanno un colore proprio.
   Le regole per stato qualificano il tag li per stare sopra al default nella
   specificita', altrimenti il default vincerebbe. */
.pcr-egest-steps li,
.pcr-egest-mini li {
	--pcr-egest-dot: #2e7d32;
	--pcr-egest-halo: rgba(46, 125, 50, 0.15);
}

.pcr-egest-steps li.pcr-egest-step--da_lavorare,
.pcr-egest-mini li.pcr-egest-mini--da_lavorare {
	--pcr-egest-dot: #546e7a;
	--pcr-egest-halo: rgba(84, 110, 122, 0.15);
}

.pcr-egest-steps li.pcr-egest-step--in_lavorazione,
.pcr-egest-mini li.pcr-egest-mini--in_lavorazione {
	--pcr-egest-dot: #1d5d90;
	--pcr-egest-halo: rgba(29, 93, 144, 0.15);
}

.pcr-egest-steps li.pcr-egest-step--testato,
.pcr-egest-mini li.pcr-egest-mini--testato {
	--pcr-egest-dot: #00695c;
	--pcr-egest-halo: rgba(0, 105, 92, 0.15);
}

.pcr-egest-steps li.pcr-egest-step--imballato,
.pcr-egest-mini li.pcr-egest-mini--imballato {
	--pcr-egest-dot: #7a5c00;
	--pcr-egest-halo: rgba(122, 92, 0, 0.15);
}

.pcr-egest-steps li.pcr-egest-step--spedito,
.pcr-egest-mini li.pcr-egest-mini--spedito {
	--pcr-egest-dot: #2e7d32;
	--pcr-egest-halo: rgba(46, 125, 50, 0.15);
}

/* Connettore verso il passo precedente. */
.pcr-egest-steps li::before {
	content: '';
	position: absolute;
	top: 10px;
	left: -50%;
	width: 100%;
	height: 3px;
	background: #d5d8dc;
}

.pcr-egest-steps li:first-child::before {
	display: none;
}

.pcr-egest-steps li.is-done::before,
.pcr-egest-steps li.is-current::before {
	background: var(--pcr-egest-dot);
}

.pcr-egest-dot {
	position: relative;
	z-index: 1;
	display: inline-block;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid #d5d8dc;
	box-sizing: border-box;
}

.pcr-egest-steps li.is-done .pcr-egest-dot {
	background: var(--pcr-egest-dot);
	border-color: var(--pcr-egest-dot);
}

.pcr-egest-steps li.is-done .pcr-egest-dot::after {
	content: '\2713';
	position: absolute;
	inset: 0;
	color: #fff;
	font-size: 12px;
	line-height: 16px;
	text-align: center;
}

.pcr-egest-steps li.is-current .pcr-egest-dot {
	border-color: var(--pcr-egest-dot);
	box-shadow: 0 0 0 4px var(--pcr-egest-halo);
}

.pcr-egest-step-label {
	display: block;
	margin-top: 0.5em;
	font-size: 0.85em;
	line-height: 1.3;
	color: #9aa0a6;
}

.pcr-egest-steps li.is-done .pcr-egest-step-label,
.pcr-egest-steps li.is-current .pcr-egest-step-label {
	color: #1d2327;
	font-weight: 600;
}

.pcr-egest-step-date {
	display: block;
	font-size: 0.75em;
	color: #757575;
}

.pcr-egest-desc {
	margin: 0;
	font-size: 0.9em;
	color: #555;
}

/* Sotto i 600px la timeline diventa verticale. */
@media (max-width: 600px) {
	.pcr-egest-steps {
		flex-direction: column;
		gap: 0;
	}

	.pcr-egest-steps li {
		display: grid;
		grid-template-columns: 22px 1fr;
		column-gap: 12px;
		text-align: left;
		padding: 0 0 1.1em;
	}

	.pcr-egest-steps li::before {
		top: -1.1em;
		left: 10px;
		width: 3px;
		height: 1.1em;
	}

	.pcr-egest-step-label {
		margin-top: 2px;
		grid-column: 2;
		grid-row: 1;
	}

	.pcr-egest-dot {
		grid-column: 1;
		grid-row: 1;
	}

	.pcr-egest-step-date {
		grid-column: 2;
	}
}

/* Colonna "Lavorazione" della lista ordini: badge cliccabile + accordion.

   ATTENZIONE: il markup arriva da PCR_Egest_States::steps_html() e
   accordion_html(), condiviso con la lista ordini in amministrazione. Le
   regole qui sotto hanno una copia in assets/css/admin.css, vestita per il
   backend: toccandone una, controllare se va rispecchiata anche la'. */

.pcr-egest-cell {
	display: inline-block;
	text-align: left;
	vertical-align: top;
}

.pcr-egest-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
	cursor: pointer;
	font: inherit;
	color: inherit;
}

.pcr-egest-toggle:hover,
.pcr-egest-toggle:focus {
	background: none;
	box-shadow: none;
}

.pcr-egest-caret {
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #9aa0a6;
	transition: transform 0.15s ease;
}

.pcr-egest-cell.is-open .pcr-egest-caret {
	transform: rotate(180deg);
}

/* Mini-timeline verticale dentro la cella. */
.pcr-egest-mini {
	list-style: none;
	margin: 0.6em 0 0;
	padding: 0;
	font-size: 0.85em;
	line-height: 1.35;
}

.pcr-egest-mini li {
	position: relative;
	margin: 0;
	padding: 0 0 0.7em 20px;
	color: #9aa0a6;
}

/* Connettore verticale tra i pallini. */
.pcr-egest-mini li::before {
	content: '';
	position: absolute;
	top: 12px;
	bottom: -2px;
	left: 5px;
	width: 2px;
	background: #d5d8dc;
}

.pcr-egest-mini li:last-child::before {
	display: none;
}

.pcr-egest-mini li.is-done::before {
	background: var(--pcr-egest-dot);
}

.pcr-egest-mini-dot {
	position: absolute;
	top: 3px;
	left: 0;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #d5d8dc;
	box-sizing: border-box;
}

.pcr-egest-mini li.is-done .pcr-egest-mini-dot,
.pcr-egest-mini li.is-current .pcr-egest-mini-dot {
	background: var(--pcr-egest-dot);
	border-color: var(--pcr-egest-dot);
}

.pcr-egest-mini li.is-done,
.pcr-egest-mini li.is-current {
	color: #1d2327;
}

.pcr-egest-mini li.is-current .pcr-egest-mini-label {
	font-weight: 600;
}

.pcr-egest-mini-date {
	display: block;
	font-size: 0.9em;
	color: #757575;
}

/* Badge nella colonna "Lavorazione" della lista ordini. */
.pcr-egest-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 0.85em;
	font-weight: 600;
	white-space: nowrap;
	background: #ececec;
	color: #444;
}

.pcr-egest-badge--da_lavorare {
	background: #eceff1;
	color: #455a64;
}

.pcr-egest-badge--in_lavorazione {
	background: #e5f0fa;
	color: #1d5d90;
}

.pcr-egest-badge--testato {
	background: #e0f2f1;
	color: #00695c;
}

.pcr-egest-badge--imballato {
	background: #fdf3d7;
	color: #7a5c00;
}

.pcr-egest-badge--spedito {
	background: #e6f4e6;
	color: #2e7d32;
}

/* Documenti dell'ordine (certificazioni pubblicate da eGest). */

.pcr-egest-files {
	margin: 2em 0;
	padding: 1.25em;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	background: #fafafa;
}

.pcr-egest-files h2 {
	font-size: 1.15em;
	margin: 0 0 1em;
}

.pcr-egest-file-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pcr-egest-file-list li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em 1em;
	margin: 0;
	padding: 0.75em 0;
	border-top: 1px solid #ececec;
}

.pcr-egest-file-list li:first-child {
	border-top: 0;
	padding-top: 0;
}

.pcr-egest-file-title {
	flex: 1 1 12em;
	font-weight: 600;
}

.pcr-egest-file-meta {
	flex: 1 1 12em;
	color: #767676;
	font-size: 0.9em;
}

.pcr-egest-file-link {
	flex: 0 0 auto;
	display: inline-block;
	padding: 0.45em 1.1em;
	border-radius: 4px;
	background: #2e7d32;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
}

.pcr-egest-file-link:hover,
.pcr-egest-file-link:focus {
	background: #26682a;
	color: #fff;
}

.pcr-egest-file-note {
	margin: 1em 0 0;
	color: #767676;
	font-size: 0.9em;
}

/* Certificati di qualita': stessa scatola dei documenti, raggruppati per prodotto. */

.pcr-egest-cert-intro {
	margin: 0 0 1em;
	color: #555;
	font-size: 0.9em;
}

.pcr-egest-cert-product {
	margin: 1.25em 0 0.5em;
	font-size: 1em;
}

.pcr-egest-certificates h2 + .pcr-egest-cert-intro + .pcr-egest-cert-product {
	margin-top: 0;
}

.pcr-egest-cert-sku {
	margin-left: 0.4em;
	font-weight: normal;
	font-size: 0.85em;
	color: #767676;
}

.pcr-egest-cert-all {
	margin: 1.25em 0 0;
}

/* Pagina pubblica di verifica di un certificato (shortcode). */

.pcr-egest-verify-form label {
	display: block;
	margin-bottom: 0.25em;
	font-weight: 600;
}

.pcr-egest-verify-form input[type="text"] {
	width: 100%;
	max-width: 26em;
	box-sizing: border-box;
}

.pcr-egest-verify-result {
	margin: 1.5em 0;
	padding: 1em 1.25em;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
}

.pcr-egest-verify-result.is-valid {
	background: #eef8f1;
	border-color: #a9dbb8;
}

.pcr-egest-verify-result.is-revoked {
	background: #fdf6e3;
	border-color: #ecd593;
}

.pcr-egest-verify-result.is-invalid {
	background: #fdf0ef;
	border-color: #f0c4c0;
}

.pcr-egest-verify-title {
	margin: 0 0 0.75em;
	font-weight: 600;
}

.pcr-egest-verify-title:last-child {
	margin-bottom: 0;
}

.pcr-egest-verify-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
}

.pcr-egest-verify-table th,
.pcr-egest-verify-table td {
	padding: 0.35em 0.5em 0.35em 0;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	text-align: left;
	vertical-align: top;
}

.pcr-egest-verify-table th {
	width: 11em;
	font-weight: normal;
	color: #555;
}

.pcr-egest-verify-controls {
	list-style: none;
	margin: 1em 0 0;
	padding: 0;
}

.pcr-egest-verify-controls li {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.25em 1em;
	margin: 0;
	padding: 0.35em 0;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.pcr-egest-verify-outcome {
	color: #1f9a4a;
	font-weight: 600;
}

/* QR di verifica accanto a ogni certificato, nella pagina dell'ordine. */

.pcr-egest-cert-qr {
	flex: 0 0 auto;
	display: inline-flex;
	width: 62px;
	height: 62px;
	padding: 3px;
	border: 1px solid #e3e7ee;
	border-radius: 4px;
	background: #fff;
	line-height: 0;
}

.pcr-egest-cert-qr svg {
	width: 100%;
	height: 100%;
	display: block;
}
