/* ==========================================================================
   Toscano – Formulario (presupuesto). Prefijo .tfm.
   ========================================================================== */

.tfm {
	--tfm-bg: #f6fafa;
	--tfm-accent: var(--toscano-brand-teal, #009a9d);
	--tfm-accent-2: #2fc4c7;
	--tfm-deep: var(--toscano-brand-deep, #032d35);
	--tfm-title: var(--tfm-deep);
	--tfm-highlight: var(--tfm-accent);
	--tfm-text: #6f6f6f;
	--tfm-card: #ffffff;
	--tfm-field: #f7fbfb;
	--tfm-border: #dfe9eb;
	--tfm-error: #d93a3a;

	position: relative;
	box-sizing: border-box;
	width: 100%;
	padding: 110px 0;
	overflow: hidden;
	background:
		radial-gradient(60% 70% at 100% 50%, color-mix(in srgb, var(--tfm-accent) 10%, transparent) 0%, transparent 70%),
		linear-gradient(rgba(3, 45, 53, .035) 1px, transparent 1px) 0 0 / 48px 48px,
		linear-gradient(90deg, rgba(3, 45, 53, .035) 1px, transparent 1px) 0 0 / 48px 48px,
		var(--tfm-bg);
	color: var(--tfm-text);
	font-family: "Inter", sans-serif;
	-webkit-font-smoothing: antialiased;
	word-break: break-word;
}

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

.tfm .tfm__inner {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: clamp(40px, 6vw, 88px);
	align-items: center;
	max-width: 1248px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Columna de texto ---------- */

.tfm .tfm__eyebrow {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #6f6f6f;
}

.tfm .tfm__title {
	margin: 0;
	font-family: "Inter", sans-serif;
	font-size: 39px;
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: 0;
	text-transform: none;
	color: var(--tfm-title);
}

.tfm .tfm__hl {
	color: var(--tfm-highlight);
}

.tfm .tfm__text {
	margin: 16px 0 0;
	font-size: 16px;
	line-height: 1.59;
}

.tfm .tfm__benefits {
	display: grid;
	gap: 18px;
	margin: 36px 0 0;
	padding: 0;
	list-style: none;
}

.tfm .tfm__benefits li {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0;
	font-size: 15px;
	line-height: 1.55;
}

.tfm .tfm__benefits strong {
	font-weight: 700;
	color: var(--tfm-title);
}

.tfm .tfm__tick {
	flex: 0 0 24px;
	margin-top: 0;
}

.tfm .tfm__tick svg {
	display: block;
}

.tfm .tfm__tick-bg {
	fill: #e0f4f4;
}

.tfm .tfm__tick-path {
	stroke: var(--tfm-accent);
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Contacto directo */
.tfm .tfm__direct {
	margin-top: 36px;
	padding-top: 28px;
	border-top: 1px solid var(--tfm-border);
}

.tfm .tfm__direct-title {
	margin: 0 0 14px;
	font-size: 14px;
	font-weight: 700;
	color: var(--tfm-title);
}

.tfm .tfm__direct-items {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.tfm a.tfm__direct-item {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 12px 18px 12px 12px;
	border: 1px solid var(--tfm-border);
	border-radius: 12px;
	background: #ffffff;
	color: var(--tfm-title);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}

.tfm a.tfm__direct-item small {
	display: block;
	margin-bottom: 3px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--tfm-text);
}

.tfm a.tfm__direct-item:hover {
	border-color: color-mix(in srgb, var(--tfm-accent) 45%, var(--tfm-border));
	box-shadow: 0 10px 24px -12px rgba(3, 45, 53, .25);
	color: var(--tfm-title);
	transform: translateY(-2px);
}

.tfm .tfm__direct-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: #e0f4f4;
	color: var(--tfm-accent);
}

.tfm .tfm__hours {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 14px 0 0;
	font-size: 13px;
}

.tfm .tfm__dot {
	position: relative;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3cc38a;
}

.tfm .tfm__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #3cc38a;
	animation: tfm-ping 2s ease-out infinite;
}

@keyframes tfm-ping {
	0% { opacity: .7; transform: scale(1); }
	100% { opacity: 0; transform: scale(2.8); }
}

/* ---------- Tarjeta del formulario ---------- */

.tfm .tfm__card {
	position: relative;
	padding: 40px 40px 34px;
	overflow: hidden;
	border: 1px solid var(--tfm-border);
	border-radius: 18px;
	background: var(--tfm-card);
	box-shadow: 0 30px 70px -30px rgba(3, 45, 53, .28);
}

.tfm .tfm__edge {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--tfm-accent), var(--tfm-accent-2), #ffffff, var(--tfm-accent-2), var(--tfm-accent));
	background-size: 300% 100%;
	animation: tfm-edge 4s linear infinite;
}

@keyframes tfm-edge {
	to { background-position: -300% 0; }
}

.tfm .tfm__form-title {
	margin: 0 0 26px;
	font-family: "Inter", sans-serif;
	font-size: 28px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	color: var(--tfm-title);
}

.tfm .tfm__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.tfm .tfm__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 14px;
}

.tfm .tfm__grid--3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tfm .tfm__grid--3.tfm__grid--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Campo con etiqueta flotante y línea de corriente al enfocar */
.tfm .tfm__field {
	position: relative;
}

.tfm .tfm__input {
	display: block;
	width: 100%;
	height: 58px;
	margin: 0;
	padding: 24px 16px 8px;
	border: 1px solid var(--tfm-border);
	border-radius: 10px;
	background: var(--tfm-field);
	box-shadow: none;
	color: var(--tfm-title);
	font-family: "Inter", sans-serif;
	font-size: 15px;
	line-height: 1.4;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease;
}

.tfm textarea.tfm__input {
	height: auto;
	min-height: 128px;
	padding-top: 28px;
	resize: vertical;
}

.tfm select.tfm__input {
	padding-right: 38px;
	cursor: pointer;
}

.tfm .tfm__input:hover {
	border-color: color-mix(in srgb, var(--tfm-accent) 35%, var(--tfm-border));
}

.tfm .tfm__input:focus {
	border-color: var(--tfm-accent);
	background: #ffffff;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--tfm-accent) 12%, transparent);
}

.tfm .tfm__label {
	position: absolute;
	top: 19px;
	left: 17px;
	right: 12px;
	overflow: hidden;
	color: var(--tfm-text);
	font-size: 15px;
	line-height: 1.3;
	white-space: nowrap;
	text-overflow: ellipsis;
	pointer-events: none;
	transform-origin: 0 0;
	transition: transform .22s ease, color .22s ease;
}

.tfm .tfm__label span {
	color: var(--tfm-accent);
}

/* Sube la etiqueta al enfocar o con contenido (placeholder=" " vacío) */
.tfm .tfm__input:focus + .tfm__label,
.tfm .tfm__input:not(:placeholder-shown) + .tfm__label,
.tfm .tfm__field--select.has-value .tfm__label,
.tfm select.tfm__input:focus + .tfm__label {
	color: var(--tfm-accent);
	transform: translateY(-10px) scale(.78);
}

.tfm .tfm__line {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 0;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--tfm-accent), var(--tfm-accent-2));
	box-shadow: 0 0 8px var(--tfm-accent-2);
	transform: scaleX(0);
	transform-origin: 0 50%;
	transition: transform .45s cubic-bezier(.2, .7, .2, 1);
	pointer-events: none;
}

.tfm .tfm__input:focus ~ .tfm__line {
	transform: scaleX(1);
}

.tfm .tfm__caret {
	position: absolute;
	top: 23px;
	right: 16px;
	color: var(--tfm-text);
	pointer-events: none;
}

.tfm .tfm__field--area {
	margin-top: 4px;
}

.tfm .tfm__hint {
	display: block;
	margin: 8px 2px 0;
	font-size: 12px;
	line-height: 1.5;
	color: color-mix(in srgb, var(--tfm-text) 85%, transparent);
}

/* Errores */
.tfm .tfm__err {
	display: block;
	min-height: 0;
	margin: 0 2px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--tfm-error);
}

.tfm .tfm__err:not(:empty) {
	margin-top: 6px;
}

.tfm .is-invalid .tfm__input {
	border-color: var(--tfm-error);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--tfm-error) 10%, transparent);
	animation: tfm-shake .35s ease;
}

@keyframes tfm-shake {
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}

/* Fichas (perfil y línea de producto) */
.tfm .tfm__chips-set {
	min-width: 0;
	margin: 20px 0 0;
	padding: 0;
	border: 0;
}

.tfm .tfm__legend {
	margin: 0 0 10px;
	padding: 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--tfm-title);
}

.tfm .tfm__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tfm .tfm__chip {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.tfm .tfm__chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tfm .tfm__chip span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid var(--tfm-border);
	border-radius: 999px;
	background: var(--tfm-field);
	color: var(--tfm-title);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	transition: border-color .25s ease, background-color .25s ease, color .25s ease, box-shadow .25s ease, transform .2s ease;
}

.tfm .tfm__chip:hover span {
	border-color: color-mix(in srgb, var(--tfm-accent) 45%, var(--tfm-border));
}

.tfm .tfm__chip input:checked + span {
	border-color: var(--tfm-accent);
	background: var(--tfm-accent);
	color: #ffffff;
	box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--tfm-accent) 70%, transparent);
}

.tfm .tfm__chip input:focus-visible + span {
	outline: 2px solid var(--tfm-accent);
	outline-offset: 2px;
}

.tfm .tfm__chip:active span {
	transform: scale(.96);
}

/* Fichas de marca: punto del color de la marca; al elegirla, su color */
.tfm .tfm__chip--brand i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--c);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent);
	transition: background-color .25s ease, box-shadow .25s ease;
}

.tfm .tfm__chip--brand input:checked + span {
	border-color: var(--c);
	background: color-mix(in srgb, var(--c) 10%, #ffffff);
	color: var(--c);
	box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--c) 70%, transparent);
}

.tfm .tfm__chip--brand input:checked + span i {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent), 0 0 8px var(--c);
}

/* Casilla de privacidad */
.tfm .tfm__check {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 12px;
	margin: 22px 0 0;
	font-size: 13px;
	line-height: 1.5;
	cursor: pointer;
}

.tfm .tfm__check input {
	position: absolute;
	opacity: 0;
}

.tfm .tfm__box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	border: 1.5px solid color-mix(in srgb, var(--tfm-text) 60%, transparent);
	border-radius: 5px;
	background: #ffffff;
	color: #ffffff;
	transition: background-color .2s ease, border-color .2s ease;
}

.tfm .tfm__box svg {
	opacity: 0;
	transform: scale(.5);
	transition: opacity .2s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

.tfm .tfm__check input:checked + .tfm__box {
	border-color: var(--tfm-accent);
	background: var(--tfm-accent);
}

.tfm .tfm__check input:checked + .tfm__box svg {
	opacity: 1;
	transform: none;
}

.tfm .tfm__check input:focus-visible + .tfm__box {
	outline: 2px solid var(--tfm-accent);
	outline-offset: 2px;
}

.tfm .tfm__check-text {
	flex: 1 1 0;
	min-width: 0;
}

.tfm .tfm__check-text a {
	color: var(--tfm-accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tfm .tfm__check .tfm__err {
	flex: 0 0 100%;
	margin-left: 32px;
}

.tfm .tfm__check.is-invalid .tfm__box {
	border-color: var(--tfm-error);
	animation: tfm-shake .35s ease;
}

/* Botón con destello y rayo que se carga al enviar */
.tfm button.tfm__submit {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 56px;
	margin: 24px 0 0;
	padding: 0 28px;
	overflow: hidden;
	border: 0;
	border-radius: 8px;
	background: var(--tfm-accent);
	box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--tfm-accent) 80%, transparent);
	color: #ffffff;
	font-family: "Inter", sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background-color .25s ease, box-shadow .25s ease, transform .2s ease;
}

.tfm button.tfm__submit::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -40%;
	width: 30%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
	transform: skewX(-18deg);
	transition: left .7s ease;
}

.tfm button.tfm__submit:hover {
	background: var(--toscano-text-accent, #007b7e);
	color: #ffffff;
	box-shadow: 0 18px 34px -14px color-mix(in srgb, var(--tfm-accent) 90%, transparent);
}

.tfm button.tfm__submit:hover::before {
	left: 120%;
}

.tfm button.tfm__submit:active {
	transform: scale(.99);
}

.tfm button.tfm__submit:focus-visible {
	outline: 2px solid var(--tfm-accent);
	outline-offset: 3px;
}

.tfm .tfm__bolt {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linejoin: round;
}

.tfm button.tfm__submit:hover .tfm__bolt {
	fill: currentColor;
}

.tfm .tfm__form.is-sending button.tfm__submit {
	cursor: progress;
	pointer-events: none;
}

.tfm .tfm__form.is-sending .tfm__bolt {
	fill: none;
	stroke-dasharray: 1;
	animation: tfm-charge .9s ease-in-out infinite;
}

@keyframes tfm-charge {
	0% { stroke-dashoffset: 1; fill-opacity: 0; }
	60% { stroke-dashoffset: 0; fill: currentColor; fill-opacity: 0; }
	100% { stroke-dashoffset: 0; fill: currentColor; fill-opacity: 1; }
}

.tfm .tfm__status {
	margin: 12px 0 0;
	min-height: 0;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
	color: var(--tfm-error);
}

.tfm .tfm__status:empty {
	margin: 0;
}

/* Éxito */
.tfm .tfm__done {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 420px;
	padding: 20px;
	text-align: center;
}

.tfm .tfm__done[hidden] {
	display: none;
}

.tfm .tfm__done-ring,
.tfm .tfm__done-tick {
	stroke: var(--tfm-accent);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
}

.tfm .tfm__done.is-in .tfm__done-ring {
	animation: tfm-draw .8s ease forwards;
	filter: drop-shadow(0 0 6px var(--tfm-accent-2));
}

.tfm .tfm__done.is-in .tfm__done-tick {
	animation: tfm-draw .45s ease .65s forwards;
}

@keyframes tfm-draw {
	to { stroke-dashoffset: 0; }
}

.tfm .tfm__done-text {
	max-width: 380px;
	margin: 22px 0 0;
	font-size: 18px;
	line-height: 1.5;
	color: var(--tfm-title);
}

.tfm button.tfm__again {
	margin-top: 22px;
	padding: 10px 18px;
	border: 1px solid var(--tfm-border);
	border-radius: 6px;
	background: transparent;
	color: var(--tfm-accent);
	font-family: "Inter", sans-serif;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}

.tfm button.tfm__again:hover {
	border-color: var(--tfm-accent);
	background: transparent;
	color: var(--tfm-accent);
}

/* ---------- Entrada (JS: .tfm--js → .is-in) ---------- */

.tfm.tfm--js .tfm__aside > *,
.tfm.tfm--js .tfm__card {
	opacity: 0;
	transform: translateY(24px);
}

.tfm.tfm--js.is-in .tfm__aside > *,
.tfm.tfm--js.is-in .tfm__card {
	opacity: 1;
	transform: none;
	transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}

.tfm.tfm--js.is-in .tfm__aside > :nth-child(2) { transition-delay: .08s; }
.tfm.tfm--js.is-in .tfm__aside > :nth-child(3) { transition-delay: .16s; }
.tfm.tfm--js.is-in .tfm__aside > :nth-child(4) { transition-delay: .24s; }
.tfm.tfm--js.is-in .tfm__aside > :nth-child(5) { transition-delay: .32s; }
.tfm.tfm--js.is-in .tfm__card { transition-delay: .2s; }

/* Los tics de las ventajas se dibujan uno tras otro */
.tfm.tfm--js .tfm__tick-path {
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
}

.tfm.tfm--js.is-in .tfm__tick-path {
	animation: tfm-draw .5s ease forwards;
	animation-delay: calc(.5s + var(--i, 0) * .14s);
}

@media (prefers-reduced-motion: reduce) {
	.tfm .tfm__edge,
	.tfm .tfm__dot::after,
	.tfm .tfm__form.is-sending .tfm__bolt {
		animation: none;
	}

	/* Sin animación, los tics se ven dibujados directamente */
	.tfm .tfm__done-ring,
	.tfm .tfm__done-tick,
	.tfm.tfm--js .tfm__tick-path {
		stroke-dashoffset: 0;
		animation: none !important;
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.tfm .tfm__inner {
		grid-template-columns: minmax(0, 1fr);
	}

	.tfm .tfm__aside {
		max-width: 640px;
	}
}

@media (max-width: 767px) {
	.tfm {
		padding: 72px 0;
	}

	.tfm .tfm__inner {
		gap: 40px;
		padding: 0 16px;
	}

	.tfm .tfm__title {
		font-size: 30px;
	}

	.tfm .tfm__text,
	.tfm .tfm__benefits li {
		font-size: 15px;
	}

	.tfm .tfm__card {
		padding: 30px 18px 24px;
		border-radius: 14px;
	}

	.tfm .tfm__form-title {
		font-size: 24px;
	}

	.tfm .tfm__grid,
	.tfm .tfm__grid--3,
	.tfm .tfm__grid--3.tfm__grid--2 {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
		margin-bottom: 12px;
	}

	/* En móvil, provincia y código postal comparten fila */
	.tfm .tfm__grid--3:not(.tfm__grid--2) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tfm .tfm__grid--3:not(.tfm__grid--2) > :first-child {
		grid-column: 1 / -1;
	}

	.tfm a.tfm__direct-item {
		flex: 1 1 100%;
	}

	.tfm .tfm__done {
		min-height: 340px;
	}
}
