/**
 * AV · Generador de códigos QR
 *
 * Mismo criterio que el generador de enlaces: heredar del theme y del kit de
 * Elementor todo lo que se pueda. Las tipografías se toman con `inherit`
 * (incluidos los campos de formulario, que por defecto NO heredan) y los
 * colores salen de las variables globales, con fallback si el kit no existe.
 */

.avqrg {
	--avqrg-accent: var(--e-global-color-accent, #111827);
	--avqrg-heading: var(--e-global-color-primary, currentColor);
	--avqrg-text: var(--e-global-color-text, currentColor);

	--avqrg-border: color-mix(in srgb, currentColor 16%, transparent);
	--avqrg-border-strong: color-mix(in srgb, currentColor 30%, transparent);
	--avqrg-surface: color-mix(in srgb, currentColor 6%, transparent);
	--avqrg-muted: color-mix(in srgb, currentColor 62%, transparent);

	--avqrg-radius: 10px;

	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: var(--avqrg-text);
	box-sizing: border-box;
}

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

@supports not (color: color-mix(in srgb, red 50%, transparent)) {
	.avqrg {
		--avqrg-border: rgba(128, 128, 128, 0.28);
		--avqrg-border-strong: rgba(128, 128, 128, 0.5);
		--avqrg-surface: rgba(128, 128, 128, 0.09);
		--avqrg-muted: rgba(128, 128, 128, 0.95);
	}
}

/* ------------------------------------------------------------------ *
 * Layout: escenario del QR a la izquierda, controles a la derecha
 * ------------------------------------------------------------------ */

.avqrg__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 44px;
	align-items: center;
}

@media (max-width: 880px) {
	.avqrg__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}
}

/* ------------------------------------------------------------------ *
 * Escenario / vista previa
 * ------------------------------------------------------------------ */

.avqrg__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 26px;
	min-height: 460px;
	padding: 40px 24px;
	border-radius: 22px;
	background: var(--avqrg-surface);
}

.avqrg__card {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
	background: #ffffff;
	border-radius: 4px;
}

.avqrg__canvas {
	display: block;
	width: 300px;
	max-width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	image-rendering: pixelated;
	transition: opacity 0.2s ease;
}

/* Estado vacío: el mismo QR pero apagado, para que se vea qué va a pasar. */
.avqrg__canvas.is-placeholder {
	opacity: 0.22;
}

.avqrg__hint {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin: 0;
	padding: 13px 18px;
	max-width: 100%;
	font-family: inherit;
	font-size: 0.85em;
	line-height: 1.4;
	color: #ffffff;
	background: #1f2430;
	border-radius: var(--avqrg-radius);
}

.avqrg__hint[hidden] {
	display: none;
}

.avqrg__hint svg {
	flex: 0 0 auto;
}

/* ------------------------------------------------------------------ *
 * Controles
 * ------------------------------------------------------------------ */

.avqrg__form {
	margin: 0;
}

.avqrg__field {
	margin-bottom: 22px;
}

.avqrg__label {
	display: block;
	margin-bottom: 8px;
	font-family: inherit;
	font-weight: 600;
	font-size: 0.9em;
	color: var(--avqrg-heading);
}

/* Los controles de formulario no heredan tipografía por defecto: se fuerza. */
.avqrg__input,
.avqrg__select {
	width: 100%;
	font-family: inherit;
	font-size: 1em;
	line-height: 1.45;
	color: inherit;
	background-color: transparent;
	border: 1px solid var(--avqrg-border-strong);
	border-radius: var(--avqrg-radius);
	padding: 13px 15px;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}

.avqrg__select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 18px;
	padding-right: 42px;
	cursor: pointer;
}

.avqrg__input:focus,
.avqrg__select:focus {
	outline: none;
	border-color: var(--avqrg-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--avqrg-accent) 22%, transparent);
}

.avqrg__input::placeholder {
	color: var(--avqrg-muted);
	opacity: 0.6;
}

.avqrg__help {
	display: block;
	margin-top: 8px;
	font-family: inherit;
	font-size: 0.8em;
	line-height: 1.5;
	color: var(--avqrg-muted);
}

.avqrg__error {
	display: none;
	margin-top: 16px;
	padding: 11px 14px;
	font-size: 0.85em;
	border-radius: var(--avqrg-radius);
	color: #b42318;
	background: rgba(217, 45, 32, 0.09);
	border: 1px solid rgba(217, 45, 32, 0.28);
}

.avqrg__error.is-visible {
	display: block;
}

/* ------------------------------------------------------------------ *
 * Botones
 * ------------------------------------------------------------------ */

.avqrg__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.avqrg .avqrg__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	font-size: 0.95em;
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	padding: 13px 26px;
	border: 1px solid transparent;
	border-radius: var(--avqrg-radius);
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}

.avqrg .avqrg__btn:focus-visible {
	outline: 2px solid var(--avqrg-accent);
	outline-offset: 2px;
}

.avqrg .avqrg__btn--primary {
	color: #fff;
	background-color: var(--avqrg-accent);
}

.avqrg .avqrg__btn--primary:hover:not(:disabled) {
	background-color: color-mix(in srgb, var(--avqrg-accent) 82%, #000);
	color: #fff;
}

.avqrg .avqrg__btn--ghost {
	color: var(--avqrg-accent);
	background-color: transparent;
	background-image: none;
	border-color: var(--avqrg-border-strong);
}

.avqrg .avqrg__btn--ghost:hover:not(:disabled) {
	border-color: var(--avqrg-accent);
	background-color: color-mix(in srgb, var(--avqrg-accent) 8%, transparent);
	color: var(--avqrg-accent);
}

.avqrg .avqrg__btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.avqrg .avqrg__btn.is-done {
	background-color: #1a7f37;
	border-color: #1a7f37;
	color: #fff;
}

.avqrg__cta {
	display: block;
	margin-top: 22px;
	padding: 14px 20px;
	font-family: inherit;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	color: #fff;
	background: var(--avqrg-heading);
	border-radius: var(--avqrg-radius);
	transition: opacity 0.18s ease;
}

.avqrg__cta:hover {
	opacity: 0.88;
	color: #fff;
}

/* ------------------------------------------------------------------ *
 * FAQ
 * ------------------------------------------------------------------ */

.avqrg__faq {
	margin-top: 56px;
}

/* Sin font-size/family: hereda los estilos de H2 del theme. */
.avqrg__faq-title {
	margin-top: 0;
	margin-bottom: 18px;
}

.avqrg__faq-item {
	border-bottom: 1px solid var(--avqrg-border);
}

.avqrg__faq-q {
	position: relative;
	display: block;
	padding: 16px 34px 16px 0;
	font-family: inherit;
	font-weight: 600;
	color: var(--avqrg-heading);
	cursor: pointer;
	list-style: none;
}

.avqrg__faq-q::-webkit-details-marker {
	display: none;
}

.avqrg__faq-q::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 6px;
	width: 9px;
	height: 9px;
	margin-top: -6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.5;
	transition: transform 0.2s ease;
}

.avqrg__faq-item[open] .avqrg__faq-q::after {
	transform: rotate(-135deg);
	margin-top: -2px;
}

.avqrg__faq-a {
	padding: 0 0 18px;
	color: var(--avqrg-muted);
}

.avqrg__faq-a p {
	margin: 0;
}

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