/*
 * Estilo del test en el frontend, alineado con la paleta de psicotecs.es
 * (azul oscuro + ámbar, tipografía IBM Plex). Ajusta las variables de abajo
 * si el tono exacto no coincide con tu CSS de #pdc-root.
 */
.wqm-quiz-shell {
	--wqm-navy: #0d1b3d;
	--wqm-navy-light: #16295c;
	--wqm-amber: #f2a900;
	--wqm-amber-dark: #cf9000;
	--wqm-text: #1c2333;
	--wqm-muted: #6b7280;
	--wqm-border: #e2e4ea;
	--wqm-bg-soft: #f7f8fb;
	--wqm-correct: #2e8b32;
	--wqm-incorrect: #c0392b;
	--wqm-radius: 10px;

	max-width: 680px;
	margin: 0 auto;
	font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--wqm-text);
}

.wqm-start-screen {
	text-align: center;
	padding: 32px 24px;
	border: 1px solid var(--wqm-border);
	border-radius: var(--wqm-radius);
	background: var(--wqm-bg-soft);
}

.wqm-start-screen h3 {
	font-family: "IBM Plex Serif", Georgia, serif;
	color: var(--wqm-navy);
	margin-bottom: 8px;
}

.wqm-btn {
	display: inline-block;
	padding: 11px 26px;
	border-radius: 999px;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	transition: background .15s, transform .1s;
}

.wqm-btn-primary {
	background: var(--wqm-amber);
	color: var(--wqm-navy);
}

.wqm-btn-primary:hover {
	background: var(--wqm-amber-dark);
}

.wqm-btn-primary:active {
	transform: scale(0.98);
}

.wqm-btn-secondary {
	background: transparent;
	color: var(--wqm-navy);
	border: 1.5px solid var(--wqm-border);
}

.wqm-btn-secondary:hover {
	border-color: var(--wqm-navy-light);
	background: var(--wqm-bg-soft);
}

.wqm-progress {
	text-align: right;
	color: var(--wqm-muted);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .02em;
	margin-bottom: 12px;
}

.wqm-question {
	padding: 20px;
	margin-bottom: 16px;
	background: #fff;
	border: 1px solid var(--wqm-border);
	border-radius: var(--wqm-radius);
}

.wqm-question h4 {
	font-family: "IBM Plex Serif", Georgia, serif;
	font-size: 17px;
	font-weight: 600;
	color: var(--wqm-navy);
	margin: 0 0 16px;
	line-height: 1.4;
}

.wqm-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wqm-option {
	text-align: left;
	padding: 12px 16px;
	border: 1.5px solid var(--wqm-border);
	border-radius: 8px;
	background: #fff;
	color: var(--wqm-text);
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	transition: background .15s, border-color .15s;
}

/* Hover: solo en opciones sin estado (ni seleccionada, ni correcta, ni incorrecta).
 * Se fija también el color del texto para que ningún estilo de botón del tema
 * (hover con fondo/color propios) lo altere. */
.wqm-quiz-shell .wqm-option:hover:not(.wqm-selected):not(.wqm-correct):not(.wqm-incorrect):not(.wqm-answered) {
	border-color: var(--wqm-navy-light);
	background: var(--wqm-bg-soft);
	color: var(--wqm-text);
	box-shadow: 0 1px 4px rgba(13, 27, 61, 0.12);
	text-decoration: none;
}

.wqm-quiz-shell .wqm-option.wqm-selected,
.wqm-quiz-shell .wqm-option.wqm-selected:hover,
.wqm-quiz-shell .wqm-option.wqm-selected:focus {
	border-color: var(--wqm-navy);
	background: var(--wqm-navy) !important;
	color: #fff !important;
}

.wqm-quiz-shell .wqm-option.wqm-correct,
.wqm-quiz-shell .wqm-option.wqm-correct:hover {
	border-color: var(--wqm-correct);
	background: #e9f7ea;
	color: var(--wqm-text);
}

.wqm-quiz-shell .wqm-option.wqm-incorrect,
.wqm-quiz-shell .wqm-option.wqm-incorrect:hover {
	border-color: var(--wqm-incorrect);
	background: #fbebea;
	color: var(--wqm-text);
}

.wqm-option.wqm-answered {
	cursor: default;
}

.wqm-feedback {
	margin-top: 14px;
	font-weight: 600;
}

.wqm-clear-btn {
	display: inline-block;
	margin-top: 12px;
	padding: 0;
	border: none;
	background: none;
	color: var(--wqm-muted);
	font-family: inherit;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

.wqm-clear-btn:hover {
	color: var(--wqm-incorrect);
}

.wqm-fb-correct {
	color: var(--wqm-correct);
}

.wqm-fb-incorrect {
	color: var(--wqm-incorrect);
}

.wqm-actions {
	margin-top: 8px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.wqm-results h3 {
	font-family: "IBM Plex Serif", Georgia, serif;
	color: var(--wqm-navy);
	margin-bottom: 16px;
}

.wqm-review-item {
	border-left: 4px solid var(--wqm-border);
	padding: 12px 16px;
	margin-bottom: 10px;
	background: var(--wqm-bg-soft);
	border-radius: 0 8px 8px 0;
}

.wqm-review-item.wqm-fb-correct {
	border-left-color: var(--wqm-correct);
}

.wqm-review-item.wqm-fb-incorrect {
	border-left-color: var(--wqm-incorrect);
}

.wqm-correct-answer {
	color: var(--wqm-correct);
	font-weight: 600;
}

.wqm-error {
	color: var(--wqm-incorrect);
	margin-top: 10px;
}

.wqm-history-table {
	width: 100%;
	border-collapse: collapse;
	font-family: inherit;
}

.wqm-history-table th,
.wqm-history-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--wqm-border);
	text-align: left;
}

.wqm-history-table th {
	color: var(--wqm-navy);
	font-weight: 600;
}

.wqm-explanation {
	margin-top: 12px;
	padding: 12px 14px;
	background: var(--wqm-bg-soft);
	border-left: 4px solid var(--wqm-amber);
	border-radius: 0 8px 8px 0;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-line;
}

.wqm-explanation-review {
	margin: 8px 0 0;
	background: #fff;
}

.wqm-dice {
	margin: 12px 0 16px;
}

.wqm-dice svg {
	margin: 0 auto;
}

/* Imagen SVG opcional de la pregunta: escala con el contenedor. */
.wqm-svg {
	margin: 12px 0 16px;
}

.wqm-svg svg {
	display: block;
	width: 100%;
	max-width: 460px;
	height: auto;
	margin: 0 auto;
}

/* Enunciados en varias líneas: respeta los saltos de línea del CSV. */
.wqm-question h4,
.wqm-review-item > p:first-child {
	white-space: pre-line;
}

/* Aviso para invitados (test sin registro) */
.wqm-guest-notice {
	font-size: 0.9em;
	opacity: 0.8;
	font-style: italic;
}

/* Temporizador (solo en tests con tiempo límite): fijo en pantalla.
 * Si tu tema tiene una cabecera fija, sube --wqm-timer-top (p. ej. 80px). */
.wqm-time-note {
	font-weight: 600;
	color: #0d1b3d;
}
.wqm-timer {
	--wqm-navy: #0d1b3d;
	--wqm-amber: #f2a900;
	--wqm-incorrect: #c0392b;
	position: fixed;
	top: var(--wqm-timer-top, 12px);
	right: 12px;
	z-index: 99999;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--wqm-navy);
	color: #fff;
	font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 0.85rem;
	box-shadow: 0 4px 14px rgba(13, 27, 61, 0.3);
}
.wqm-timer-value {
	font-size: 1.25rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.wqm-timer-warn {
	background: var(--wqm-amber);
	color: var(--wqm-navy);
}
.wqm-timer-danger {
	background: var(--wqm-incorrect);
	color: #fff;
}
.wqm-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
@media (max-width: 480px) {
	.wqm-timer-label {
		display: none;
	}
	.wqm-timer {
		right: 8px;
		padding: 6px 14px;
	}
}

/* Desglose de la nota final */
.wqm-grade-breakdown {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0 0 18px;
	padding: 0;
}
.wqm-grade-breakdown li { margin: 0; }
.wqm-gb-correct strong { color: var(--wqm-correct); }
.wqm-gb-wrong strong { color: var(--wqm-incorrect); }

/* ---- Test personalizado ([wp_quiz_custom]) ---- */
.wqm-custom-screen {
	text-align: left;
}

.wqm-custom-screen h3,
.wqm-custom-screen > p {
	text-align: center;
}

.wqm-custom-block {
	margin: 20px 0;
}

.wqm-custom-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-weight: 600;
	color: var(--wqm-navy);
	margin-bottom: 8px;
}

.wqm-link-btn {
	background: none;
	border: none;
	padding: 0;
	color: var(--wqm-navy-light);
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
}

.wqm-custom-cats {
	max-height: 280px;
	overflow-y: auto;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid var(--wqm-border);
	border-radius: 8px;
}

.wqm-custom-cat-item,
.wqm-custom-radio {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 5px 0;
	cursor: pointer;
	font-size: 15px;
}

.wqm-custom-cat-item input,
.wqm-custom-radio input {
	margin-top: 4px;
}

.wqm-custom-cat-item small {
	color: var(--wqm-muted);
}

.wqm-custom-count {
	width: 90px;
	padding: 8px 10px;
	border: 1.5px solid var(--wqm-border);
	border-radius: 8px;
	font: inherit;
	margin-right: 8px;
}

.wqm-custom-screen .wqm-start-btn {
	display: block;
	margin: 24px auto 0;
}

.wqm-custom-again {
	text-align: center;
	margin: 16px 0;
}

/* Aviso al empezar (p. ej. menos preguntas de las pedidas) */
.wqm-notice {
	margin: 0 0 14px;
	padding: 10px 14px;
	border-left: 4px solid var(--wqm-amber, #f2a900);
	background: #fff8e5;
	border-radius: 6px;
	font-size: 14px;
}

/* Test personalizado: modo de corrección fijo (sin selector) */
.wqm-custom-fixed-mode {
	margin: 0 0 16px;
	font-size: 14px;
}
