/* WANT · Diagnóstico de Gobernanza Digital
 *
 * Look heredado de /cotiza/ (theme "want"): fondo negro, Inter, inputs y botones en píldora,
 * foco en blanco y hover verde fluor. Los valores salen de components/custom/scss/_form.scss,
 * _colors.scss y modules/contact del theme.
 * Breakpoints del theme: 850px (tablet) y 550px (móvil).
 *
 * Dentro de la plantilla de página (.contact) el formulario va sobre el fondo del theme.
 * Fuera de ella (shortcode en otra página) se dibuja su propio panel negro.
 */

/* ============ Tokens ============ */
.wdg {
	--wdg-white: #fff;
	--wdg-black: #0A0A0A;
	--wdg-g100: #CECECE;
	--wdg-g200: #ADADAD;
	--wdg-g300: #848484;
	--wdg-g400: #5C5C5C;
	--wdg-g500: #333;
	--wdg-blue: #0081F8;
	--wdg-green: #00FFA3;
	--wdg-pink: #F51767;
	--wdg-pill: 100px;
	--wdg-round: 20px;
	/* Escala tipográfica del theme (.font-N) */
	--wdg-fs-text: 18px;
	--wdg-fs-label: 20px;
	--wdg-fs-small: 16px;
	--wdg-fs-q: 26px;
	--wdg-fs-title: 45px;
	--wdg-fs-big: 72px;

	position: relative;
	width: 100%;
	padding: 32px 20px;
	border-radius: var(--wdg-round);
	background: var(--wdg-black);
	color: var(--wdg-white);
	font-family: inherit;
	font-size: var(--wdg-fs-text);
	line-height: 1.4;
	-webkit-text-size-adjust: 100%;
}
.contact .wdg { padding: 0; border-radius: 0; background: none; }
.wdg *, .wdg *::before, .wdg *::after { box-sizing: border-box; }
.wdg button, .wdg input { font-family: inherit; }
:where(.wdg p) { margin: 0; }

/* Los niveles de madurez son colores de marca pensados para fondo claro:
   sobre negro se aclaran para el texto y los bordes. */
.wdg-opt, .wdg-score, .wdg-badge { --lvl: var(--lv); }
@supports (color: color-mix(in srgb, red, blue)) {
	.wdg-opt, .wdg-score, .wdg-badge { --lvl: color-mix(in srgb, var(--lv) 62%, #fff); }
}

/* ============ Cabecera de la página (plantilla) ============ */
/* Sin título visible: la página arranca con el formulario. La .intro solo deja el espacio del header
   fijo del theme (y la foto de fondo, si hay); el h1 de la página queda oculto para lectores de pantalla. */
.wdg-landing .intro { padding-bottom: 0; min-height: 0; }
.wdg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wdg-hero-media {
	position: absolute; inset: 0; z-index: -2;
	/* La foto se funde hacia el negro texturizado del formulario, sin corte. */
	-webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
}
/* Velo: oscurece arriba (logo y menú) y a la izquierda, donde va el texto, sea cual sea la foto. */
.wdg-hero-media::after {
	content: ""; position: absolute; inset: 0;
	background:
		linear-gradient(180deg, rgba(10, 10, 10, .7) 0%, rgba(10, 10, 10, 0) 38%),
		linear-gradient(90deg, rgba(10, 10, 10, .78) 0%, rgba(10, 10, 10, .5) 50%, rgba(10, 10, 10, .22) 100%);
}
.wdg-hero-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wdg-landing .form_container { padding-top: 24px; padding-bottom: 140px; }
.wdg-landing .form_container h3 { margin-bottom: 0; }

/* ============ Encabezado del formulario y avance ============ */
.wdg-head { margin: 0 0 40px; }
.wdg-kicker { font-size: var(--wdg-fs-text); font-weight: 400; color: var(--wdg-g300); }
.wdg .wdg-title { margin: 8px 0 0; font-size: var(--wdg-fs-title); line-height: 1.2; font-weight: 700; color: var(--wdg-white); }
.wdg-progress { height: 2px; margin-top: 28px; background: var(--wdg-g500); border-radius: 2px; overflow: hidden; }
.wdg-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--wdg-blue), var(--wdg-green)); transition: width .4s ease; }
.wdg-steptext { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: var(--wdg-fs-small); color: var(--wdg-g300); }
.wdg-steptext strong { color: var(--wdg-white); font-weight: 600; }

/* Número de paso sobre la línea vertical, igual que "01 02 03" en /cotiza/ */
.wdg-stepnum { display: none; }
@media (min-width: 851px) {
	.contact .wdg-stepnum {
		display: block; position: absolute; left: -64px; top: 0; width: 30px; padding-bottom: 20px;
		text-align: center; font-size: var(--wdg-fs-text); line-height: 1.4; color: var(--wdg-white);
	}
	.contact .wdg-stepnum::before {
		content: ""; position: absolute; left: 0; right: 0; bottom: 0; margin: auto;
		width: 10px; height: 10px; border-radius: 10px; background: var(--wdg-white);
	}
}

/* ============ Pasos ============ */
.wdg-card { margin: 0; padding: 0; border: 0; background: none; animation: wdg-in .4s ease both; }
@keyframes wdg-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.wdg-lead { max-width: 760px; margin: 0 0 35px; color: var(--wdg-g100); }

/* ---------- Datos ---------- */
.wdg-grid { display: grid; grid-template-columns: 1fr; gap: 25px; }
.wdg-field label { display: block; margin: 0 0 10px; font-size: var(--wdg-fs-label); line-height: 1.4; font-weight: 400; color: var(--wdg-white); }
.wdg-field input {
	display: block; width: 100%; min-height: 57px; padding: 15px;
	border: 1px solid var(--wdg-g400); border-radius: var(--wdg-pill);
	background: transparent; color: var(--wdg-g100);
	font-size: var(--wdg-fs-text); line-height: 1.4; box-shadow: none;
	-webkit-appearance: none; appearance: none;
	transition: border-color .2s, background-color .2s, color .2s;
}
.wdg-field input::placeholder { color: var(--wdg-g300); opacity: 1; }
.wdg-field input:hover { border-color: var(--wdg-g200); }
.wdg-field input:focus { outline: 0; border-color: var(--wdg-white); background: var(--wdg-white); color: var(--wdg-black); }
.wdg-field input:focus-visible { box-shadow: 0 0 0 3px rgba(0, 129, 248, .6); }
.wdg-field input:-webkit-autofill,
.wdg-field input:-webkit-autofill:hover { -webkit-text-fill-color: var(--wdg-g100); -webkit-box-shadow: 0 0 0 1000px var(--wdg-black) inset; caret-color: var(--wdg-white); }
.wdg-field input:-webkit-autofill:focus { -webkit-text-fill-color: var(--wdg-black); -webkit-box-shadow: 0 0 0 1000px var(--wdg-white) inset; }
.wdg-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Pregunta ---------- */
.wdg-q { border: 0; padding: 0; margin: 0; min-width: 0; }
.wdg-axis { margin: 0 0 14px; color: var(--wdg-g300); }
.wdg-axis span { color: var(--wdg-white); font-weight: 600; }
.wdg h3.wdg-qtext {
	display: block; margin: 0 0 22px; padding: 0; outline: none;
	font-size: var(--wdg-fs-q); line-height: 1.25; font-weight: 700; letter-spacing: normal; color: var(--wdg-white);
}

.wdg-hint { max-width: 60ch; margin: 0 0 30px; font-size: var(--wdg-fs-small); color: var(--wdg-g200); }

.wdg-opts { display: grid; gap: 12px; max-width: 900px; }
.wdg-opt {
	position: relative; display: flex; gap: 16px; align-items: center; min-height: 68px; padding: 14px 22px 14px 14px;
	border: 1px solid var(--wdg-g400); border-radius: var(--wdg-round); background: transparent; color: var(--wdg-g100);
	cursor: pointer; -webkit-tap-highlight-color: transparent;
	transition: border-color .2s, background-color .2s, color .2s;
}
.wdg-opt:hover { border-color: var(--wdg-white); color: var(--wdg-white); }
.wdg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.wdg-opt input:focus-visible + .wdg-opt-n { outline: 2px solid var(--wdg-blue); outline-offset: 3px; }
.wdg-opt-n {
	flex: 0 0 40px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
	border: 1.5px solid var(--lvl); border-radius: 50%; color: var(--lvl); font-size: 18px; font-weight: 700;
	transition: background-color .2s, color .2s;
}
.wdg-opt-body { display: flex; flex-direction: column; gap: 2px; font-size: var(--wdg-fs-small); }
.wdg-opt-body strong { font-size: var(--wdg-fs-text); font-weight: 600; color: inherit; }
.wdg-opt-desc { display: block; color: var(--wdg-g200); transition: color .2s; }
/* Opción elegida: igual que las opciones marcadas de los formularios del sitio (fondo blanco, texto negro). */
.wdg-opt.is-on { border-color: var(--wdg-white); background: var(--wdg-white); color: var(--wdg-black); }
.wdg-opt.is-on .wdg-opt-n { border-color: var(--lv); background: var(--lv); color: var(--lv-ink, #fff); }
.wdg-opt.is-on .wdg-opt-desc { color: var(--wdg-g500); }

/* ---------- Confirmación ---------- */
.wdg .wdg-confirm-title { margin: 0 0 14px; font-size: var(--wdg-fs-q); line-height: 1.25; font-weight: 700; color: var(--wdg-white); outline: none; }
.wdg-card > p { max-width: 760px; color: var(--wdg-g100); }
.wdg-consent { display: flex; gap: 14px; align-items: flex-start; max-width: 760px; margin: 26px 0 0; font-size: var(--wdg-fs-small); color: var(--wdg-g100); cursor: pointer; }
.wdg-consent a { color: var(--wdg-white); text-decoration: underline; text-underline-offset: 3px; }
.wdg-consent input {
	display: grid; place-content: center; flex: 0 0 26px; width: 26px; height: 26px; margin: 1px 0 0;
	border: 1px solid var(--wdg-g400); border-radius: 8px; background: transparent; cursor: pointer;
	-webkit-appearance: none; appearance: none; transition: background-color .2s, border-color .2s;
}
.wdg-consent input::after {
	content: ''; width: 12px; height: 7px; margin-top: -2px; opacity: 0;
	border-left: 2px solid var(--wdg-black); border-bottom: 2px solid var(--wdg-black); transform: rotate(-45deg);
}
.wdg-consent input:checked { border-color: var(--wdg-white); background: var(--wdg-white); }
.wdg-consent input:checked::after { opacity: 1; }
.wdg-consent input:focus-visible { outline: 2px solid var(--wdg-blue); outline-offset: 3px; }

/* ---------- Errores y navegación ---------- */
.wdg-error { margin-top: 22px; font-size: var(--wdg-fs-small); color: var(--wdg-pink); }
.wdg-error:empty { display: none; }
.wdg-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 40px 0 0; }
.wdg-nav > span { flex: 1 1 0; }

/* Botones: el principal (Siguiente, Comenzar, Ver resultados) es blanco relleno con hover verde fluor,
   como el botón de envío de /cotiza/. "Anterior" es un botón fantasma: sin borde ni relleno, liviano. */
.wdg-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 57px; padding: 13px 30px;
	border: 1px solid var(--wdg-white); border-radius: var(--wdg-pill); background: var(--wdg-white);
	color: var(--wdg-black) !important; font-size: var(--wdg-fs-label); font-weight: 600; line-height: 1.4;
	text-align: center; text-decoration: none !important; cursor: pointer; -webkit-tap-highlight-color: transparent;
	transition: background-color .2s, border-color .2s, color .2s;
}
.wdg-btn i { font-size: 1.1em; line-height: 1; transition: transform .2s; }
.wdg-btn:hover,
.wdg-btn:focus-visible { border-color: var(--wdg-green); background: var(--wdg-green); }
.wdg-btn:hover i:last-child { transform: translateX(3px); }
.wdg-btn:focus-visible { outline: 2px solid var(--wdg-blue); outline-offset: 3px; }
.wdg-btn-solid { }
.wdg-btn-ghost {
	min-height: 0; padding: 8px 0; border: 0; background: none; color: var(--wdg-g200) !important; font-weight: 500;
	align-self: center;
}
.wdg-btn-ghost:hover,
.wdg-btn-ghost:focus-visible { border: 0; background: none; color: var(--wdg-white) !important; }
.wdg-btn-ghost:hover i:last-child { transform: none; }
.wdg-btn[disabled] { opacity: .6; cursor: wait; }

/* ============ Resultado ============ */
.wdg-result { padding: 0; }
.wdg-score { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 28px; border: 1px solid var(--wdg-g500); border-radius: var(--wdg-round); background: rgba(255, 255, 255, .04); }
.wdg-big { font-size: var(--wdg-fs-big); font-weight: 700; line-height: 1.05; color: var(--wdg-white); }
.wdg-level { margin-top: 4px; font-size: 32px; font-weight: 700; line-height: 1.2; color: var(--lvl); }
.wdg-score p { margin: 10px 0 0; color: var(--wdg-g100); }

.wdg-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 28px 0 40px; }
.wdg-seg-bar { display: block; height: 6px; border-radius: 6px; background: var(--lv); opacity: .3; }
.wdg-seg-lbl { display: block; margin-top: 8px; text-align: center; font-size: 12px; color: var(--wdg-g300); white-space: nowrap; visibility: hidden; }
.wdg-seg.is-on .wdg-seg-bar { opacity: 1; }
.wdg-seg.is-on .wdg-seg-lbl { visibility: visible; color: var(--wdg-white); font-weight: 600; }

.wdg-split { display: grid; grid-template-columns: 1fr; gap: 28px; }
.wdg-split > div { width: 100%; max-width: 640px; margin: 0 auto; }
.wdg-split > .wdg-tablewrap { max-width: none; }
.wdg-radar { width: 100%; height: auto; overflow: visible; }
.wdg-ring { fill: none; stroke: var(--wdg-g500); stroke-width: 1; }
.wdg-area { fill: var(--wdg-blue); fill-opacity: .28; stroke: var(--wdg-blue); stroke-width: 3; }
.wdg-dot { fill: var(--wdg-green); }
.wdg-lbl { font-size: 22px; fill: var(--wdg-white); font-weight: 600; }
.wdg-lbl-v { font-weight: 400; fill: var(--wdg-g300); }

.wdg-tablewrap { width: 100%; overflow-x: auto; }
.wdg-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wdg-table th { padding: 10px 6px; border-bottom: 1px solid var(--wdg-g400); text-align: left; font-weight: 600; color: var(--wdg-g300); background: none; }
.wdg-table td { padding: 12px 6px; border-bottom: 1px solid var(--wdg-g500); color: var(--wdg-g100); }
.wdg-table .num { text-align: right; white-space: nowrap; }
.wdg-prom { display: none; }
.wdg-badge { display: inline-block; padding: 2px 10px; border: 1px solid var(--lvl); border-radius: var(--wdg-pill); font-size: 12px; font-weight: 600; color: var(--lvl); white-space: nowrap; }

.wdg-actions { display: flex; flex-direction: column; gap: 20px; margin-top: 40px; }
.wdg-actions .wdg-btn { width: 100%; }
.wdg-note { font-size: var(--wdg-fs-small); color: var(--wdg-g200); }

/* ============ Tablet y más grande ============ */
@media (min-width: 720px) {
	.wdg-opt:hover .wdg-opt-desc { color: var(--wdg-g100); }
	.wdg-opt.is-on:hover { color: var(--wdg-black); }
	.wdg-opt.is-on:hover .wdg-opt-desc { color: var(--wdg-g500); }
	.wdg-score { grid-template-columns: auto 1fr; gap: 48px; align-items: center; padding: 32px 40px; }
	.wdg-seg-lbl { visibility: visible; font-size: 14px; }
	.wdg-table { font-size: 16px; }
	.wdg-table th, .wdg-table td { padding: 14px 10px; }
	.wdg-prom { display: table-cell; }
	.wdg-badge { font-size: 13px; }
	.wdg-actions { flex-direction: row; justify-content: space-between; align-items: center; }
	.wdg-actions .wdg-btn { width: auto; }
	.wdg-note { flex: 1 1 260px; }
}

@media (min-width: 851px) {
	.wdg { padding: 56px 56px; }
	.wdg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 35px; }
	.wdg-btn { min-width: 125px; }
}

/* Pregunta | opciones en dos columnas cuando hay ancho (como el grid de 2 columnas de /cotiza/). */
@media (min-width: 1100px) {
	.contact .wdg-q { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto auto 1fr; column-gap: 70px; align-items: start; }
	.contact .wdg-q > .wdg-axis,
	.contact .wdg-q > .wdg-qtext,
	.contact .wdg-q > .wdg-hint { grid-column: 1; }
	.contact .wdg-q > .wdg-opts { grid-column: 2; grid-row: 1 / span 3; max-width: none; }
	.contact .wdg-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 70px; align-items: center; }
}

/* ============ Escala tipográfica en tablet / móvil (theme: .font-N) ============ */
@media (max-width: 850px) {
	.wdg {
		--wdg-fs-text: 16px;
		--wdg-fs-label: 18px;
		--wdg-fs-small: 16px;
		--wdg-fs-q: 21px;
		--wdg-fs-title: 32px;
		--wdg-fs-big: 56px;
	}
	.wdg-head { margin-bottom: 28px; }
	.wdg-level { font-size: 26px; }
}

/* ============ Móvil ============ */
@media (max-width: 550px) {
	.wdg-opt { padding: 12px 16px 12px 12px; gap: 14px; }
	.wdg-landing .form_container { margin: 0; padding-top: 16px; padding-bottom: 120px; }
	.wdg-nav { margin-top: 32px; }
	.wdg-nav .wdg-btn:not(.wdg-btn-ghost) { padding-left: 26px; padding-right: 26px; }
	.wdg-score { padding: 22px 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.wdg-card { animation: none; }
	.wdg-progress span, .wdg-opt, .wdg-opt-n, .wdg-btn, .wdg-field input { transition: none; }
}
