/*
Theme Name: GPS Laboral (Child)
Template: twentytwentyfive
Description: Tema child de Twenty Twenty-Five para GPS Laboral. Las updates del parent no rompen este child.
Version: 1.0.1
*/

/* ============================================================
   ESTILOS DEL FORMULARIO CF7 — integrados con Twenty Twenty-Five
   Usan variables del theme.json para heredar cambios de marca.
   ============================================================ */

/* ----- Base del formulario ----- */
.wpcf7-form {
	font-family: var(--wp--preset--font-family--manrope, "Manrope", sans-serif);
	color: var(--wp--preset--color--contrast, #111111);
	line-height: 1.6;
}

/* Etiquetas — coherentes con los estilos del tema */
.wpcf7-form label {
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--wp--preset--color--contrast, #111111);
	margin-bottom: 0.35rem;
}

/* Inputs, selects, textareas */
.wpcf7-form-control {
	width: 100%;
	padding: 0.75rem 0.875rem;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--wp--preset--color--contrast, #111111);
	background-color: var(--wp--preset--color--base, #FFFFFF);
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpcf7-form-control:focus {
	border-color: var(--wp--preset--color--accent-3, #503AA8);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--accent-3, #503AA8) 25%, transparent);
}

/* Textarea más alto */
.wpcf7-form textarea.wpcf7-form-control {
	resize: vertical;
	min-height: 110px;
}

/* ----- Checkbox consentimiento marketing ----- */
.wpcf7-form .wpcf7-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 1rem 0 1.25rem;
}

.wpcf7-form .wpcf7-checkbox input[type="checkbox"] {
	width: 1.15rem;
	height: 1.15rem;
	margin-top: 0.15rem;
	accent-color: var(--wp--preset--color--accent-3, #503AA8);
	flex-shrink: 0;
}

.wpcf7-form .wpcf7-checkbox .wpcf7-list-item {
	font-size: 0.9rem;
	color: var(--wp--preset--color--contrast, #111111);
	line-height: 1.4;
}

/* ----- Botón enviar ----- */
.wpcf7-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.85rem 1.5rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.3;
	color: #FFFFFF;
	background-color: var(--wp--preset--color--accent-3, #503AA8);
	border: none;
	border-radius: 0.5rem;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
}

.wpcf7-submit:hover {
	background-color: color-mix(in srgb, var(--wp--preset--color--accent-3, #503AA8) 85%, black);
}

.wpcf7-submit:active {
	transform: translateY(1px);
}

.wpcf7-submit:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ----- Spinner de envío centrado ----- */
.wpcf7-submit.has-spinner {
	position: relative;
}
.wpcf7-submit .wpcf7-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: wpcf7-spin 0.6s linear infinite;
	opacity: 0;
	transition: opacity 0.15s ease;
}
.wpcf7-submit.has-spinner .wpcf7-spinner {
	opacity: 1;
}
.wpcf7-submit.has-spinner .wpcf7-spinner:only-child {
	/* Si el botón solo tiene el spinner (sin texto) */
	margin: 0;
}
@keyframes wpcf7-spin {
	from { transform: translate(-50%, -50%) rotate(0deg); }
	to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ----- Mensajes de validación y estado ----- */
.wpcf7-response-output {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
	border-radius: 0.5rem;
	font-size: 0.95rem;
	line-height: 1.4;
	border: 1px solid transparent;
}

.wpcf7-validation-errors,
.wpcf7-mail-sent-ng,
.wpcf7-spam-blocked {
	background-color: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

.wpcf7-mail-sent-ok {
	background-color: #f0fdf4;
	border-color: #bbf7d0;
	color: #166534;
}

/* Tip de error junto al campo */
.wpcf7-not-valid-tip {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.85rem;
	color: #dc2626;
	line-height: 1.3;
}

/* Campo con error de validación */
.wpcf7-form-control.wpcf7-not-valid {
	border-color: #dc2626;
	background-color: #fff5f5;
}

/* ----- Honeypot (defensa en profundidad) ----- */
.antispam-wrap {
	position: absolute !important;
	opacity: 0 !important;
	height: 0 !important;
	width: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	pointer-events: none !important;
}

/* ----- Contenedor de la página Contacto ----- */
.postid-108 .entry-content,
.page-id-108 .entry-content {
	max-width: 680px;
	margin-left: auto;
	margin-right: auto;
}

/* ----- Formulario centrado y alineado ----- */
.wpcf7-form {
	max-width: 480px;
	margin-left: auto !important;
	margin-right: auto !important;
	padding: 0 1rem;
}

.wpcf7-form > p,
.wpcf7-form > .wpcf7-form-control-wrap,
.wpcf7-form > .wpcf7-checkbox,
.wpcf7-form > .gatecha-widget-wrap,
.wpcf7-form > .wpcf7-submit,
.wpcf7-form > .wpcf7-response-output {
	margin-left: auto !important;
	margin-right: auto !important;
	max-width: 100%;
	width: 100%;
}

.wpcf7-submit {
	max-width: 100%;
}

.wpcf7-form .wpcf7-checkbox {
	justify-content: flex-start;
}

.wpcf7-form .wpcf7-list-item {
	width: 100%;
}

/* ----- Párrafo del submit: spinner + botón centrados ----- */
.wpcf7-form > p:has(.wpcf7-submit) {
	position: relative;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	min-height: 3rem;
}

.wpcf7-form > p:has(.wpcf7-submit) .wpcf7-submit {
	width: 100%;
	max-width: 100%;
	position: relative;
}

.wpcf7-form > p:has(.wpcf7-submit) .wpcf7-spinner {
	position: absolute !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	margin: 0 !important;
	width: 1.25rem !important;
	height: 1.25rem !important;
	border: 2px solid currentColor !important;
	border-right-color: transparent !important;
	border-radius: 50% !important;
	opacity: 1 !important;
	animation: wpcf7-spin 0.6s linear infinite !important;
	z-index: 2;
}

@keyframes wpcf7-spin {
	from { transform: translate(-50%, -50%) rotate(0deg); }
	to   { transform: translate(-50%, -50%) rotate(360deg); }
}
