/*
 * Formulario de contacto por pasos — resources/views/contacto.blade.php
 * Diseño: Figma GOYA-WEB › OPTIMIZACIÓN 2026 › contacto
 * Todas las clases llevan el prefijo .cf para no afectar a otros formularios.
 */

.cf-section {
	--cf-blue: #0c4893;
	--cf-blue-dark: #063977;
	--cf-text: #000;
	--cf-muted: #6b6b6b;      /* Figma usa #9A9A9A / opacidad 10%: no llega a 4.5:1 sobre blanco */
	--cf-error: #c8102e;      /* 5.9:1 sobre blanco */
	--cf-track: rgba(6, 57, 119, .1);
	--cf-tracking: -0.015em;

	padding-top: 48px;
	padding-bottom: 93px;
	color: var(--cf-text);
	letter-spacing: var(--cf-tracking);
}

.cf-section + .mapa-contacto {
	margin-top: 0;
}

.cf [hidden],
.cf-section [hidden] {
	display: none !important;
}

.cf-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------- Introducción ---------- */

.cf-intro__title {
	font-family: Bitter, serif;
	font-weight: 700;
	font-size: 33px;
	line-height: 45px;
	letter-spacing: var(--cf-tracking);
	margin: 0 0 14px;
}

.cf-intro p {
	font-size: 16px;
	line-height: 23px;
	margin: 0 0 16px;
}

.cf-intro p.cf-intro__thanks {
	font-weight: 700;
	margin: 0;
}

/* ---------- Contenedor del formulario ---------- */

.contact-form.cf {
	max-width: 922px;
	margin-left: 8.3333%;
	padding: 0;
	background: transparent;
	-webkit-box-shadow: none;
	box-shadow: none;
	scroll-margin-top: 140px; /* cabecera fija al saltar de paso */
}

.cf-fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

/* ---------- Progreso ---------- */

.cf-progress {
	display: flex;
	justify-content: center;
	gap: 45px;
	list-style: none;
	margin: 65px 0 60px;
	padding: 0;
	align-items: flex-end;
}

.cf-progress__item {
	display: flex;
	flex-direction: column;
	gap: 11px;
	width: 178px;
	font-size: 14px;
	line-height: 19px;
	text-align: center;
	color: var(--cf-muted);
}

.cf-progress__item::after {
	content: '';
	display: block;
	height: 8px;
	border-radius: 4px;
	background: var(--cf-track);
}

.cf-progress__item.is-current {
	color: var(--cf-text);
	font-weight: 500;
}

.cf-progress__item.is-current::after {
	background: var(--cf-blue-dark);
}

/* ---------- Pasos ---------- */

.cf-back {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 26px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--cf-blue);
	font-size: 14px;
	font-weight: 600;
	line-height: 16px;
	letter-spacing: var(--cf-tracking);
	text-transform: uppercase;
	cursor: pointer;
}

.cf-back img {
	transform: rotate(180deg);
}

.cf-back:hover {
	color: var(--cf-blue-dark);
	text-decoration: underline;
}

.cf-step__legend {
	float: none;
	width: 100%;
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
}

/* El paso 1 no tiene "Atrás": se reserva su espacio para que el título no salte */
.cf-step[data-step="motivo"] .cf-step__legend {
	padding-top: 42px;
}

.contact-form.cf .cf-step__title {
	font-family: 'Work Sans', sans-serif;
	font-weight: 600;
	font-size: 22px;
	line-height: 26px;
	letter-spacing: var(--cf-tracking);
	text-transform: uppercase;
	color: var(--cf-text);
	margin: 0 0 29px;
	padding: 0;
}

.cf-step__title:focus {
	outline: none !important;
}

/* ---------- Rejilla y campos ---------- */

.cf-grid,
.cf-col {
	display: grid;
	gap: 20px;
}

.cf-grid--2 {
	grid-template-columns: 1fr 1fr;
	column-gap: 31px;
}

.cf-step[data-step="motivo"] .cf-field {
	max-width: 444px;
}

.cf-field {
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-width: 0;
}

.cf-label {
	margin: 0;
	font-size: 16px;
	line-height: 23px;
	font-weight: 400;
	color: var(--cf-text);
}

.cf .cf-input {
	display: block;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 8px 10px;
	border: 1px solid var(--cf-blue);
	border-radius: 6px;
	background-color: #fff;
	color: var(--cf-text);
	font-family: 'Work Sans', sans-serif;
	font-size: 16px;
	line-height: 23px;
	letter-spacing: var(--cf-tracking);
}

.cf .cf-input::placeholder {
	color: var(--cf-muted);
	opacity: 1;
}

.cf .cf-input:hover {
	border-color: var(--cf-blue-dark);
}

/* Foco: solo grosor de borde (1px → 3px) en el color del estado, sin contorno ni halo.
   WCAG 2.4.7 (AA) y 2.4.13 (AAA): los 2px añadidos pasan de blanco a azul (8.9:1) o a rojo (5.9:1).
   El padding se reduce 2px para que el campo no cambie de tamaño. */
.cf .cf-input:focus,
.cf .cf-input:focus-visible {
	outline: none !important;
	border-width: 3px;
	padding: 6px 8px;
}

.cf .cf-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 36px;
	background-image: url(/assets/img/contacto/cf-chevron-down.svg);
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px 7.41px;
	cursor: pointer;
}

.cf .cf-select:focus {
	padding-right: 34px;
}

/* Opción vacía ("Selecciona una opción") con el mismo color que un placeholder */
.cf .cf-select:invalid {
	color: var(--cf-muted);
}

.cf .cf-select option {
	color: var(--cf-text);
}

.cf-field--textarea .cf-textarea {
	flex: 1 1 auto;
	height: auto;
	min-height: 160px;
	resize: vertical;
}

/* ---------- Errores ---------- */

/* Error en reposo: borde de 1px rojo + fondo suave; al enfocar pasa a 2px rojo.
   No depende solo del color: lo acompañan el mensaje de texto y aria-invalid. */
.cf .cf-field--error .cf-input {
	border-color: var(--cf-error);
	background-color: #fff7f8;
}

.cf-error {
	margin: 0;
	color: var(--cf-error);
	font-size: 14px;
	line-height: 19px;
}

/* ---------- Casilla de privacidad ---------- */

.cf-field--check {
	margin-top: 29px;
}

.cf-check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

/* Anula el checkbox global de style.css (visibility:hidden + pseudoelementos) */
.cf .cf-check__input {
	visibility: visible;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	flex-shrink: 0;
	position: relative;
	width: 25px;
	height: 25px;
	margin: 0;
	border: 2px solid var(--cf-blue);
	border-radius: 2px;
	background: #fff center / 15px 12px no-repeat;
	cursor: pointer;
}

.cf .cf-check__input::before,
.cf .cf-check__input::after {
	content: none;
	display: none;
}

.cf .cf-check__input:checked {
	background-color: var(--cf-blue);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 12'%3E%3Cpath d='M1.5 6.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.cf .cf-check__input:focus-visible {
	outline: 3px solid var(--cf-blue-dark) !important;
	outline-offset: 2px;
}

.cf .cf-field--error .cf-check__input {
	border-color: var(--cf-error);
}

.cf .cf-field--error .cf-check__input:focus-visible {
	outline-color: var(--cf-error) !important;
}

.cf-check__label {
	margin: 0;
	padding-top: 1px;
	font-size: 16px;
	line-height: 23px;
	cursor: pointer;
}

.cf-check__label a {
	color: inherit;
	text-decoration: underline;
}

.cf-check__label a:hover {
	color: var(--cf-blue);
}

/* ---------- reCAPTCHA ---------- */

.cf-captcha {
	margin-top: 26px;
	min-height: 78px;
}

/* ---------- Acciones ---------- */

.cf-actions {
	margin-top: 45px;
}

.cf-required-note {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 19px;
}

.cf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 41px;
	padding: 0 16px;
	border: 0;
	border-radius: 6px;
	background: var(--cf-blue);
	color: #fff;
	font-family: 'Work Sans', sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: var(--cf-tracking);
	text-transform: uppercase;
	cursor: pointer;
}

.cf-btn:hover {
	background: var(--cf-blue-dark);
}

.cf .cf-btn:focus-visible,
.cf .cf-back:focus-visible {
	outline: 3px solid var(--cf-blue-dark) !important;
	outline-offset: 2px;
}

.cf .error_msg:empty {
	display: none;
}

/* ---------- Modal de gracias (SweetAlert2 v7 del site: prefijo de clases "sweal2-") ---------- */

.sweal2-popup.cf-swal {
	/* el modal se pinta fuera de .cf-section: necesita sus propias variables */
	--cf-blue: #0c4893;
	--cf-blue-dark: #063977;
	--cf-tracking: -0.015em;
	padding: 32px;
	border-radius: 6px;
	font-family: 'Work Sans', sans-serif;
	letter-spacing: -0.015em;
}

.cf-swal .sweal2-title {
	font-family: Bitter, serif;
	font-weight: 700;
	font-size: 26px;
	line-height: 32px;
	color: #000;
}

.cf-swal .sweal2-content {
	font-size: 16px;
	line-height: 23px;
	color: #000;
}

.cf-swal .sweal2-content p {
	margin: 0 0 12px;
}

.cf-swal .sweal2-actions {
	margin-top: 16px;
}

.sweal2-popup.cf-swal .sweal2-close {
	color: var(--cf-blue);
}

.sweal2-popup.cf-swal .sweal2-close:hover {
	color: var(--cf-blue-dark);
}

.sweal2-popup.cf-swal:focus {
	outline: none;
}

.sweal2-popup.cf-swal .cf-btn:focus-visible,
.sweal2-popup.cf-swal .sweal2-close:focus-visible {
	outline: 3px solid #063977 !important;
	outline-offset: 2px;
}

/* ---------- Responsive: una columna ---------- */

@media (max-width: 991px) {
	.contact-form.cf {
		margin-left: 0;
	}

	.cf-grid--2 {
		grid-template-columns: 1fr;
	}

	.cf-step[data-step="motivo"] .cf-field {
		max-width: none;
	}
}

@media (max-width: 767px) {
	.cf-section {
		padding-top: 24px;
		padding-bottom: 56px;
	}

	.cf-intro__title {
		font-size: 28px;
		line-height: 36px;
	}

	.cf-progress {
		gap: 12px;
		margin: 40px 0 32px;
	}

	.cf-progress__item {
		flex: 1 1 0;
		width: auto;
		max-width: 178px;
	}

	.cf-step[data-step="motivo"] .cf-step__legend {
		padding-top: 0;
	}

	.contact-form.cf .cf-step__title {
		font-size: 20px;
		line-height: 24px;
		margin-bottom: 24px;
	}

	.cf-actions {
		margin-top: 32px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cf-section * {
		transition: none !important;
		animation: none !important;
	}
}
