/* ==========================================================================
   Téchne — form pubblico [techne_interesse]

   Porting da reddit-connector creator-request.css: card autonoma che vive
   dentro il tema. Tutte le variabili sono scopate a .techne-interesse e
   mappate sulla palette del brand (tokens.css) con fallback inline; il font
   è ereditato dal tema.
   ========================================================================== */

.techne-interesse {
	--ti-bg: #fff;
	--ti-border: rgb(74 74 66 / 22%);
	--ti-border-strong: rgb(74 74 66 / 45%);
	--ti-brand: var(--techne-sage-deep, #557245);
	--ti-brand-hover: var(--techne-dark, #2e332a);
	--ti-brand-soft: rgb(126 155 110 / 25%);
	--ti-err: #b91c1c;
	--ti-err-bg: #fef2f2;
	--ti-info: var(--techne-copper-deep, #8c5a2f);
	--ti-info-bg: rgb(185 130 90 / 12%);
	--ti-ink: var(--techne-ink-deep, #343a30);
	--ti-muted: var(--techne-ink, #4a4a42);
	--ti-ok: #15803d;
	--ti-ok-bg: #f0fdf4;
	--ti-radius: 12px;
	--ti-radius-sm: 7px;
	--ti-shadow: 0 1px 2px rgb(46 51 42 / 7%), 0 18px 44px -14px rgb(46 51 42 / 24%);
	--ti-surface: var(--techne-cream, #f4efe2);

	background: var(--ti-bg);
	border: 1px solid var(--ti-border);
	border-radius: var(--ti-radius);
	box-shadow: var(--ti-shadow);
	box-sizing: border-box;
	color: var(--ti-ink);
	display: grid;
	font-family: inherit;
	font-size: 15px;
	gap: 18px;
	line-height: 1.5;
	margin: 1.5rem 0;
	max-width: 34rem;
	padding: 28px;
	position: relative;
}

.techne-interesse *,
.techne-interesse *::before,
.techne-interesse *::after {
	box-sizing: border-box;
}

/* Filo di brand lungo il bordo alto della card. */
.techne-interesse::before {
	background: linear-gradient(90deg, var(--ti-brand), var(--techne-copper, #b9825a));
	border-radius: var(--ti-radius) var(--ti-radius) 0 0;
	content: "";
	height: 4px;
	left: 0;
	position: absolute;
	right: 0;
	top: -1px;
}

/* --------------------------------------------------------------------------
   Gruppo campo — label sopra, controllo sotto
   -------------------------------------------------------------------------- */
.techne-interesse .ti-field {
	display: grid;
	gap: 6px;
}

.techne-interesse label {
	color: var(--ti-ink);
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: 0.005em;
}

.techne-interesse .ti-required {
	color: var(--ti-brand);
	font-weight: 700;
	margin-left: 2px;
}

.techne-interesse .ti-optional {
	color: var(--ti-muted);
	font-size: 12px;
	font-weight: 400;
	margin-left: 4px;
	text-transform: lowercase;
}

.techne-interesse input[type="text"],
.techne-interesse input[type="email"],
.techne-interesse input[type="tel"],
.techne-interesse select,
.techne-interesse textarea {
	background: var(--ti-bg);
	border: 1px solid var(--ti-border);
	border-radius: var(--ti-radius-sm);
	color: var(--ti-ink);
	font: inherit;
	font-size: 15px;
	padding: 11px 13px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	width: 100%;
}

.techne-interesse textarea {
	resize: vertical;
}

.techne-interesse input::placeholder,
.techne-interesse textarea::placeholder {
	color: var(--ti-border-strong);
}

.techne-interesse input:hover:not(:focus),
.techne-interesse select:hover:not(:focus),
.techne-interesse textarea:hover:not(:focus) {
	border-color: var(--ti-border-strong);
}

.techne-interesse input:focus,
.techne-interesse select:focus,
.techne-interesse textarea:focus {
	border-color: var(--ti-brand);
	box-shadow: 0 0 0 3px var(--ti-brand-soft);
	outline: none;
}

/* --------------------------------------------------------------------------
   Consenso — gruppo boxato: il paragrafo privacy si legge come un'unità
   -------------------------------------------------------------------------- */
.techne-interesse .ti-consent {
	background: var(--ti-surface);
	border: 1px solid var(--ti-border);
	border-radius: var(--ti-radius-sm);
	padding: 14px 16px;
}

.techne-interesse .ti-consent label {
	align-items: flex-start;
	color: var(--ti-ink);
	cursor: pointer;
	display: flex;
	font-size: 13.5px;
	font-weight: 400;
	gap: 10px;
	letter-spacing: normal;
	line-height: 1.55;
}

.techne-interesse .ti-consent input[type="checkbox"] {
	accent-color: var(--ti-brand);
	cursor: pointer;
	flex-shrink: 0;
	height: 17px;
	margin-top: 2px;
	width: 17px;
}

.techne-interesse .ti-consent a {
	color: var(--ti-brand);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.techne-interesse .ti-consent a:hover {
	color: var(--ti-brand-hover);
}

/* --------------------------------------------------------------------------
   Honeypot — nascosto alla vista, all'accessibilità e fuori schermo
   -------------------------------------------------------------------------- */
.techne-interesse .ti-hp {
	height: 1px;
	left: -9999px;
	position: absolute;
	width: 1px;
}

/* --------------------------------------------------------------------------
   Bottone di invio
   -------------------------------------------------------------------------- */
.techne-interesse .ti-submit {
	align-items: center;
	appearance: none;
	background: var(--ti-brand);
	border: none;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	gap: 8px;
	justify-content: center;
	justify-self: start;
	letter-spacing: 0.01em;
	min-width: 170px;
	padding: 13px 28px;
	transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.techne-interesse .ti-submit:hover:not([disabled]) {
	background: var(--ti-brand-hover);
}

.techne-interesse .ti-submit:active:not([disabled]) {
	transform: translateY(1px);
}

.techne-interesse .ti-submit:focus-visible {
	box-shadow: 0 0 0 3px var(--ti-brand-soft);
	outline: none;
}

.techne-interesse .ti-submit[disabled] {
	background: var(--ti-border-strong);
	cursor: progress;
}

/* --------------------------------------------------------------------------
   Errori per campo + messaggio di esito
   -------------------------------------------------------------------------- */
.techne-interesse .ti-field-error {
	color: var(--ti-err);
	font-size: 13px;
	margin: 0;
}

.techne-interesse .ti-field-error[hidden] {
	display: none;
}

.techne-interesse .ti-result {
	align-items: center;
	background: var(--ti-surface);
	border-radius: var(--ti-radius-sm);
	display: flex;
	font-size: 14px;
	font-weight: 500;
	gap: 10px;
	margin: 0;
	padding: 12px 14px;
}

.techne-interesse .ti-result[hidden] {
	display: none;
}

.techne-interesse .ti-result::before {
	border-radius: 50%;
	content: "";
	flex-shrink: 0;
	height: 9px;
	width: 9px;
}

.techne-interesse .ti-result--success {
	background: var(--ti-ok-bg);
	color: var(--ti-ok);
}

.techne-interesse .ti-result--success::before {
	background: var(--ti-ok);
	box-shadow: 0 0 0 3px rgb(21 128 61 / 14%);
}

.techne-interesse .ti-result--error {
	background: var(--ti-err-bg);
	color: var(--ti-err);
}

.techne-interesse .ti-result--error::before {
	background: var(--ti-err);
	box-shadow: 0 0 0 3px rgb(185 28 28 / 14%);
}

.techne-interesse .ti-result--pending {
	background: var(--ti-info-bg);
	color: var(--ti-info);
}

.techne-interesse .ti-result--pending::before {
	animation: ti-pulse 1.2s ease-in-out infinite;
	background: var(--ti-info);
}

@keyframes ti-pulse {
	0%, 100% {
		opacity: 1;
		transform: scale(1);
	}

	50% {
		opacity: 0.35;
		transform: scale(0.55);
	}
}

@media (prefers-reduced-motion: reduce) {
	.techne-interesse .ti-result--pending::before {
		animation: none;
	}
}

/* --------------------------------------------------------------------------
   Responsive — padding più stretto sui telefoni
   -------------------------------------------------------------------------- */
@media (width <= 480px) {
	.techne-interesse {
		gap: 14px;
		padding: 20px;
	}

	.techne-interesse .ti-submit {
		min-width: 100%;
	}
}
