/* ==========================================================================
   Teknet — Contact Form 7 "Richiedi maggiori informazioni"
   Nessuna font-family impostata: eredita quella del tema.
   ========================================================================== */

.tk-cf {
	--tk-ink: #15222e;            /* titoli, label, bottone */
	--tk-text: #2b3640;           /* testo consensi */
	--tk-muted: #6b7682;          /* sottotitolo, stati file */
	--tk-placeholder: #8b95a1;
	--tk-field-bg: #f6f8fa;
	--tk-border: #dde3e9;
	--tk-border-soft: #eceff3;
	--tk-error: #c62828;
	--tk-radius: 10px;
	--tk-gap: 32px;

	/* Icone (SVG come mask: il colore lo decide background-color) */
	--tk-i-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.6-6.5 8-6.5s8 2.5 8 6.5'/%3E%3C/svg%3E");
	--tk-i-building: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='1.5'/%3E%3Cpath d='M9 7h1M14 7h1M9 11h1M14 11h1M9 15h1M14 15h1M10 21v-3h4v3'/%3E%3C/svg%3E");
	--tk-i-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3.5 7 8.5 6 8.5-6'/%3E%3C/svg%3E");
	--tk-i-doc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='1.5'/%3E%3Cpath d='M8 8h3v3H8zM14 8h2M14 11h2M8 15h8M8 18h8'/%3E%3C/svg%3E");
	--tk-i-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 0 1-11.6 7.1L4 20l1-4A8 8 0 1 1 20 12z'/%3E%3Cpath d='M8.5 12h.01M12 12h.01M15.5 12h.01'/%3E%3C/svg%3E");
	--tk-i-clip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
	--tk-i-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E");
	--tk-i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");

	color: var(--tk-text);
}

.tk-cf *,
.tk-cf *::before,
.tk-cf *::after {
	box-sizing: border-box;
}

/* --- Intestazione ------------------------------------------------------- */

.tk-cf__head {
	text-align: center;
	margin-bottom: 44px;
}

.tk-cf__eyebrow {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	margin: 0 0 14px;
	color: var(--tk-muted);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.tk-cf__eyebrow::before,
.tk-cf__eyebrow::after {
	content: "";
	width: 76px;
	height: 1.5px;
	background: currentColor;
	opacity: 0.6;
}

.tk-cf__title {
	margin: 0 0 16px;
	color: var(--tk-ink);
	font-size: clamp(1.875rem, 1.2rem + 2.4vw, 3.25rem);
	font-weight: 700;
	line-height: 1.1;
}

.tk-cf__intro {
	max-width: 72ch;
	margin: 0 auto;
	color: var(--tk-muted);
	font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
	line-height: 1.5;
}

/* --- Card --------------------------------------------------------------- */

.tk-cf__card {
	padding: clamp(24px, 3vw, 40px);
	background: #fff;
	border: 1px solid var(--tk-border-soft);
	border-radius: 16px;
	box-shadow: 0 12px 40px -16px rgba(21, 34, 46, 0.12);
}

.tk-cf__cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 var(--tk-gap);
}

/* La colonna destra si allunga: la textarea riempie l'altezza della sinistra */
.tk-cf__col {
	display: flex;
	flex-direction: column;
}

.tk-group + .tk-group {
	margin-top: 22px;
}

.tk-group--grow,
.tk-group--grow .tk-field,
.tk-group--grow .wpcf7-form-control-wrap {
	display: flex;
	flex: 1;
	flex-direction: column;
}

.tk-label {
	display: block;
	margin: 0 0 10px;
	color: var(--tk-ink);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
}

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

.tk-field {
	position: relative;
}

.tk-field .wpcf7-form-control-wrap {
	display: block;
}

.tk-field::before {
	content: "";
	position: absolute;
	top: 31px;               /* metà altezza input: non si sposta se compare l'errore */
	left: 20px;
	z-index: 1;
	width: 20px;
	height: 20px;
	transform: translateY(-50%);
	background-color: var(--tk-ink);
	-webkit-mask: var(--tk-icon) center / contain no-repeat;
	mask: var(--tk-icon) center / contain no-repeat;
	pointer-events: none;
}

.tk-field--textarea::before {
	top: 18px;
	transform: none;
}

.tk-field[data-icon="user"]     { --tk-icon: var(--tk-i-user); }
.tk-field[data-icon="building"] { --tk-icon: var(--tk-i-building); }
.tk-field[data-icon="mail"]     { --tk-icon: var(--tk-i-mail); }
.tk-field[data-icon="doc"]      { --tk-icon: var(--tk-i-doc); }
.tk-field[data-icon="chat"]     { --tk-icon: var(--tk-i-chat); }

.tk-cf .tk-field input,
.tk-cf .tk-field textarea {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	max-width: 100%;
	height: 62px;
	margin: 0;
	padding: 0 18px 0 56px;
	background: var(--tk-field-bg);
	border: 1px solid var(--tk-border);
	border-radius: var(--tk-radius);
	box-shadow: none;
	color: var(--tk-ink);
	font: inherit;
	font-size: 1rem;
	line-height: normal;
	transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.tk-cf .tk-field textarea {
	flex: 1;
	height: auto;
	min-height: 170px;
	padding-top: 16px;
	padding-bottom: 16px;
	line-height: 1.5;
	resize: vertical;
}

.tk-cf .tk-field input::placeholder,
.tk-cf .tk-field textarea::placeholder {
	color: var(--tk-placeholder);
	opacity: 1;
}

.tk-cf .tk-field input:hover,
.tk-cf .tk-field textarea:hover {
	border-color: #c9d1d9;
}

.tk-cf .tk-field input:focus,
.tk-cf .tk-field textarea:focus {
	outline: none;
	background: #fff;
	border-color: var(--tk-ink);
	box-shadow: 0 0 0 3px rgba(21, 34, 46, 0.08);
}

/* --- Validazione CF7 ---------------------------------------------------- */

.tk-cf .wpcf7-not-valid {
	border-color: var(--tk-error) !important;
}

.tk-cf .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	color: var(--tk-error);
	font-size: 0.8125rem;
	line-height: 1.4;
}

/* --- Allegati ----------------------------------------------------------- */

.tk-cf__files {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px var(--tk-gap);
	margin-top: 36px;
}

.tk-file {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
	margin: 0;
	padding: 16px 18px;
	background: #fff;
	border: 1px dashed var(--tk-border);
	border-radius: var(--tk-radius);
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.tk-file:hover {
	background: var(--tk-field-bg);
	border-color: #b9c2cb;
}

.tk-file:focus-within {
	border-color: var(--tk-ink);
	box-shadow: 0 0 0 3px rgba(21, 34, 46, 0.08);
}

.tk-file__icon {
	position: relative;
	flex: none;
	width: 44px;
	height: 44px;
	background: var(--tk-field-bg);
	border-radius: 50%;
	transition: background-color 0.2s;
}

.tk-file__icon::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 20px;
	height: 20px;
	background-color: var(--tk-ink);
	-webkit-mask: var(--tk-i-clip) center / contain no-repeat;
	mask: var(--tk-i-clip) center / contain no-repeat;
}

.tk-file__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.35;
}

.tk-file__title {
	color: var(--tk-ink);
	font-size: 0.9375rem;
	font-weight: 600;
}

.tk-file__status {
	overflow: hidden;
	color: var(--tk-muted);
	font-size: 0.875rem;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Input nativo nascosto ma ancora focalizzabile da tastiera */
.tk-file input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	opacity: 0;
}

/* Il messaggio d'errore CF7 finisce sotto la card */
.tk-file .wpcf7-form-control-wrap {
	position: absolute;
	top: 100%;
	left: 2px;
	right: 2px;
}

.tk-file.is-filled {
	border-style: solid;
	border-color: #b9c2cb;
}

.tk-file.is-filled .tk-file__icon {
	background: var(--tk-ink);
}

.tk-file.is-filled .tk-file__icon::before {
	background-color: #fff;
}

.tk-file.is-filled .tk-file__status {
	color: var(--tk-ink);
}

/* --- Consensi ----------------------------------------------------------- */

.tk-cf__consents {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px var(--tk-gap);
	margin-top: 32px;
	padding-top: 28px;
	border-top: 1px solid var(--tk-border-soft);
}

.tk-cf__consents .wpcf7-form-control-wrap,
.tk-cf__consents .wpcf7-list-item {
	display: block;
	margin: 0;
}

.tk-cf__consents label {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0;
	color: var(--tk-text);
	font-size: 0.9375rem;
	line-height: 1.5;
	cursor: pointer;
}

.tk-cf__consents input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	flex: none;
	width: 22px;
	height: 22px;
	margin: 0;
	background: #fff center / 14px no-repeat;
	border: 1.5px solid #c3cbd3;
	border-radius: 5px;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.tk-cf__consents input[type="checkbox"]:hover {
	border-color: var(--tk-ink);
}

.tk-cf__consents input[type="checkbox"]:checked {
	background-color: var(--tk-ink);
	background-image: var(--tk-i-check);
	border-color: var(--tk-ink);
}

.tk-cf__consents input[type="checkbox"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(21, 34, 46, 0.15);
}

.tk-cf__consents a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tk-cf__consents a:hover {
	color: var(--tk-ink);
}

/* --- Invio -------------------------------------------------------------- */

.tk-cf__actions {
	margin-top: 32px;
	text-align: center;
}

.tk-submit {
	position: relative;
	display: inline-block;
}

/* padding asimmetrico: testo + freccia risultano centrati nel bottone */
.tk-cf .tk-submit input[type="submit"] {
	-webkit-appearance: none;
	appearance: none;
	min-height: 64px;
	margin: 0;
	padding: 0 104px 0 72px;
	background: var(--tk-ink);
	border: 0;
	border-radius: 8px;
	color: #fff;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s, opacity 0.2s;
}

.tk-cf .tk-submit input[type="submit"]:hover {
	background: #0b141c;
}

.tk-cf .tk-submit input[type="submit"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(21, 34, 46, 0.2);
}

.tk-cf .tk-submit input[type="submit"]:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.tk-submit::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 72px;
	width: 20px;
	height: 20px;
	margin-top: -10px;
	background-color: #fff;
	-webkit-mask: var(--tk-i-arrow) center / contain no-repeat;
	mask: var(--tk-i-arrow) center / contain no-repeat;
	pointer-events: none;
	transition: transform 0.2s, opacity 0.2s;
}

.tk-submit:hover::after {
	transform: translateX(4px);
}

.tk-submit:has(input:disabled)::after {
	opacity: 0.45;
	transform: none;
}

.tk-submit .wpcf7-spinner {
	position: absolute;
	top: 50%;
	left: 100%;
	margin: -12px 0 0 14px;
}

/* Messaggio di risposta CF7 (sta fuori da .tk-cf, in coda al form) */
.wpcf7-form:has(.tk-cf) .wpcf7-response-output {
	margin: 24px 0 0;
	padding: 14px 18px;
	border-width: 1px;
	border-radius: var(--tk-radius);
	font-size: 0.9375rem;
	text-align: center;
}

/* --- Protezione da regole globali del template -------------------------
   Il template (es. .input-w-100) forza width:100% sugli span: qui si
   ripristinano le larghezze degli elementi del form. !important voluto. */

.tk-cf .tk-file > .tk-file__icon {
	flex: 0 0 44px !important;
	width: 44px !important;
	min-width: 44px;
	max-width: 44px;
}

.tk-cf .tk-file > .tk-file__text {
	flex: 1 1 auto !important;
	width: auto !important;
	min-width: 0;
}

.tk-cf .tk-file__title,
.tk-cf .tk-file__status {
	display: block;
	width: auto !important;
}

.tk-cf .tk-cf__actions > .tk-submit {
	display: inline-block;
	width: auto !important;
}

/* Input testuali: il template sovrascrive padding e larghezza */
.tk-cf .tk-field input[type="text"],
.tk-cf .tk-field input[type="email"],
.tk-cf .tk-field textarea {
	width: 100% !important;
	max-width: 100% !important;
	padding-left: 56px !important;
	padding-right: 18px !important;
}

.tk-cf .tk-field input[type="text"],
.tk-cf .tk-field input[type="email"] {
	height: 62px !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	text-indent: 0 !important;
}

/* Asterisco sulla stessa riga della label */
.tk-cf .tk-label > .tk-req {
	display: inline !important;
	width: auto !important;
}

/* --- Responsive (breakpoint UIkit @m / @s) ------------------------------ */

@media (max-width: 959px) {
	.tk-cf {
		--tk-gap: 20px;
	}

	.tk-cf__cols,
	.tk-cf__files,
	.tk-cf__consents {
		grid-template-columns: 1fr;
	}

	.tk-cf__col + .tk-cf__col {
		margin-top: 22px;
	}

	.tk-cf__files {
		row-gap: 16px;
	}

	/* su una colonna l'errore del file va in flusso, non sovrapposto */
	.tk-file {
		flex-wrap: wrap;
	}

	.tk-file .wpcf7-form-control-wrap {
		position: static;
		flex-basis: 100%;
	}
}

@media (max-width: 639px) {
	.tk-cf__eyebrow::before,
	.tk-cf__eyebrow::after {
		width: 40px;
	}

	.tk-cf .tk-cf__actions > .tk-submit {
		display: block;
		width: 100% !important;
	}

	.tk-cf .tk-submit input[type="submit"] {
		width: 100%;
		padding: 0 56px 0 24px;
	}

	.tk-submit::after {
		right: 24px;
	}

	.tk-submit .wpcf7-spinner {
		top: 100%;
		left: 50%;
		margin: 10px 0 0 -12px;
	}
}