/*
 * Gli aspetti del modulo firma di SpeakOut: Opzioni sito > Petizioni.
 *
 * Valgono solo con le classi del body `pr-firma` e `pr-firma--<aspetto>`, che
 * inc/petizioni.php mette quando SpeakOut ha il «Tema della petizione» su
 * «Personalizzato»: allora SpeakOut non carica il suo foglio e il modulo lo
 * disegniamo noi, dalle classi che SpeakOut stampa per farsi personalizzare e
 * dai nostri contenitori. Nessuna regola dipende da come i suoi script
 * lavorano: se un giorno cambiasse le classi, il modulo perderebbe l'aspetto,
 * non il funzionamento.
 *
 * Il riquadro e' la nostra sezione (campagne, appelli, modulo collegato) quando
 * c'e', altrimenti il contenitore di SpeakOut stesso (lo shortcode scritto nel
 * testo). Dentro le nostre sezioni il contenitore di SpeakOut si scioglie
 * (`display: contents`), cosi' i pezzi sono gli stessi nei due casi:
 *
 *   titolo - accento giallo - conta delle firme - campi - risposta
 *
 * Il riquadro e' una griglia a due colonne. Stretto, ogni pezzo le prende
 * tutte e due e i pezzi vanno uno sotto l'altro; largo almeno 46rem, titolo e
 * conta stanno a sinistra e i campi a destra. La larghezza la misura il
 * riquadro (container query), non lo schermo: una campagna su desktop e un
 * modulo in una colonna stretta si comportano ciascuno secondo il proprio
 * spazio. Fra i pezzi non c'e' row-gap ma margini: le righe vuote della
 * griglia non lasciano buchi.
 *
 * Le regole partono da `body.pr-firma` per vincere su quelle del tema, che
 * stile ai moduli di SpeakOut ne da' gia' in campagne e appelli.
 *
 * Il foglio e' scritto a strati - base, riquadro largo, poi i tre aspetti - e
 * gli strati dopo scavalcano quelli prima anche con selettori meno pesanti:
 * no-descending-specificity qui segnalerebbe proprio l'ordine voluto.
 */

/* stylelint-disable no-descending-specificity */

/* ------------------------------------------------------------ Variabili */

body.pr-firma {
	--prf-titoli: var(--wp--preset--font-family--barlow-condensed, "Barlow Condensed", sans-serif);
	--prf-etichette: var(--wp--preset--font-family--barlow, Barlow, sans-serif);
	--prf-corpo: var(--wp--preset--font-family--inter, Inter, system-ui, sans-serif);
	--prf-giallo: #fcb900;
	--prf-nero: #151515;
	--prf-spazio: 1.25rem;
}

/* A · Manifesto: scheda nera, numero e pulsante gialli. */
body.pr-firma--manifesto {
	--prf-sfondo: #151515;
	--prf-bordo: #151515;
	--prf-testo: #fff;
	--prf-tenue: #d6d6d6;
	--prf-etichetta: #c7c7c7;
	--prf-attenuato: #8f8f8f;
	--prf-campo-sfondo: #222;
	--prf-campo-bordo: #3a3a3a;
	--prf-campo-bordo-facoltativo: #3a3a3a;
	--prf-campo-testo: #fff;
	--prf-pulsante: #fcb900;
	--prf-pulsante-testo: #151515;
	--prf-pulsante-sopra: #ffd24d;
	--prf-pulsante-sopra-testo: #151515;
	--prf-freccia: currentcolor;
	--prf-link: #fcb900;
	--prf-spunta: #fcb900;
	--prf-fuoco: #fcb900;
	--prf-errore: #ff8a80;
	--prf-risposta: #222;
	--prf-barra: #333;
}

/* B · Editoriale: bianco col filo nero, campi sottolineati. */
body.pr-firma--editoriale {
	--prf-sfondo: #fff;
	--prf-bordo: #151515;
	--prf-testo: #151515;
	--prf-tenue: #3d3d3d;
	--prf-etichetta: #151515;
	--prf-attenuato: #6b6b6b;
	--prf-campo-sfondo: transparent;
	--prf-campo-bordo: #151515;
	--prf-campo-bordo-facoltativo: #151515;
	--prf-campo-testo: #151515;
	--prf-pulsante: #151515;
	--prf-pulsante-testo: #fff;
	--prf-pulsante-sopra: #fcb900;
	--prf-pulsante-sopra-testo: #151515;
	--prf-freccia: #fcb900;
	--prf-link: #151515;
	--prf-spunta: #151515;
	--prf-fuoco: #151515;
	--prf-errore: #b3261e;
	--prf-risposta: #f8f7f4;
	--prf-barra: #dedbd4;
}

/* C · Contatore in evidenza: le firme in un pannello giallo. */
body.pr-firma--contatore {
	--prf-sfondo: #fff;
	--prf-bordo: #151515;
	--prf-testo: #151515;
	--prf-tenue: #3d3d3d;
	--prf-etichetta: #151515;
	--prf-attenuato: #6b6b6b;
	--prf-campo-sfondo: #fff;
	--prf-campo-bordo: #151515;
	--prf-campo-bordo-facoltativo: #8a8a8a;
	--prf-campo-testo: #151515;
	--prf-pulsante: #151515;
	--prf-pulsante-testo: #fff;
	--prf-pulsante-sopra: #fcb900;
	--prf-pulsante-sopra-testo: #151515;
	--prf-freccia: #fcb900;
	--prf-link: #151515;
	--prf-spunta: #151515;
	--prf-fuoco: #151515;
	--prf-errore: #b3261e;
	--prf-risposta: #f8f7f4;
	--prf-barra: rgba(21, 21, 21, 0.2);
}

/* ------------------------------------------------------------- Riquadro */

body.pr-firma :is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione),
body.pr-firma .dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *) {
	--prf-pad: clamp(1.375rem, 4vw, 2.5rem);
	background: var(--prf-sfondo);
	border: 1px solid var(--prf-bordo);
	border-radius: 0;
	box-sizing: border-box;
	color: var(--prf-testo);
	column-gap: var(--prf-pad);
	container: prf-riquadro / inline-size;
	display: grid;
	font-family: var(--prf-corpo);
	font-size: 1rem;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	grid-template-rows: auto auto auto 1fr;
	line-height: 1.5;
	max-width: 100%;
	padding: var(--prf-pad);
	row-gap: 0;
	text-align: start;
}

/* Lo shortcode nel testo: il riquadro e' il contenitore di SpeakOut. */
body.pr-firma .dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *) {
	box-shadow: none;
	margin: var(--wp--preset--spacing--50, 2.5rem) 0;
	width: 100% !important;
}

/* Nelle nostre sezioni il contenitore di SpeakOut si scioglie nel riquadro. */
body.pr-firma :is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) :is(.pr-campaign-petition-form, .pr-appello-petition-form, .pr-modulo-petizione-form, .dk-speakout-petition-wrap) {
	display: contents;
}

/*
 * Ogni pezzo prende tutta la larghezza finche' il riquadro e' stretto. Con
 * :where() la regola pesa poco: quelle dei singoli pezzi la scavalcano.
 */
body.pr-firma :where(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) > *,
body.pr-firma :where(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) :where(.pr-campaign-petition-form, .pr-appello-petition-form, .pr-modulo-petizione-form, .dk-speakout-petition-wrap) > *,
body.pr-firma :where(.dk-speakout-petition-wrap) > * {
	box-sizing: border-box;
	grid-column: 1 / -1;
	margin: 0;
	min-width: 0;
}

/* Quello che nel modulo firma non deve vedersi. */
body.pr-firma :is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) .dk-speakout-petition-wrap > :is(h2, h3),
body.pr-firma :is(.pr-campaign-petition, .pr-appello-petition) .dk-speakout-progress-wrap,
body.pr-firma .dk-speakout-petition-wrap :is(.dk-speakout-readme, .dk-speakout-message, .dk-speakout-message-editable, .dk-speakout-share),
body.pr-firma #dk-speakout-windowshade,
body.pr-firma :is(.pr-campaign-petition-form, .pr-appello-petition-form, .pr-modulo-petizione-form, .dk-speakout-petition-wrap) > br,
body.pr-firma .dk-speakout-petition-wrap p:empty,
body.pr-firma :is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) p:empty,
body.pr-firma .dk-speakout-response:empty {
	display: none !important;
}

/* --------------------------------------------------------------- Titolo */

body.pr-firma :is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) > h2,
body.pr-firma .dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *) > :is(h2, h3) {
	color: var(--prf-testo);
	font-family: var(--prf-titoli);
	font-size: clamp(1.875rem, 1.45rem + 1.6vw, 2.5rem);
	font-weight: 800;
	letter-spacing: 0;
	line-height: 0.95;
	margin: 0 0 var(--prf-spazio);
	order: -4;
	padding: 0;
	text-shadow: none;
	text-transform: uppercase;
}

/* L'accento giallo del tema sotto il titolo delle nostre sezioni. */
body.pr-firma :is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) > hr {
	margin-block: calc(var(--prf-spazio) * -0.4) var(--prf-spazio);
	order: -3;
}

/* Il trattino giallo che il tema mette dopo il titolo del modulo collegato. */
body.pr-firma .pr-modulo-petizione > h2::after {
	margin-top: 0.75rem;
}

/* ------------------------------------------------- Conta delle firme */

body.pr-firma :is(.pr-campaign-petition-stats, .pr-appello-petition-stats),
body.pr-firma .dk-speakout-progress-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0 0 var(--prf-spazio);
	order: -2;
}

body.pr-firma :is(.pr-campaign-petition-count, .pr-appello-petition-count),
body.pr-firma .dk-speakout-signature-count {
	align-items: baseline;
	color: var(--prf-tenue);
	display: flex;
	flex-wrap: wrap;
	font-family: var(--prf-etichette);
	font-size: 1rem;
	font-weight: 700;
	gap: 0.25rem 0.625rem;
	line-height: 1.2;
	margin: 0;
}

body.pr-firma :is(.pr-campaign-petition-count, .pr-appello-petition-count) > [data-pr-firme-numero],
body.pr-firma .dk-speakout-signature-count > span {
	color: var(--prf-testo);
	font-family: var(--prf-titoli);
	font-size: clamp(2.75rem, 2.2rem + 2vw, 3.5rem);
	font-weight: 900;
	line-height: 0.9;
}

body.pr-firma :is(.pr-campaign-petition-progress, .pr-appello-petition-progress) {
	background: var(--prf-barra);
	height: 8px;
	margin: 0;
	overflow: hidden;
}

body.pr-firma :is(.pr-campaign-petition-progress, .pr-appello-petition-progress) > span {
	background: var(--prf-giallo);
}

body.pr-firma :is(.pr-campaign-petition-goal, .pr-appello-petition-goal) {
	color: var(--prf-attenuato);
	font-size: 0.875rem;
	margin: 0;
}

/* La barra dell'obiettivo di SpeakOut: «0 [barra] obiettivo». */
body.pr-firma .dk-speakout-count {
	align-items: center;
	color: var(--prf-attenuato);
	display: flex;
	font-size: 0.875rem;
	gap: 0.5rem;
}

body.pr-firma .dk-speakout-progress {
	background: var(--prf-barra);
	height: 8px;
	max-width: 100%;
	overflow: hidden;
}

body.pr-firma .dk-speakout-progressbar {
	background: var(--prf-giallo);
	height: 100%;
	max-width: 100%;
}

/* ---------------------------------------------------------------- Campi */

body.pr-firma .dk-speakout-petition-wrap #dk-speakout-form-wrap {
	margin: 0;
	order: 0;
}

/*
 * Due colonne di campi quando ciascuna puo' avere almeno 11.5rem, mai tre: la
 * colonna minima e' anche il 34% della larghezza. Nessuna container query,
 * cosi' vale dovunque il modulo stia.
 */
body.pr-firma .dk-speakout-petition {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(max(min(100%, 11.5rem), 34%), 1fr));
	margin: 0;
	padding: 0;
}

body.pr-firma :where(.dk-speakout-petition) > *,
body.pr-firma :where(.dk-speakout-petition > div:not([class])) > * {
	box-sizing: border-box;
	grid-column: 1 / -1;
	margin: 0;
	min-width: 0;
}

/* Il contenitore senza classe di Professione e Città: si scioglie. */
body.pr-firma .dk-speakout-petition > div:not([class]) {
	display: contents;
}

body.pr-firma .dk-speakout-petition :is(br, p:empty) {
	display: none;
}

body.pr-firma .dk-speakout-petition :is(.dk-speakout-full, .dk-speakout-half) {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin: 0;
	width: auto;
}

/* Nome accanto a Cognome, Professione accanto a Città; l'email intera. */
body.pr-firma .dk-speakout-petition :is(.dk-speakout-full, .dk-speakout-half):has(> :is(input[type="text"], select)) {
	grid-column: auto;
}

/* Il nome del campo sopra il campo (lo aggiunge inc/compat.php, nascosto). */
body.pr-firma .dk-speakout-petition .pr-speakout-field-label {
	clip: auto;
	clip-path: none;
	color: var(--prf-etichetta);
	display: block;
	font-family: var(--prf-corpo);
	font-size: 0.8125rem;
	font-weight: 600;
	height: auto;
	letter-spacing: 0;
	line-height: 1.3;
	margin: 0;
	overflow: visible;
	padding: 0;
	position: static;
	text-transform: none;
	white-space: normal;
	width: auto;
}

body.pr-firma .dk-speakout-petition :is(.dk-speakout-full, .dk-speakout-half):has(> :is(input, select, textarea):not([required])) > .pr-speakout-field-label::after {
	color: var(--prf-attenuato);
	content: " (facoltativo)";
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

body.pr-firma .dk-speakout-petition :is(.dk-speakout-full, .dk-speakout-half):has(> :is(input, select, textarea):not([required])) > .pr-speakout-field-label:lang(en)::after {
	content: " (optional)";
}

body.pr-firma .dk-speakout-petition :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea) {
	background: var(--prf-campo-sfondo);
	border: 1px solid var(--prf-campo-bordo);
	border-radius: 0;
	box-shadow: none;
	box-sizing: border-box;
	color: var(--prf-campo-testo);
	font-family: var(--prf-corpo);
	font-size: 1rem;
	font-weight: 400;
	height: 3rem;
	line-height: 1.4;
	margin: 0;
	max-width: 100%;
	min-height: 3rem;
	padding: 0 0.875rem;
	width: 100%;
}

body.pr-firma .dk-speakout-petition :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"]) {
	appearance: none;
}

body.pr-firma .dk-speakout-petition textarea {
	height: auto;
	min-height: 8rem;
	padding: 0.75rem 0.875rem;
}

body.pr-firma .dk-speakout-petition :is(input[type="text"], input[type="email"], select, textarea):not([required]) {
	border-color: var(--prf-campo-bordo-facoltativo);
}

/* Col nome sopra, il testo grigio dentro al campo e' un doppione. */
body.pr-firma .dk-speakout-petition :is(.dk-speakout-full, .dk-speakout-half):has(> .pr-speakout-field-label) > :is(input, textarea)::placeholder {
	color: transparent;
}

body.pr-firma .dk-speakout-petition :is(input, select, textarea):focus-visible {
	border-color: var(--prf-campo-testo);
	outline: 3px solid var(--prf-fuoco);
	outline-offset: 2px;
}

/* SpeakOut segna cosi' i campi rimasti vuoti o sbagliati. */
body.pr-firma .dk-speakout-petition .dk-speakout-error {
	border-color: var(--prf-errore) !important;
	box-shadow: inset 0 0 0 1px var(--prf-errore);
}

body.pr-firma .dk-speakout-petition input[type="checkbox"].dk-speakout-error {
	outline: 2px solid var(--prf-errore);
	outline-offset: 2px;
}

/* -------------------------------------------- Privacy e altre spunte */

body.pr-firma .dk-speakout-petition :is(.dk-speakout-privacypolicy-wrap, .dk-speakout-optin-wrap, .dk-speakout-bcc-wrap, .dk-speakout-anonymise-wrap) {
	display: block;
	margin: 0;
	width: auto;
}

body.pr-firma .dk-speakout-petition :is(.dk-speakout-options-checkbox, .dk-speakout-optin-checkbox) {
	align-items: flex-start;
	display: flex;
	float: none;
	gap: 0.75rem;
	margin: 0;
}

body.pr-firma .dk-speakout-petition input[type="checkbox"] {
	accent-color: var(--prf-spunta);
	flex-shrink: 0;
	height: 1.5rem;
	margin: 0;
	width: 1.5rem;
}

body.pr-firma .dk-speakout-petition label.dk-speakout-options {
	color: var(--prf-testo);
	display: block;
	font-family: var(--prf-corpo);
	font-size: 0.9375rem;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.45;
	margin: 0;
	padding-top: 0.0625rem;
	text-shadow: none;
	text-transform: none;
}

/*
 * Solo i link di SpeakOut: «Adesso falla firmare» viene inserito nel riquadro
 * dopo la firma e ha i suoi colori. Senza l'esclusione il pulsante «Invia su
 * WhatsApp» usciva nero su nero con la sottolineatura gialla.
 */
body.pr-firma .dk-speakout-petition-wrap a:not(.pr-condividi *) {
	color: var(--prf-link);
	text-decoration: underline;
	text-decoration-color: var(--prf-giallo);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------- Pulsante */

body.pr-firma .dk-speakout-petition .dk-speakout-submit-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0.25rem 0 0;
	text-align: start;
}

body.pr-firma .dk-speakout-petition .dk-speakout-submit-wrap > p {
	margin: 0;
}

body.pr-firma .dk-speakout-petition-wrap .dk-speakout-petition .dk-speakout-submit {
	align-items: center;
	background: var(--prf-pulsante);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--prf-pulsante-testo);
	cursor: pointer;
	display: flex;
	font-family: var(--prf-titoli);
	font-size: 1.375rem;
	font-weight: 800;
	gap: 0.625rem;
	justify-content: center;
	letter-spacing: 0.02em;
	line-height: 1;
	margin: 0;
	min-height: 3.625rem;
	padding: 0.75rem 1.5rem;
	position: static;
	text-shadow: none;
	text-transform: uppercase;
	width: 100%;
}

body.pr-firma .dk-speakout-petition-wrap .dk-speakout-petition .dk-speakout-submit::after {
	background-color: var(--prf-freccia);
	content: "";
	flex-shrink: 0;
	height: 1.25rem;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 160ms ease;
	width: 1.25rem;
}

body.pr-firma .dk-speakout-petition-wrap .dk-speakout-petition .dk-speakout-submit:is(:hover, :focus-visible) {
	--prf-freccia: currentcolor;
	background: var(--prf-pulsante-sopra);
	color: var(--prf-pulsante-sopra-testo);
}

body.pr-firma .dk-speakout-petition-wrap .dk-speakout-petition .dk-speakout-submit:hover::after {
	transform: translateX(3px);
}

body.pr-firma .dk-speakout-petition-wrap .dk-speakout-petition .dk-speakout-submit:focus-visible {
	outline: 3px solid var(--prf-testo);
	outline-offset: 3px;
}

/* Il caricamento: una riga gialla che scorre sotto il pulsante. */
body.pr-firma .dk-speakout-petition .dk-speakout-ajaxloader {
	background: var(--prf-barra);
	font-size: 0;
	height: 3px;
	margin: 0;
	order: 2;
	overflow: hidden;
	position: relative;
}

body.pr-firma .dk-speakout-petition .dk-speakout-ajaxloader::before {
	animation: prf-carica 1s linear infinite;
	background: var(--prf-giallo);
	content: "";
	inset: 0 auto 0 0;
	position: absolute;
	width: 30%;
}

@keyframes prf-carica {

	from {
		transform: translateX(-100%);
	}

	to {
		transform: translateX(340%);
	}
}

/* ------------------------------------------------- Risposta e chiusura */

body.pr-firma .dk-speakout-response {
	background: var(--prf-risposta);
	border-left: 4px solid var(--prf-giallo);
	color: var(--prf-testo);
	margin: var(--prf-spazio) 0 0;
	order: 1;
	overflow-wrap: anywhere;
	padding: 0.875rem 1rem;
}

body.pr-firma .dk-speakout-response-error {
	border-left-color: var(--prf-errore);
}

/*
 * Dopo la firma condividi.js porta la risposta, e l'invito a farla firmare,
 * dentro il contenitore del modulo ormai nascosto: partono da dove partiva il
 * modulo, senza lo spazio che li staccava dai campi.
 */
body.pr-firma #dk-speakout-form-wrap > .dk-speakout-response {
	margin-top: 0;
}

body.pr-firma #dk-speakout-form-wrap > .pr-condividi-firma {
	margin: var(--prf-spazio) 0 0;
}

/* Con la dissolvenza di SpeakOut il modulo resta: l'invito segue la risposta, non la precede. */
body.pr-firma .dk-speakout-petition-wrap > .pr-condividi-firma {
	order: 1;
}

body.pr-firma .dk-speakout-response p {
	margin: 0.25rem 0 0;
}

body.pr-firma .dk-speakout-expired p,
body.pr-firma .dk-speakout-notice p {
	margin: 0 0 0.5rem;
}

/* -------------------------------------------------- Riquadro largo */

/*
 * Da 46rem di riquadro: titolo, accento e conta nella colonna di sinistra, i
 * campi a destra su quattro righe, l'ultima elastica, cosi' la sinistra resta
 * compatta in alto. Si divide solo se a sinistra c'e' qualcosa da mettere.
 */
@container prf-riquadro (min-width: 46rem) {

	body.pr-firma :where(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) > *,
	body.pr-firma :where(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) :where(.pr-campaign-petition-form, .pr-appello-petition-form, .pr-modulo-petizione-form, .dk-speakout-petition-wrap) > *,
	body.pr-firma :where(.dk-speakout-petition-wrap:has(> :is(h2, h3, .dk-speakout-progress-wrap))) > * {
		grid-column: 2;
	}

	body.pr-firma :where(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) > :where(h2, hr, .pr-campaign-petition-stats, .pr-appello-petition-stats),
	body.pr-firma .pr-modulo-petizione .dk-speakout-progress-wrap,
	body.pr-firma .dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *) > :is(h2, h3, .dk-speakout-progress-wrap) {
		grid-column: 1;
	}

	body.pr-firma :where(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) #dk-speakout-form-wrap,
	body.pr-firma :where(.dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *):has(> :is(h2, h3, .dk-speakout-progress-wrap))) > #dk-speakout-form-wrap {
		grid-row: 1 / span 4;
	}
}

/* ----------------------------------------------- A · Manifesto, dettagli */

body.pr-firma--manifesto :is(.pr-campaign-petition-count, .pr-appello-petition-count) > [data-pr-firme-numero],
body.pr-firma--manifesto .dk-speakout-signature-count > span {
	color: var(--prf-giallo);
}

body.pr-firma--manifesto :is(.pr-campaign-petition-stats, .pr-appello-petition-stats),
body.pr-firma--manifesto .dk-speakout-progress-wrap {
	border-bottom: 1px solid #333;
	padding-bottom: 1.125rem;
}

body.pr-firma--manifesto .dk-speakout-petition .pr-speakout-field-label {
	font-family: var(--prf-etichette);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

body.pr-firma--manifesto .dk-speakout-petition :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select) {
	height: 3.125rem;
	padding-inline: 0.875rem;
}

body.pr-firma--manifesto .dk-speakout-petition :is(input, select, textarea):focus-visible {
	border-color: var(--prf-giallo);
	outline-offset: 0;
}

body.pr-firma--manifesto .dk-speakout-petition :is(input, textarea)::placeholder {
	color: #8f8f8f;
}

body.pr-firma--manifesto .dk-speakout-petition label.dk-speakout-options {
	color: #e6e6e6;
}

body.pr-firma--manifesto .dk-speakout-petition-wrap a:hover {
	color: #ffd24d;
}

/* ---------------------------------------------- B · Editoriale, dettagli */

/* Le firme in un'etichetta nera con il punto giallo, sopra il titolo. */
body.pr-firma--editoriale :is(.pr-campaign-petition-stats, .pr-appello-petition-stats),
body.pr-firma--editoriale .dk-speakout-progress-wrap {
	align-items: flex-start;
	order: -5;
}

body.pr-firma--editoriale :is(.pr-campaign-petition-count, .pr-appello-petition-count),
body.pr-firma--editoriale .dk-speakout-signature-count {
	align-items: center;
	background: var(--prf-nero);
	color: #fff;
	display: inline-flex;
	font-size: 0.875rem;
	gap: 0.375rem;
	padding: 0.5rem 0.75rem;
}

body.pr-firma--editoriale :is(.pr-campaign-petition-count, .pr-appello-petition-count)::before,
body.pr-firma--editoriale .dk-speakout-signature-count::before {
	background: var(--prf-giallo);
	border-radius: 50%;
	content: "";
	height: 8px;
	margin-right: 0.25rem;
	width: 8px;
}

body.pr-firma--editoriale :is(.pr-campaign-petition-count, .pr-appello-petition-count) > [data-pr-firme-numero],
body.pr-firma--editoriale .dk-speakout-signature-count > span {
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

body.pr-firma--editoriale :is(.pr-campaign-petition-progress, .pr-appello-petition-progress),
body.pr-firma--editoriale .dk-speakout-count {
	align-self: stretch;
}

body.pr-firma--editoriale .dk-speakout-petition {
	row-gap: 1.375rem;
}

body.pr-firma--editoriale .dk-speakout-petition :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea) {
	border-width: 0 0 2px;
	font-size: 1.0625rem;
	height: 2.875rem;
	min-height: 2.875rem;
	padding-inline: 0.125rem;
}

body.pr-firma--editoriale .dk-speakout-petition textarea {
	border-width: 2px;
	height: auto;
	min-height: 8rem;
	padding: 0.75rem;
}

body.pr-firma--editoriale .dk-speakout-petition :is(input, select, textarea):focus-visible {
	background: #fff8e1;
	outline-offset: 3px;
}

/* ---------------------------------------- C · Contatore, dettagli */

/* Stretto: una striscia gialla in cima, numero e scritta affiancati. */
body.pr-firma--contatore :is(.pr-campaign-petition-stats, .pr-appello-petition-stats),
body.pr-firma--contatore .dk-speakout-progress-wrap {
	background: var(--prf-giallo);
	color: var(--prf-nero);
	gap: 0.75rem;
	margin: calc(var(--prf-pad) * -1) calc(var(--prf-pad) * -1) var(--prf-pad);
	order: -5;
	padding: var(--prf-pad);
}

/* Nel modulo collegato la striscia sta sotto il titolo: si allarga ai bordi. */
body.pr-firma--contatore .pr-modulo-petizione .dk-speakout-progress-wrap {
	margin-top: 0;
	order: -2;
}

body.pr-firma--contatore :is(.pr-campaign-petition-count, .pr-appello-petition-count),
body.pr-firma--contatore .dk-speakout-signature-count {
	align-items: center;
	color: var(--prf-nero);
	column-gap: 1rem;
	flex-wrap: nowrap;
	font-size: 1.0625rem;
}

body.pr-firma--contatore :is(.pr-campaign-petition-count, .pr-appello-petition-count) > [data-pr-firme-numero],
body.pr-firma--contatore .dk-speakout-signature-count > span {
	color: var(--prf-nero);
	font-size: clamp(3.5rem, 2.8rem + 3vw, 4.25rem);
	line-height: 0.85;
}

body.pr-firma--contatore :is(.pr-campaign-petition-progress, .pr-appello-petition-progress) > span,
body.pr-firma--contatore .dk-speakout-progressbar {
	background: var(--prf-nero);
}

body.pr-firma--contatore :is(.pr-campaign-petition-goal, .pr-appello-petition-goal),
body.pr-firma--contatore .dk-speakout-count {
	color: var(--prf-nero);
}

body.pr-firma--contatore .dk-speakout-petition :is(input, select, textarea):focus-visible {
	box-shadow: inset 0 0 0 1px var(--prf-nero);
	outline-color: var(--prf-giallo);
	outline-offset: 0;
}

/*
 * Largo: il pannello giallo occupa la colonna di sinistra per tutta l'altezza,
 * fino ai bordi; titolo, accento e campi vanno a destra.
 */
@container prf-riquadro (min-width: 46rem) {

	body.pr-firma--contatore :is(.pr-campaign-petition, .pr-appello-petition) > :is(.pr-campaign-petition-stats, .pr-appello-petition-stats),
	body.pr-firma--contatore .dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *) > .dk-speakout-progress-wrap {
		align-self: stretch;
		grid-column: 1;
		grid-row: 1 / span 5;
		justify-content: flex-start;
		margin: calc(var(--prf-pad) * -1) 0 calc(var(--prf-pad) * -1) calc(var(--prf-pad) * -1);
		padding: 2.75rem clamp(1.5rem, 3cqi, 2.25rem);
	}

	body.pr-firma--contatore :is(.pr-campaign-petition, .pr-appello-petition) > :is(h2, hr),
	body.pr-firma--contatore .dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *):has(> .dk-speakout-progress-wrap) > :is(h2, h3) {
		grid-column: 2;
	}

	body.pr-firma--contatore :is(.pr-campaign-petition, .pr-appello-petition) #dk-speakout-form-wrap,
	body.pr-firma--contatore :where(.dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *):has(> .dk-speakout-progress-wrap)) > #dk-speakout-form-wrap {
		grid-row: 3 / span 2;
	}

	body.pr-firma--contatore :is(.pr-campaign-petition-count, .pr-appello-petition-count),
	body.pr-firma--contatore .dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *) .dk-speakout-signature-count {
		align-items: flex-start;
		flex-direction: column;
		font-size: 1.25rem;
		row-gap: 0.75rem;
	}

	body.pr-firma--contatore :is(.pr-campaign-petition-count, .pr-appello-petition-count) > [data-pr-firme-numero],
	body.pr-firma--contatore .dk-speakout-petition-wrap:not(:is(.pr-campaign-petition, .pr-appello-petition, .pr-modulo-petizione) *) .dk-speakout-signature-count > span {
		font-size: clamp(4.5rem, 10cqi, 7.25rem);
	}

	/* Nel modulo collegato la conta sta coi campi: la striscia resta striscia. */
	body.pr-firma--contatore .pr-modulo-petizione .dk-speakout-progress-wrap {
		margin-inline: 0;
		padding: 1.375rem 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {

	body.pr-firma .dk-speakout-petition .dk-speakout-ajaxloader::before {
		animation: none;
		width: 100%;
	}

	body.pr-firma .dk-speakout-petition-wrap .dk-speakout-petition .dk-speakout-submit::after {
		transition: none;
	}
}
