/**
 * Estilos del formulario publico [vardi_view_bulletins].
 * Namespaced con el prefijo .vvb- para no chocar con los estilos del tema.
 *
 * Desarrollado por Jairo Avila M para Havas Media.
 * Para uso exclusivo bajo autorizacion de HAVAS MEDIA.
 */

.vvb-consulta {
	--vvb-color-primario: #2f4bef;
	--vvb-color-texto: #1a1a1a;
	--vvb-color-texto-suave: #6b7280;
	--vvb-color-borde: #e5e7eb;
	--vvb-color-fondo-input: #f4f5f7;
	--vvb-color-exito: #1a7f37;
	--vvb-color-info: #1f2937;
	--vvb-color-error: #b42318;

	max-width: 640px;
	margin: 0 auto;
	padding: 2rem 1rem;
	text-align: center;
	font-family: inherit;
	color: var( --vvb-color-texto );
	box-sizing: border-box;
}

/* Inputs y botones no heredan la tipografia por defecto: se fuerza la del sitio. */
.vvb-consulta input,
.vvb-consulta button {
	font-family: inherit;
	letter-spacing: inherit;
}

.vvb-consulta *,
.vvb-consulta *::before,
.vvb-consulta *::after {
	box-sizing: inherit;
}

.vvb-consulta__eyebrow {
	margin: 0 0 0.5rem;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var( --vvb-color-primario );
}

.vvb-consulta__titulo {
	margin: 0 0 0.75rem;
	font-size: clamp( 1.5rem, 4vw, 2.1rem );
	font-weight: 800;
	line-height: 1.2;
}

.vvb-consulta__subtitulo {
	margin: 0 0 1.5rem;
	color: var( --vvb-color-texto-suave );
	font-size: 0.95rem;
	line-height: 1.5;
}

.vvb-consulta__card {
	background: #fff;
	border: 1px solid var( --vvb-color-borde );
	border-radius: 16px;
	padding: 1.25rem;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.04 );
	text-align: left;
}

.vvb-consulta__campo {
	margin-bottom: 0.75rem;
}

.vvb-consulta__campo:last-of-type {
	margin-bottom: 0;
}

.vvb-consulta__input {
	width: 100%;
	padding: 0.9rem 1rem;
	border: 1px solid var( --vvb-color-borde );
	border-radius: 10px;
	background: var( --vvb-color-fondo-input );
	font-size: 0.95rem;
	color: var( --vvb-color-texto );
	text-align: center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vvb-consulta__input:focus {
	outline: none;
	border-color: var( --vvb-color-primario );
	box-shadow: 0 0 0 3px rgba( 47, 75, 239, 0.15 );
}

.vvb-consulta__ayuda {
	margin: 0.9rem 0 0;
	font-size: 0.8rem;
	line-height: 1.5;
	color: var( --vvb-color-texto-suave );
	text-align: center;
}

.vvb-consulta__ayuda strong {
	color: var( --vvb-color-primario );
}

.vvb-consulta__boton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 1.5rem;
	padding: 0.85rem 2.5rem;
	border: none;
	border-radius: 10px;
	background: var( --vvb-color-primario );
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.05s ease;
}

.vvb-consulta__boton:hover:not( :disabled ) {
	opacity: 0.92;
}

.vvb-consulta__boton:active:not( :disabled ) {
	transform: translateY( 1px );
}

.vvb-consulta__boton:focus-visible {
	outline: 3px solid rgba( 47, 75, 239, 0.4 );
	outline-offset: 2px;
}

.vvb-consulta__boton:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Spinner a la derecha del texto mientras el boton esta en "Consultando...". */
.vvb-consulta__boton--cargando::after {
	content: '';
	flex: none;
	width: 1em;
	height: 1em;
	margin-left: 0.6em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: vvb-spin 0.7s linear infinite;
}

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

@media ( prefers-reduced-motion: reduce ) {
	.vvb-consulta__boton--cargando::after {
		animation-duration: 2s;
	}
}

.vvb-consulta__resultado {
	margin-top: 1.25rem;
	display: none;
	text-align: left;
}

.vvb-consulta__resultado--visible {
	display: block;
}

.vvb-consulta__resultado--cargando {
	display: block;
	color: var( --vvb-color-texto-suave );
}

.vvb-consulta__resultado--error {
	font-size: 0.9rem;
	line-height: 1.5;
	padding: 0.9rem 1rem;
	border-radius: 10px;
	background: #fef2f2;
	color: var( --vvb-color-error );
	border: 1px solid #fecaca;
}

.vvb-consulta__resultado--info {
	font-size: 0.9rem;
	line-height: 1.5;
	padding: 0.9rem 1rem;
	border-radius: 10px;
	background: #f3f4f6;
	color: var( --vvb-color-info );
	border: 1px solid var( --vvb-color-borde );
}

.vvb-consulta__item {
	padding: 0.9rem 1rem;
	border-radius: 10px;
	margin-bottom: 0.75rem;
	border: 1px solid var( --vvb-color-borde );
}

.vvb-consulta__item:last-child {
	margin-bottom: 0;
}

.vvb-consulta__item--activo {
	background: #ecfdf3;
	border-color: #abefc6;
}

.vvb-consulta__item--activo .vvb-consulta__item-mensaje {
	color: var( --vvb-color-exito );
}

.vvb-consulta__item--temporal {
	background: #fffbeb;
	border-color: #fde68a;
}

.vvb-consulta__item--neutro {
	background: #f9fafb;
}

.vvb-consulta__modelo {
	margin: 0 0 0.6rem;
	font-weight: 700;
	font-size: 1rem;
}

.vvb-consulta__item-titulo {
	margin: 0 0 0.35rem;
	font-weight: 700;
	font-size: 0.9rem;
}

.vvb-consulta__item-mensaje {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.5;
}

@media ( max-width: 480px ) {
	.vvb-consulta {
		padding: 1.5rem 0.5rem;
	}

	.vvb-consulta__card {
		padding: 1rem;
	}
}
