/**
 * NPS · Configurador de Kit de Alarma
 *
 * Nota de especificidad: el kit global de Elementor estiliza los elementos por
 * tipo (`.elementor-kit-N button`, `… h3`, `… input` = 0,1,1), así que una clase
 * suelta pierde y los botones salían naranjas y con forma de píldora. Por eso
 * cada regla que toca un elemento estilizable lleva la forma
 * `.nps-kc <tipo>.<clase>` (0,2,1): gana al kit global y sigue perdiendo, como
 * debe, frente a los controles de la pestaña Estilo del widget
 * (`{{WRAPPER}} .clase` = 0,3,0).
 *
 * Los colores heredan del kit global; los valores tras la coma son el fallback
 * por si el widget se usa fuera del tema de NPS.
 */

.nps-kc {
	--nps-kc-primary: var(--e-global-color-primary, #00205c);
	--nps-kc-accent: var(--e-global-color-secondary, #ff671d);
	--nps-kc-text: var(--e-global-color-text, #5a6478);
	--nps-kc-card-bg: #fff;
	--nps-kc-border: #edf0f6;
	--nps-kc-radius: 20px;
	--nps-kc-cols: 4;
	--nps-kc-gap: 16px;
	--nps-kc-opt-bg: #fff;
	--nps-kc-opt-bg-hover: #fff;
	--nps-kc-opt-border: #e8ecf4;
	--nps-kc-opt-border-hover: var(--nps-kc-accent);
	--nps-kc-opt-radius: 16px;
	--nps-kc-icon-size: 22px;
	--nps-kc-icon-color: var(--nps-kc-primary);
	--nps-kc-icon-bg: #f2f5fa;
	--nps-kc-btn-bg: var(--nps-kc-accent);
	--nps-kc-btn-bg-hover: var(--nps-kc-primary);
	--nps-kc-btn-color: #fff;
	--nps-kc-btn-radius: 999px;

	position: relative;
	color: var(--nps-kc-text);
}

.nps-kc *,
.nps-kc *::before,
.nps-kc *::after {
	box-sizing: border-box;
}

/* Neutraliza lo que el kit global aplica a los controles del widget. */
.nps-kc button.nps-kc-opt,
.nps-kc button.nps-kc-nav,
.nps-kc button.nps-kc-btn,
.nps-kc a.nps-kc-btn,
.nps-kc button.nps-kc-restart {
	margin: 0;
	font-family: inherit;
	font-style: normal;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

/* ---------------------------------------------------------- Tarjeta ---- */

.nps-kc .nps-kc-card {
	background: var(--nps-kc-card-bg);
	border: 1px solid var(--nps-kc-border);
	border-radius: var(--nps-kc-radius);
	padding: clamp(22px, 3vw, 40px);
	box-shadow: 0 4px 24px rgba(15, 37, 87, 0.06);
}

.nps-kc .nps-kc-card[hidden] {
	display: none;
}

/* ----------------------------------------------------------- Pasos ----- */

.nps-kc .nps-kc-step[hidden] {
	display: none;
}

.nps-kc .nps-kc-step.is-active {
	animation: nps-kc-fade 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes nps-kc-fade {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.nps-kc p.nps-kc-step-label {
	margin: 0 0 8px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--nps-kc-accent);
}

.nps-kc p.nps-kc-step-label:empty {
	display: none;
}

.nps-kc h3.nps-kc-q-title {
	margin: 0 0 clamp(18px, 2.4vw, 28px);
	font-size: clamp(1.15rem, 2vw, 1.4rem);
	line-height: 1.3;
	font-weight: 700;
	color: var(--nps-kc-primary);
	outline: none;
}

/* -------------------------------------------------------- Respuestas --- */

.nps-kc .nps-kc-opts {
	display: grid;
	grid-template-columns: repeat(var(--nps-kc-cols), minmax(0, 1fr));
	gap: var(--nps-kc-gap);
}

.nps-kc button.nps-kc-opt {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 100%;
	padding: 24px 16px;
	font-size: 1rem;
	line-height: 1.4;
	text-align: center;
	background: var(--nps-kc-opt-bg);
	border: 1.5px solid var(--nps-kc-opt-border);
	border-radius: var(--nps-kc-opt-radius);
	box-shadow: none;
	transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

/* El :focus va explícito porque el kit global define `button:focus` (0,2,1) con
   fondo azul: sin esto, la opción se teñía al hacer clic. */
.nps-kc button.nps-kc-opt:hover,
.nps-kc button.nps-kc-opt:focus {
	background: var(--nps-kc-opt-bg-hover);
	border-color: var(--nps-kc-opt-border-hover);
	transform: translateY(-3px);
	box-shadow: 0 10px 26px rgba(15, 37, 87, 0.08);
	outline: none;
}

.nps-kc button.nps-kc-opt.is-selected {
	background: var(--nps-kc-opt-bg-hover);
	border-color: var(--nps-kc-accent);
	box-shadow: 0 0 0 3px rgba(255, 103, 29, 0.13);
}

.nps-kc .nps-kc-opt-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: calc(var(--nps-kc-icon-size) + 30px);
	height: calc(var(--nps-kc-icon-size) + 30px);
	margin-bottom: 10px;
	border-radius: 14px;
	background: var(--nps-kc-icon-bg);
	color: var(--nps-kc-icon-color);
	font-size: var(--nps-kc-icon-size);
	line-height: 1;
	transition: background 0.2s, color 0.2s;
}

.nps-kc .nps-kc-opt-icon i,
.nps-kc .nps-kc-opt-icon svg {
	width: auto;
	height: auto;
	font-size: inherit;
	line-height: 1;
	color: inherit;
}

.nps-kc .nps-kc-opt-icon svg {
	width: var(--nps-kc-icon-size);
	height: var(--nps-kc-icon-size);
	fill: currentColor;
}

.nps-kc button.nps-kc-opt.is-selected .nps-kc-opt-icon {
	background: var(--nps-kc-accent);
	color: #fff;
}

.nps-kc .nps-kc-opt-title {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--nps-kc-primary);
}

.nps-kc .nps-kc-opt-desc {
	font-size: 0.82rem;
	font-weight: 400;
	line-height: 1.45;
	color: var(--nps-kc-text);
}

.nps-kc .nps-kc-opt-check {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--nps-kc-accent);
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.2s, transform 0.2s;
}

.nps-kc .nps-kc-opt-check::after {
	content: "";
	position: absolute;
	top: 5px;
	left: 7px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.nps-kc button.nps-kc-opt.is-selected .nps-kc-opt-check {
	opacity: 1;
	transform: scale(1);
}

/* ------------------------------------------------------------- m² ------ */

.nps-kc .nps-kc-m2 {
	max-width: 420px;
}

.nps-kc .nps-kc-field label {
	display: block;
	margin: 0 0 8px;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	color: var(--nps-kc-primary);
}

.nps-kc .nps-kc-input-wrap {
	position: relative;
}

/* Aquí NO se fuerza la especificidad a propósito: el kit global estiliza los
   inputs con `input:not([type="button"]):not([type="submit"])` (0,3,1) y gana en
   fondo, borde, radio y tipografía, de modo que el campo de m² sale idéntico al
   resto de formularios de la web. Lo de abajo es el aspecto base para cuando el
   widget se usa fuera de este sitio, más el padding y el peso que el kit no fija. */
.nps-kc input[type="number"] {
	width: 100%;
	height: auto;
	margin: 0;
	padding: 14px 58px 14px 18px;
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--nps-kc-primary);
	background: #f7f9fc;
	border: 1px solid #e2e7f1;
	border-radius: 14px;
	box-shadow: none;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	-moz-appearance: textfield;
	appearance: textfield;
}

.nps-kc input[type="number"]::-webkit-outer-spin-button,
.nps-kc input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.nps-kc input[type="number"]:focus {
	border-color: var(--nps-kc-accent);
	box-shadow: 0 0 0 3px rgba(255, 103, 29, 0.12);
}

.nps-kc .nps-kc-input-unit {
	position: absolute;
	top: 50%;
	right: 18px;
	transform: translateY(-50%);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--nps-kc-text);
	pointer-events: none;
}

.nps-kc p.nps-kc-error {
	margin: 8px 0 0;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.4;
	color: #d43b1e;
}

.nps-kc p.nps-kc-error[hidden] {
	display: none;
}

.nps-kc p.nps-kc-help {
	margin: 12px 0 20px;
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--nps-kc-text);
}

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

.nps-kc a.nps-kc-btn,
.nps-kc button.nps-kc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 30px;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	border: 1.5px solid transparent;
	border-radius: var(--nps-kc-btn-radius);
	box-shadow: none;
	transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.2s;
}

.nps-kc a.nps-kc-btn--primary,
.nps-kc button.nps-kc-btn--primary {
	background: var(--nps-kc-btn-bg);
	color: var(--nps-kc-btn-color);
}

.nps-kc a.nps-kc-btn--primary:hover,
.nps-kc a.nps-kc-btn--primary:focus,
.nps-kc button.nps-kc-btn--primary:hover,
.nps-kc button.nps-kc-btn--primary:focus {
	background: var(--nps-kc-btn-bg-hover);
	color: var(--nps-kc-btn-color);
	transform: translateY(-2px);
	outline: none;
}

.nps-kc a.nps-kc-btn--ghost {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.5);
	color: #fff;
}

.nps-kc a.nps-kc-btn--ghost:hover,
.nps-kc a.nps-kc-btn--ghost:focus {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
	outline: none;
}

/* ------------------------------------------------------- Pie / nav ----- */

.nps-kc .nps-kc-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: clamp(22px, 3vw, 30px);
	padding-top: 22px;
	border-top: 1px solid #eef1f7;
}

.nps-kc button.nps-kc-nav {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 11px 20px;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
	color: var(--nps-kc-primary);
	background: transparent;
	border: 1.5px solid #e6eaf3;
	border-radius: 999px;
	box-shadow: none;
	transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}

.nps-kc button.nps-kc-nav:hover:not(:disabled),
.nps-kc button.nps-kc-nav:focus:not(:disabled) {
	border-color: var(--nps-kc-accent);
	color: var(--nps-kc-accent);
	outline: none;
}

.nps-kc button.nps-kc-nav:disabled {
	color: #aeb8cc;
	cursor: not-allowed;
}

.nps-kc button.nps-kc-nav--next:not(:disabled) {
	background: var(--nps-kc-accent);
	border-color: var(--nps-kc-accent);
	color: #fff;
}

.nps-kc button.nps-kc-nav--next:not(:disabled):hover,
.nps-kc button.nps-kc-nav--next:not(:disabled):focus {
	background: var(--nps-kc-primary);
	border-color: var(--nps-kc-primary);
	color: #fff;
}

.nps-kc .nps-kc-nav-arrow {
	font-size: 1em;
	line-height: 1;
}

.nps-kc .nps-kc-pips {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nps-kc .nps-kc-pips--hidden {
	display: none;
}

.nps-kc .nps-kc-pip {
	width: 34px;
	height: 5px;
	border-radius: 999px;
	background: #e4e9f2;
	transition: background 0.3s, opacity 0.3s;
}

.nps-kc .nps-kc-pip.is-active {
	background: var(--nps-kc-accent);
}

.nps-kc .nps-kc-pip.is-done {
	background: rgba(255, 103, 29, 0.45);
}

.nps-kc .nps-kc-pip.is-skipped {
	background: #eef1f7;
}

.nps-kc p.nps-kc-editor-note {
	margin: 16px 0 0;
	padding: 12px 16px;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--nps-kc-primary);
	background: rgba(255, 103, 29, 0.08);
	border: 1px dashed var(--nps-kc-accent);
	border-radius: 12px;
}

.nps-kc p.nps-kc-editor-note[hidden] {
	display: none;
}

/* ------------------------------------------------------- Resultado ----- */

.nps-kc .nps-kc-result {
	--nps-kc-res-text: rgba(255, 255, 255, 0.82);
	--nps-kc-pill-bg: rgba(255, 255, 255, 0.12);
	--nps-kc-pill-color: #fff;

	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: clamp(20px, 3vw, 40px);
	align-items: center;
	padding: clamp(24px, 3vw, 40px);
	color: var(--nps-kc-res-text);
	background: linear-gradient(135deg, var(--nps-kc-primary) 0%, #001640 100%);
	border-radius: var(--nps-kc-radius);
	box-shadow: 0 18px 48px rgba(0, 32, 92, 0.18);
	animation: nps-kc-fade 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nps-kc .nps-kc-result[hidden] {
	display: none;
}

.nps-kc p.nps-kc-result-eyebrow {
	margin: 0 0 8px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--nps-kc-accent);
}

.nps-kc h3.nps-kc-result-title {
	margin: 0 0 12px;
	font-size: clamp(1.25rem, 2.2vw, 1.6rem);
	line-height: 1.3;
	font-weight: 700;
	color: #fff;
}

.nps-kc p.nps-kc-result-summary {
	display: inline-block;
	margin: 0 0 14px;
	padding: 6px 14px;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 999px;
}

.nps-kc p.nps-kc-result-summary[hidden] {
	display: none;
}

.nps-kc .nps-kc-result-desc {
	font-size: 0.95rem;
	line-height: 1.7;
}

.nps-kc .nps-kc-result-desc p {
	margin: 0 0 10px;
	color: inherit;
}

.nps-kc .nps-kc-result-desc p:last-child {
	margin-bottom: 0;
}

.nps-kc .nps-kc-result-desc strong {
	color: #fff;
}

.nps-kc ul.nps-kc-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.nps-kc ul.nps-kc-pills li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 7px 14px;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--nps-kc-pill-color);
	background: var(--nps-kc-pill-bg);
	border-radius: 999px;
	list-style: none;
}

.nps-kc ul.nps-kc-pills li::before {
	content: "";
	flex-shrink: 0;
	width: 5px;
	height: 9px;
	border: solid var(--nps-kc-accent);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) translateY(-1px);
}

.nps-kc p.nps-kc-result-note {
	margin: 18px 0 0;
	font-size: 0.8rem;
	font-style: italic;
	line-height: 1.5;
	opacity: 0.75;
}

.nps-kc .nps-kc-result-side {
	display: flex;
	flex-direction: column;
	gap: 14px;
	align-items: stretch;
	min-width: 210px;
}

.nps-kc figure.nps-kc-result-img {
	margin: 0;
}

.nps-kc figure.nps-kc-result-img img {
	display: block;
	width: 100%;
	max-width: 210px;
	height: auto;
	border-radius: 16px;
}

.nps-kc .nps-kc-result-ctas {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.nps-kc .nps-kc-result-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	justify-content: center;
}

.nps-kc button.nps-kc-restart {
	padding: 4px;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.7);
	text-decoration: underline;
	background: none;
	border: 0;
	box-shadow: none;
	transition: color 0.2s;
}

.nps-kc button.nps-kc-restart:hover,
.nps-kc button.nps-kc-restart:focus {
	color: #fff;
	background: none;
	outline: none;
}

/* Foco visible por teclado: va al final para ganar a los `outline: none`
   de las reglas de estado anteriores (misma especificidad). */
.nps-kc button.nps-kc-opt:focus-visible,
.nps-kc button.nps-kc-nav:focus-visible,
.nps-kc button.nps-kc-btn:focus-visible,
.nps-kc a.nps-kc-btn:focus-visible,
.nps-kc button.nps-kc-restart:focus-visible {
	outline: 2px solid var(--nps-kc-accent);
	outline-offset: 3px;
}

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

@media (max-width: 1024px) {
	.nps-kc .nps-kc-result {
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
	}

	.nps-kc .nps-kc-result-side {
		min-width: 0;
	}

	.nps-kc .nps-kc-result-ctas {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
	}
}

@media (max-width: 767px) {
	.nps-kc .nps-kc-footer {
		flex-wrap: wrap;
		justify-content: center;
	}

	.nps-kc button.nps-kc-nav {
		flex: 1 1 45%;
		justify-content: center;
	}

	.nps-kc .nps-kc-pips {
		order: -1;
		flex: 1 1 100%;
		justify-content: center;
		margin-bottom: 6px;
	}

	.nps-kc .nps-kc-pip {
		width: 28px;
	}

	.nps-kc button.nps-kc-opt {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px 14px;
		padding: 14px 16px;
		text-align: left;
	}

	.nps-kc .nps-kc-opt-icon {
		width: calc(var(--nps-kc-icon-size) + 18px);
		height: calc(var(--nps-kc-icon-size) + 18px);
		margin-bottom: 0;
		border-radius: 12px;
	}

	.nps-kc .nps-kc-opt-title {
		flex: 1 1 auto;
	}

	.nps-kc .nps-kc-opt-desc {
		flex: 1 1 100%;
	}

	.nps-kc .nps-kc-opt-check {
		position: static;
		flex-shrink: 0;
	}

	.nps-kc .nps-kc-m2,
	.nps-kc a.nps-kc-btn,
	.nps-kc button.nps-kc-btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nps-kc *,
	.nps-kc *::before,
	.nps-kc *::after {
		animation-duration: 0.001s !important;
		transition-duration: 0.001s !important;
	}

	.nps-kc button.nps-kc-opt:hover,
	.nps-kc a.nps-kc-btn:hover,
	.nps-kc button.nps-kc-btn:hover {
		transform: none;
	}
}
