/**
 * Bolsa de Empleo para Elementor — estilos del front.
 *
 * Todo lo que se define aquí son valores por defecto neutros pensados para que
 * los controles de Elementor los sobreescriban sin necesidad de !important.
 * Las variables permiten además ajustar el conjunto desde el CSS del tema.
 */

.be-jobs,
.be-form,
.be-details,
.be-filters {
	--be-border: rgba(0, 0, 0, 0.12);
	--be-muted: rgba(0, 0, 0, 0.6);
	--be-radius: 10px;
	--be-gap: 18px;
	--be-accent: #2563eb;
	--be-success-bg: #e7f6ec;
	--be-success-fg: #14682d;
	--be-error-bg: #fdecec;
	--be-error-fg: #b32020;

	/*
	 * Las tarjetas pueden acabar en columnas muy estrechas, y como la tarjeta
	 * lleva overflow:hidden (para recortar la imagen a sangre contra el radio),
	 * un título largo sin espacios se cortaría en lugar de envolverse.
	 */
	overflow-wrap: break-word;
}

/* ------------------------------------------------------------------ */
/* Listado de vacantes                                                 */
/* ------------------------------------------------------------------ */

.be-jobs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.be-job-card {
	background: #fff;
	border: 1px solid var(--be-border);
	border-radius: var(--be-radius);
	padding: 24px;
	overflow: hidden;
	transition: all 0.25s ease;
}

.be-job-card__image {
	display: block;
	margin: -24px -24px 20px;
	line-height: 0;
}

.be-job-card__image img {
	width: 100%;
	height: auto;
	display: block;
}

.be-job-card__title {
	margin: 0 0 12px;
	font-size: 1.25em;
	line-height: 1.3;
}

.be-job-card__title a {
	color: inherit;
	text-decoration: none;
}

.be-job-card__excerpt {
	margin: 0 0 16px;
	color: var(--be-muted);
}

.be-job-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0 0 16px;
}

.be-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.875em;
	color: var(--be-muted);
	line-height: 1.4;
}

.be-meta-item svg {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.be-badge {
	display: inline-block;
	margin-bottom: 10px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.be-badge--open {
	background: var(--be-success-bg);
	color: var(--be-success-fg);
}

.be-badge--closed {
	background: rgba(0, 0, 0, 0.06);
	color: var(--be-muted);
}

.be-job-card__button {
	display: inline-block;
	padding: 11px 22px;
	border-radius: 8px;
	background: var(--be-accent);
	color: #fff;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: all 0.2s ease;
}

.be-job-card__button:hover,
.be-job-card__button:focus {
	filter: brightness(0.92);
	color: #fff;
}

.be-empty {
	margin: 0;
	padding: 28px;
	border: 1px dashed var(--be-border);
	border-radius: var(--be-radius);
	text-align: center;
	color: var(--be-muted);
}

/* ------------------------------------------------------------------ */
/* Paginación                                                          */
/* ------------------------------------------------------------------ */

.be-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 32px;
}

.be-pagination a,
.be-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--be-border);
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
}

.be-pagination .current {
	background: var(--be-accent);
	border-color: var(--be-accent);
	color: #fff;
}

/* ------------------------------------------------------------------ */
/* Buscador                                                            */
/* ------------------------------------------------------------------ */

.be-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 10px;
	margin-bottom: 24px;
}

.be-filters__field {
	flex: 1 1 180px;
	min-width: 0;
}

.be-filters__field--search {
	flex: 2 1 260px;
}

.be-filters input,
.be-filters select {
	width: 100%;
	height: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid var(--be-border);
	border-radius: 8px;
	background: #fff;
	color: inherit;
	font: inherit;
}

.be-filters__submit {
	flex: 0 0 auto;
	min-height: 46px;
	padding: 10px 24px;
	border: 0;
	border-radius: 8px;
	background: var(--be-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.be-filters__submit:hover {
	filter: brightness(0.92);
}

/* ------------------------------------------------------------------ */
/* Datos de la vacante                                                 */
/* ------------------------------------------------------------------ */

.be-details {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.be-detail {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	--be-detail-pad: 10px;
}

.be-detail svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	margin-top: 2px;
	color: var(--be-accent);
}

.be-detail__content {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.be-detail__label {
	font-size: 0.8em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--be-muted);
}

.be-detail__value {
	font-weight: 600;
}

.be-details__cta {
	display: inline-block;
	margin-top: 20px;
	padding: 13px 26px;
	border-radius: 8px;
	background: var(--be-accent);
	color: #fff;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: all 0.2s ease;
}

.be-details__cta:hover,
.be-details__cta:focus {
	filter: brightness(0.92);
	color: #fff;
}

.be-details__cta--disabled {
	background: rgba(0, 0, 0, 0.35);
	cursor: not-allowed;
	pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Formulario                                                          */
/* ------------------------------------------------------------------ */

.be-form__grid {
	display: flex;
	flex-wrap: wrap;
	margin: calc(var(--be-gap) / -2);
}

.be-field {
	width: 100%;
	padding: calc(var(--be-gap) / 2);
	box-sizing: border-box;
}

.be-field__label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 0.9375em;
}

.be-required {
	color: #d63638;
}

.be-form input:not([type="checkbox"]):not([type="file"]),
.be-form select,
.be-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--be-border);
	border-radius: 8px;
	background: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.4;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.be-form textarea {
	min-height: 130px;
	resize: vertical;
}

.be-form input:focus,
.be-form select:focus,
.be-form textarea:focus {
	outline: none;
	border-color: var(--be-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.be-field--error input,
.be-field--error select,
.be-field--error textarea {
	border-color: #d63638;
}

.be-field__error {
	display: block;
	margin-top: 6px;
	font-size: 0.8125em;
	color: #d63638;
}

/* Casillas. */

.be-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
}

.be-check input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	flex: 0 0 auto;
	accent-color: var(--be-accent);
}

.be-check__text {
	font-size: 0.9em;
	line-height: 1.5;
	color: var(--be-muted);
}

.be-check__text a {
	color: var(--be-accent);
}

/* Subida del CV. */

.be-dropzone {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 28px 20px;
	border: 2px dashed var(--be-border);
	border-radius: var(--be-radius);
	background: rgba(0, 0, 0, 0.015);
	text-align: center;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.be-dropzone input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.be-dropzone.is-dragover {
	border-color: var(--be-accent);
	background: rgba(37, 99, 235, 0.05);
}

.be-dropzone.has-file {
	border-style: solid;
	border-color: var(--be-success-fg);
}

.be-dropzone__text {
	font-weight: 600;
}

.be-dropzone__hint {
	font-size: 0.8125em;
	color: var(--be-muted);
}

.be-dropzone--simple {
	flex-direction: row;
	justify-content: flex-start;
	padding: 12px 16px;
	border-style: solid;
	text-align: left;
	gap: 12px;
}

/* Honeypot: fuera de la vista pero presente en el DOM. */

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

/* Acciones. */

.be-form__actions {
	display: flex;
	margin-top: 8px;
}

.be-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 13px 30px;
	border: 0;
	border-radius: 8px;
	background: var(--be-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.be-form__submit:hover,
.be-form__submit:focus {
	filter: brightness(0.92);
}

.be-form__submit[disabled] {
	cursor: wait;
	opacity: 0.75;
}

.be-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: be-spin 0.7s linear infinite;
}

.be-form.is-sending .be-spinner {
	display: inline-block;
}

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

@media (prefers-reduced-motion: reduce) {
	.be-spinner {
		animation-duration: 2s;
	}

	.be-job-card,
	.be-form__submit,
	.be-job-card__button {
		transition: none;
	}
}

/* Avisos. */

.be-notice {
	padding: 16px 20px;
	border-radius: var(--be-radius);
	margin-bottom: 20px;
}

.be-notice--success {
	background: var(--be-success-bg);
	color: var(--be-success-fg);
}

.be-notice--error {
	background: var(--be-error-bg);
	color: var(--be-error-fg);
}

.be-notice--closed {
	background: rgba(0, 0, 0, 0.05);
	color: var(--be-muted);
}

/* Aviso visible solo dentro del editor de Elementor. */

.be-editor-notice {
	padding: 20px;
	border: 1px dashed #9da5ae;
	border-radius: var(--be-radius, 10px);
	background: #f7f8f9;
	color: #4a5057;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

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

@media (max-width: 1024px) {
	.be-jobs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.be-jobs {
		grid-template-columns: 1fr;
	}

	.be-field {
		width: 100%;
	}

	.be-filters__field,
	.be-filters__submit {
		flex: 1 1 100%;
	}
}
