/* ============================================================
   CPDP Quiz Player Styles
   Brand: Red #DB241A | Blue #5AABD6 | Gold #C9A227
   ============================================================ */

.cpdp-quiz-wrap {
	max-width: 760px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Utilidad: visible para lectores de pantalla, oculta visualmente — usada
   por el aviso aria-live del cronómetro (checklist UX/UI, accesibilidad). */
.cpdp-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cpdp-sort-btns button {
	background: #f0f0f0;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 2px 8px;
	font-size: 13px;
	cursor: pointer;
}
.cpdp-sort-btns button:hover { background: #e2e2e2; }
.cpdp-sort-btns button:focus { outline: 2px solid #DB241A; outline-offset: 1px; }

/* Header */
.cpdp-quiz-header {
	background: linear-gradient(135deg, #DB241A 0%, #a8180f 100%);
	color: #fff;
	padding: 24px 28px;
	border-radius: 10px 10px 0 0;
	margin-bottom: 0;
}
.cpdp-quiz-title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
}
.cpdp-quiz-desc {
	margin: 0 0 12px;
	opacity: .85;
	font-size: 14px;
}
.cpdp-quiz-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 13px;
	opacity: .9;
}
.cpdp-quiz-meta span {
	background: rgba(255,255,255,.15);
	padding: 3px 10px;
	border-radius: 20px;
}

/* Screens */
.cpdp-quiz-screen {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 0 0 10px 10px;
	padding: 28px;
}

/* Intro / history */
.cpdp-quiz-history {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
	font-size: 14px;
}
.cpdp-quiz-history th {
	background: #f5f5f5;
	padding: 8px 12px;
	text-align: left;
	border-bottom: 2px solid #ddd;
}
.cpdp-quiz-history td {
	padding: 8px 12px;
	border-bottom: 1px solid #eee;
}
.cpdp-badge-ok   { background: #d4edda; color: #155724; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.cpdp-badge-fail { background: #f8d7da; color: #721c24; padding: 2px 8px; border-radius: 10px; font-size: 12px; }

/* Progress bar */
#cpdp-progress-bar-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
}
#cpdp-progress-bar-wrap > div:first-child {
	flex: 1;
	height: 8px;
	background: #eee;
	border-radius: 4px;
	overflow: hidden;
}
#cpdp-progress-bar {
	height: 8px;
	background: linear-gradient(90deg, #5AABD6, #DB241A);
	border-radius: 4px;
	transition: width .4s ease;
	width: 0%;
}
#cpdp-progress-text { font-size: 12px; color: #888; white-space: nowrap; }

/* Timer */
.cpdp-timer {
	text-align: right;
	margin-bottom: 12px;
}
#cpdp-timer-display {
	font-size: 18px;
	font-weight: 700;
	color: #555;
	background: #f5f5f5;
	padding: 4px 14px;
	border-radius: 20px;
}

/* Question */
.cpdp-question-text {
	font-size: 18px;
	font-weight: 600;
	color: #222;
	margin: 0 0 18px;
	line-height: 1.5;
}
.cpdp-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}
.cpdp-opt {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fafafa;
	border: 1.5px solid #e0e0e0;
	border-radius: 8px;
	padding: 12px 16px;
	cursor: pointer;
	font-size: 15px;
	transition: border-color .2s, background .2s;
}
.cpdp-opt:hover {
	border-color: #5AABD6;
	background: #f0f8ff;
}
.cpdp-opt input { margin: 0; cursor: pointer; }
.cpdp-correct-highlight { border-color: #2a9d2a !important; background: #f0fff4 !important; }

/* Hint */
.cpdp-hint {
	font-size: 13px;
	color: #C9A227;
	background: #fffbea;
	border-left: 3px solid #C9A227;
	padding: 8px 12px;
	border-radius: 0 6px 6px 0;
	margin-top: 14px;
}

/* Nav */
.cpdp-quiz-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 16px;
	flex-wrap: wrap;
	gap: 10px;
}
#cpdp-feedback-msg {
	font-size: 14px;
	font-weight: 600;
	flex: 1;
}

/* Buttons */
.cpdp-btn-primary {
	background: #DB241A;
	color: #fff;
	border: none;
	padding: 12px 28px;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s;
}
.cpdp-btn-primary:hover:not(:disabled) { background: #b51e15; }
.cpdp-btn-primary:disabled { opacity: .5; cursor: default; }
.cpdp-btn-secondary {
	background: #f5f5f5;
	color: #555;
	border: 1px solid #ddd;
	padding: 12px 28px;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	transition: background .2s;
}
.cpdp-btn-secondary:hover { background: #e8e8e8; color: #333; }

/* Agotados */
.cpdp-quiz-agotados {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 0 0 10px 10px;
	padding: 28px;
	text-align: center;
	color: #555;
}

/* Login notice */
.cpdp-quiz-login {
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 8px;
	padding: 16px 20px;
	text-align: center;
}

/* ── Responsividad ────────────────────────────────────────────────────────
   Antes quiz.css no tenía ninguna media query: el padding fijo de 28px
   apretaba el contenido en pantallas angostas, en particular la tabla de
   "emparejar" (matching) y la lista de "ordenar" (checklist UX/UI,
   "Responsividad", 2026-07-14). */
@media (max-width: 480px) {
	.cpdp-quiz-header,
	.cpdp-quiz-screen {
		padding: 16px !important;
	}
	.cpdp-options table {
		font-size: 13px;
	}
	.cpdp-options table td {
		padding: 6px 4px !important;
		display: block;
		width: 100%;
		box-sizing: border-box;
	}
	.cpdp-sort-btns button {
		padding: 4px 10px;
		font-size: 15px;
	}
}

/* Admin styles */
.cpdp-wrap h1 { color: #DB241A; }
