/* formularios-42K.css
 * Estilos para los formularios de contacto, eventos y zona custom.
 * Prefijo .k42-form-* para no colisionar con WooCommerce ni Gravity Forms.
 * Usa variables CSS del theme (--principal, --oscuro, --menos-oscuro, etc.).
 */

/* ============================================================
   Contenedor y wrapper
   ============================================================ */

.k42-form-wrapper {
	max-width: 680px;
	/* Aire por arriba: en las páginas custom el formulario va justo debajo de la
	   tarjeta de condiciones y sin margen queda pegado a ella. */
	margin: 2.5rem auto 0;
}

.k42-form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

/* El display de autor le gana al display:none del atributo hidden: sin esta
   regla, el "gracias" se pintaba DEBAJO del formulario en vez de sustituirlo. */
.k42-form[hidden] {
	display: none !important;
}

/* ============================================================
   Campos individuales
   ============================================================ */

/* El senuelo antirrobots: fuera de la vista y fuera del foco, pero no `display:none`,
   que es justo lo que un robot mira para saltarselo. */
.k42-form__senuelo {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.k42-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.k42-form__field[hidden] {
	display: none !important;
}

.k42-form__label {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--oscuro, #222);
}

.k42-form__required {
	color: var(--principal, #e84924);
	margin-left: 2px;
}

.k42-form__input {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid #ccc;
	border-radius: 3px;
	font-size: 1rem;
	color: var(--oscuro, #222);
	background: var(--blanco, #fff);
	transition: border-color 0.2s;
	box-sizing: border-box;
}

.k42-form__input:focus {
	outline: none;
	border-color: var(--principal, #e84924);
	box-shadow: 0 0 0 2px rgba(232, 73, 36, 0.15);
}

.k42-form__input.k42-form__input--error {
	border-color: #d32f2f;
}

textarea.k42-form__input {
	resize: vertical;
	min-height: 120px;
}

/* La página de contacto pinta el selector de perfil dentro de un bloque flex
   del theme (.dos-bloques .bloque, flex column): ahí el margin:auto del wrapper
   le gana al stretch y el bloque encogía a su contenido y quedaba CENTRADO.
   Ancho completo para que el desplegable quede a la izquierda, alineado con
   los formularios que conmuta (25-ago-2026). */
.k42-perfil-wrapper {
	width: 100%;
}

/* Párrafo explicativo bajo el selector de perfil; el JS lo oculta al elegir. */
.k42-perfil-intro {
	margin-top: 1.25rem;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--menos-oscuro, #5d5d5d);
}

.k42-perfil-intro[hidden] {
	display: none !important;
}

select.k42-form__input {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	padding-right: 2.25rem;
}

/* ============================================================
   Grupos radio / checkbox
   ============================================================ */

.k42-form__radio-group,
.k42-form__checkbox-group {
	border: none;
	padding: 0;
	margin: 0;
}

.k42-form__radio-group legend,
.k42-form__checkbox-group legend {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--oscuro, #222);
	margin-bottom: 0.4rem;
	float: none;
	width: 100%;
}

.k42-form__radio-label,
.k42-form__checkbox-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.95rem;
	cursor: pointer;
	padding: 0.15rem 0;
}

.k42-form__radio-label input,
.k42-form__checkbox-label input {
	accent-color: var(--principal, #e84924);
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
	cursor: pointer;
}

/* ============================================================
   Consentimiento / checkbox legal
   ============================================================ */

.k42-form__consent {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	font-size: 0.85rem;
	color: var(--menos-oscuro, #5d5d5d);
	line-height: 1.4;
	cursor: pointer;
}

.k42-form__consent input {
	accent-color: var(--principal, #e84924);
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
	margin-top: 0.1rem;
	cursor: pointer;
}

.k42-form__consent a {
	color: var(--principal, #e84924);
	text-decoration: underline;
}

/* ============================================================
   Adjuntos
   ============================================================ */

.k42-form__file {
	font-size: 0.9rem;
	color: var(--menos-oscuro, #5d5d5d);
}

/* El input nativo, oculto pero accesible (focusable; display:none lo sacaría del
   tab). Su texto lo pinta el navegador en el idioma del NAVEGADOR, no de la
   página: por eso delante va un botón propio traducible. */
.k42-form__file-oculto {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.k42-form__file-control {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.k42-form__file-boton {
	display: inline-block;
	padding: 0.5rem 1.25rem;
	background: var(--mas-claro, #f3f3f3);
	color: var(--oscuro, #222);
	border: 1px solid var(--menos-oscuro, #5d5d5d);
	border-radius: 3px;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
}

.k42-form__file-oculto:focus + .k42-form__file-control .k42-form__file-boton {
	outline: 2px solid var(--principal, #e84924);
	outline-offset: 1px;
}

.k42-form__file-nombres {
	font-size: 0.9rem;
	color: var(--menos-oscuro, #5d5d5d);
	overflow-wrap: anywhere;
}

/* ============================================================
   Secciones condicionales
   ============================================================ */

.k42-form__section {
	border: none;
	padding: 0;
	margin: 0;
}

.k42-form__section[hidden] {
	display: none !important;
}

/* Título de sección: las cabeceras «Redes Sociales» / «Cuéntanos algo más» del original.
   Con aire por abajo: pegado a la primera fila de campos no respira (Jaime, 24-ago). */
.k42-form__section-titulo {
	margin: 1.5rem 0 1.25rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--principal, #e84924);
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--oscuro, #222);
}

/* Descripción bajo el título de sección (Equipaciones de eventos: el enlace al
   proceso de personalización). */
.k42-form__section-descripcion {
	margin: -0.5rem 0 1.25rem;
	font-size: 0.85rem;
	color: var(--menos-oscuro, #5d5d5d);
	line-height: 1.4;
}

.k42-form__section-descripcion a {
	color: var(--principal, #e84924);
	text-decoration: underline;
}

/* Redes sociales (embajadores): cada red junto a sus seguidores, como el original de GF
   (dos columnas, y la web a ancho completo). */
#seccion-redes_sociales .k42-form__section-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem;
}

#seccion-redes_sociales #field-web {
	grid-column: 1 / -1;
}

@media (max-width: 600px) {
	#seccion-redes_sociales .k42-form__section-fields {
		grid-template-columns: 1fr;
	}
}

/* Texto de ayuda bajo un campo («Resume aquí tus mayores logros», nota de privacidad). */
.k42-form__descripcion {
	font-size: 0.8rem;
	color: var(--menos-oscuro, #5d5d5d);
	line-height: 1.4;
}

.k42-form__descripcion a {
	color: var(--principal, #e84924);
	text-decoration: underline;
}

.k42-form__section-fields {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

/* ============================================================
   Errores de validación
   ============================================================ */

.k42-form__error {
	font-size: 0.8rem;
	color: #d32f2f;
	margin-top: 0.2rem;
}

.k42-form__error[hidden] {
	display: none !important;
}

.k42-form__error-global {
	padding: 0.75rem 1rem;
	background: #fdecea;
	border: 1px solid #f5c6c0;
	border-radius: 3px;
	font-size: 0.9rem;
	color: #c62828;
}

.k42-form__error-global[hidden] {
	display: none !important;
}

/* ============================================================
   Botón de envío y spinner
   ============================================================ */

.k42-form__submit-wrapper {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.k42-form__submit {
	display: inline-block;
	padding: 0.75rem 2rem;
	background: var(--principal, #e84924);
	color: var(--blanco, #fff);
	border: none;
	border-radius: 3px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s, opacity 0.2s;
}

.k42-form__submit:hover {
	background: #c83a1a;
}

.k42-form__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.k42-form__spinner {
	display: inline-block;
	width: 1.25rem;
	height: 1.25rem;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: var(--principal, #e84924);
	border-radius: 50%;
	animation: k42-spin 0.7s linear infinite;
}

.k42-form__spinner[hidden] {
	display: none !important;
}

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

/* ============================================================
   Confirmación post-envío
   ============================================================ */

.k42-form__confirmation {
	padding: 1.5rem;
	background: #f0f9f0;
	border: 1px solid #b2dfb2;
	border-radius: 4px;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--oscuro, #222);
}

.k42-form__confirmation[hidden] {
	display: none !important;
}

.k42-form__confirmation-message {
	margin: 0;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 600px) {
	.k42-form-wrapper {
		padding: 0 0.5rem;
	}

	.k42-form__submit {
		width: 100%;
		text-align: center;
	}
}
