/*
 * Formulario de contacto de /contact/ (CU-1amdve2dtpx).
 * Diseño aprobado: Figma Codezy 4FeD5NZj03c9UyUDRmeeqf, tarjeta 2332:251 y estados 2332:2 / 2334:*.
 * La estructura está en Elementor (página contact); aquí solo el aspecto y los estados.
 * Clases que pone Elementor: .cz-contact-card (contenedor), .cz-contact-form (widget de formulario),
 * .cz-contact-states (HTML con el aviso de error y el «enviado») y .cz-contact-note (texto bajo el botón).
 */

.cz-contact-card {
	--cz-text: #272727;
	--cz-muted: #737373;
	--cz-soft: #535353;
	--cz-placeholder: #9CA3AF;
	--cz-line: #D4D4D4;
	--cz-error: #D23B2F;
	--cz-button: #171717;
	--cz-button-text: #F9F9F9;

	background: #FFFFFF;
	border: 1px solid #E5E5E5;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	padding: 64px 64px 80px !important;
	gap: 32px !important;
	margin-top: 40px;
	color: var(--cz-text);
}

@media (max-width: 767px) {
	.cz-contact-card {
		padding: 32px 20px 40px !important;
		margin-top: 24px;
	}
}

/* ---------- Campos ---------- */

.cz-contact-form .elementor-form-fields-wrapper {
	margin-left: -16px;
	margin-right: -16px;
	margin-bottom: -32px;
}

.cz-contact-form .elementor-field-group {
	padding-left: 16px !important;
	padding-right: 16px !important;
	margin-bottom: 32px !important;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
}

.cz-contact-form .elementor-field-label {
	font-family: "Codezy", sans-serif;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--cz-muted) !important;
	padding: 0 0 8px !important;
	margin: 0;
}

.cz-contact-form .elementor-field-group .elementor-field-textual,
.cz-contact-form .elementor-field-group select {
	font-family: "Codezy", sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: var(--cz-text) !important;
	-webkit-text-fill-color: currentColor !important;
	background-color: transparent !important;
	border: 0 !important;
	border-bottom: 1px solid var(--cz-line) !important;
	border-radius: 0 !important;
	padding: 12px 0 !important;
	min-height: 48px;
	box-shadow: none !important;
	outline: none;
	transition: border-color 0.15s ease;
}

.cz-contact-form .elementor-field-group .elementor-field-textual::placeholder {
	font-size: 16px;
	color: var(--cz-placeholder);
	-webkit-text-fill-color: var(--cz-placeholder) !important;
	opacity: 1;
}

.cz-contact-form .elementor-field-group .elementor-field-textual:focus,
.cz-contact-form .elementor-field-group select:focus {
	border-bottom-color: var(--cz-text) !important;
}

.cz-contact-form .elementor-field-group .elementor-field-textual:focus-visible,
.cz-contact-form .elementor-field-group select:focus-visible {
	outline: 2px solid var(--cz-text);
	outline-offset: 2px;
}

.cz-contact-form input.elementor-field-textual:-webkit-autofill {
	-webkit-text-fill-color: var(--cz-text) !important;
	-webkit-box-shadow: 0 0 0 1000px #FFFFFF inset !important;
}

.cz-contact-form textarea.elementor-field-textual {
	min-height: 97px;
	padding-bottom: 24px !important;
	resize: vertical;
}

/* Desplegable de presupuesto: chevron propio y texto gris mientras no se elige nada */
.cz-contact-form .elementor-select-wrapper .select-caret-down-wrapper {
	display: none;
}

.cz-contact-form .elementor-select-wrapper select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 28px !important;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0 center;
	background-size: 16px 16px;
}

.cz-contact-form .elementor-select-wrapper select.cz-empty {
	color: var(--cz-placeholder) !important;
}

.cz-contact-form .elementor-select-wrapper select option {
	color: var(--cz-text);
}

/* ---------- Consentimiento RGPD ---------- */

.cz-contact-form .elementor-field-type-acceptance {
	margin-bottom: 12px !important;
}

.cz-contact-form .elementor-field-type-acceptance .elementor-field-option {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.cz-contact-form .elementor-field-type-acceptance input[type="checkbox"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	border: 1px solid var(--cz-muted);
	border-radius: 0;
	background-color: #FFFFFF !important;
	cursor: pointer;
	position: relative;
}

.cz-contact-form .elementor-field-type-acceptance input[type="checkbox"]:checked {
	background-color: var(--cz-text) !important;
	border-color: var(--cz-text);
}

.cz-contact-form .elementor-field-type-acceptance input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid #FFFFFF;
	border-width: 0 1.5px 1.5px 0;
	transform: rotate(45deg);
}

.cz-contact-form .elementor-field-type-acceptance input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--cz-text);
	outline-offset: 2px;
}

.cz-contact-form .elementor-field-type-acceptance label {
	font-family: "Codezy", sans-serif;
	font-size: 14px;
	line-height: 20px;
	color: var(--cz-text);
	cursor: pointer;
	text-transform: none;
	letter-spacing: 0;
}

.cz-contact-form .elementor-field-type-acceptance a,
.cz-contact-form .elementor-field-type-html a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cz-contact-form .elementor-field-type-html {
	font-family: "Codezy", sans-serif;
	font-size: 12px;
	line-height: 18px;
	color: var(--cz-muted);
}

/* ---------- Botón ---------- */

.cz-contact-form .elementor-field-type-submit {
	margin-bottom: 32px !important;
}

.cz-contact-form .elementor-button[type="submit"] {
	width: 100%;
	background: var(--cz-button) !important;
	color: var(--cz-button-text) !important;
	border: 0;
	border-radius: 0;
	padding: 20px 24px !important;
	min-height: 69px;
	font-family: "Codezy-mono", sans-serif;
	font-size: 12.5px;
	line-height: 28.8px;
	text-transform: uppercase;
	letter-spacing: 0;
	transition: background-color 0.15s ease;
}

.cz-contact-form .elementor-button[type="submit"]:hover {
	background: #272727CC !important;
}

.cz-contact-form .elementor-button[type="submit"]:focus-visible {
	outline: 2px solid var(--cz-text);
	outline-offset: 3px;
}

.cz-contact-form .elementor-button-content-wrapper {
	gap: 12px;
	align-items: center;
	justify-content: center;
}

.cz-contact-form .elementor-button-icon svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* ---------- Validación ---------- */

.cz-contact-form .elementor-field-group.cz-invalid .elementor-field-textual,
.cz-contact-form .elementor-field-group.cz-invalid .elementor-field-textual:focus {
	border-bottom-color: var(--cz-error) !important;
}

.cz-contact-form .cz-invalid input[type="checkbox"] {
	border-color: var(--cz-error);
}

.cz-contact-form .cz-field-error,
.cz-contact-form .elementor-form-help-inline {
	display: block;
	font-family: "Codezy", sans-serif;
	font-size: 12px;
	line-height: 16px;
	color: var(--cz-error) !important;
	margin-top: 8px;
}

/* Elementor pinta sus propios avisos (éxito/error) debajo del formulario: el diseño usa los de .cz-contact-states */
.cz-contact-form .elementor-message {
	display: none !important;
}

/* ---------- Enviando ---------- */

.cz-contact-form .elementor-form.elementor-form-waiting {
	opacity: 1 !important;
}

.cz-contact-form .elementor-form-waiting .elementor-field-group:not(.elementor-field-type-submit) {
	opacity: 0.5;
	pointer-events: none;
}

.cz-contact-form .elementor-form-spinner {
	display: none !important;
}

.cz-contact-form .cz-sending .elementor-button-icon {
	display: none;
}

.cz-contact-form .cz-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 1.5px solid rgba(249, 249, 249, 0.35);
	border-top-color: #F9F9F9;
	border-radius: 50%;
	animation: cz-spin 0.8s linear infinite;
}

@keyframes cz-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cz-contact-form .cz-spinner {
		animation-duration: 2.4s;
	}
}

/* ---------- Aviso de error de envío y «enviado» ---------- */

.cz-contact-states:empty,
.cz-contact-card .cz-contact-states .elementor-widget-container:empty {
	display: none;
}

.cz-contact-card .cz-contact-states {
	margin: 0 !important;
}

.cz-contact-alert[hidden],
.cz-contact-success[hidden] {
	display: none !important;
}

.cz-contact-alert {
	display: flex;
	gap: 12px;
	padding: 16px;
	border: 1px solid var(--cz-error);
	background: #FFFFFF;
	font-family: "Codezy", sans-serif;
	font-size: 14px;
	line-height: 20px;
	color: var(--cz-soft);
}

.cz-contact-alert svg {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
}

.cz-contact-alert__title {
	margin: 0 0 4px;
	font-weight: 500;
	color: var(--cz-text);
}

.cz-contact-alert__text {
	margin: 0;
}

.cz-contact-alert a,
.cz-contact-success a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cz-contact-success {
	outline: none;
}

.cz-contact-success svg {
	display: block;
	width: 40px;
	height: 40px;
	margin-bottom: 24px;
}

.cz-contact-success__eyebrow {
	margin: 0 0 8px;
	font-family: "Codezy-mono", sans-serif;
	font-size: 16px;
	line-height: 20.8px;
	text-transform: uppercase;
	color: var(--cz-soft);
}

.cz-contact-success__title {
	margin: 0 0 24px;
	font-family: "Codezy", sans-serif;
	font-weight: 700;
	font-size: 33px;
	line-height: 44px;
	color: var(--cz-text);
}

.cz-contact-success__text {
	margin: 0 0 24px;
	font-family: "Codezy", sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: var(--cz-soft);
	overflow-wrap: anywhere;
}

.cz-contact-success__again,
.cz-contact-success__again:hover,
.cz-contact-success__again:focus,
.cz-contact-success__again:active {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none !important;
	color: var(--cz-text) !important;
	font-family: "Codezy-mono", sans-serif;
	font-size: 12.5px;
	line-height: 28.8px;
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-offset: 3px;
	color: var(--cz-text);
	cursor: pointer;
}

.cz-contact-success__again:focus-visible {
	outline: 2px solid var(--cz-text);
	outline-offset: 3px;
}

@media (max-width: 767px) {
	.cz-contact-success__title {
		font-size: 28px;
		line-height: 32px;
	}
}

/* Con el «enviado» a la vista se ocultan el formulario y la nota de debajo */
.cz-contact-card.cz-is-sent .cz-contact-form,
.cz-contact-card.cz-is-sent .cz-contact-note {
	display: none;
}

.cz-contact-note,
.cz-contact-note p {
	margin: 0 !important;
	font-family: "Codezy", sans-serif;
	font-size: 12px;
	line-height: 16px;
	color: #737373;
}

/* ---------- Email y teléfono de la columna derecha (enlaces mailto:/tel:) ---------- */

.codezy-single-page__contact-us .cz-contact-link {
	color: inherit;
	text-decoration: none;
}

.codezy-single-page__contact-us .cz-contact-link:hover,
.codezy-single-page__contact-us .cz-contact-link:focus-visible {
	text-decoration: underline;
	text-underline-offset: 6px;
}

@media (max-width: 767px) {
	.codezy-single-page__contact-us .cz-contact-link {
		text-decoration: underline;
		text-underline-offset: 4px;
	}
}

/* ---------- Tablet (768–1024 px), QA de CU-1amdve2dtpx ----------
 * El diseño no tiene tablet. En dos columnas la tarjeta se quedaba en 320–440 px y Nombre y Email,
 * al 50 %, cortaban los marcadores. Por debajo de 1025 px las dos columnas se apilan, como en móvil,
 * y la tarjeta ocupa todo el ancho: Nombre y Email siguen al 50 % (cada uno ≥ 280 px) desde 768 px.
 */
@media (min-width: 768px) and (max-width: 1024px) {
	.codezy-single-page__contact-us {
		flex-direction: column !important;
		row-gap: 40px !important;
	}

	.codezy-single-page__contact-us > .e-con,
	.codezy-single-page__contact-us > .e-con-inner > .e-con {
		width: 100% !important;
		max-width: 100% !important;
	}

	.cz-contact-card {
		padding: 48px 48px 64px !important;
	}
}

/* Si aun así la tarjeta queda estrecha (zoom, ventanas raras), Nombre y Email uno debajo del otro.
 * Mide el contenido sin el padding: a 1440 px son ~500 px y se quedan al 50 %, como en el diseño. */
@container cz-card (max-width: 420px) {
	.cz-contact-form .elementor-field-group.elementor-col-50 {
		width: 100% !important;
		flex-basis: 100% !important;
		max-width: 100% !important;
	}
}

.cz-contact-card {
	container: cz-card / inline-size;
}

/* Foco del aviso de error y del «enviado» (reciben focus() por accesibilidad): anillo propio, no el del navegador */
.cz-contact-alert:focus,
.cz-contact-success:focus {
	outline: none;
}

.cz-contact-alert:focus-visible,
.cz-contact-success:focus-visible {
	outline: 2px solid #272727;
	outline-offset: 4px;
}
