/* Portal de Inducciones — Coohobienestar */

/* ---------- Ajustes contra el tema Astra ---------- */
/* Evita que el contenido del portal se superponga al header. */
.ast-separate-container .coind-login-wrap,
.ast-separate-container .coind-portal,
.ast-plain-container .coind-login-wrap,
.ast-plain-container .coind-portal {
	margin-top: 24px;
	position: relative;
	z-index: 1;
}
/* Astra envuelve el contenido en .entry-content — asegura que respire. */
.entry-content .coind-login-wrap,
.entry-content .coind-portal {
	margin-top: 0;
}

/* ---------- Login ---------- */
.coind-login-wrap {
	display: flex;
	justify-content: center;
	padding: 40px 0;
}
.coind-login-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 32px;
	max-width: 400px;
	width: 100%;
	box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.coind-login-card h2 {
	margin: 0 0 8px;
	text-align: center;
}
.coind-login-card p {
	text-align: center;
	color: #666;
	margin-top: 0;
}
.coind-form label {
	display: block;
	margin: 12px 0 4px;
	font-weight: 600;
	font-size: 14px;
}
.coind-form input[type="text"],
.coind-form input[type="password"] {
	width: 100%;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 16px;
	box-sizing: border-box;
}
.coind-btn {
	display: block;
	width: 100%;
	margin-top: 20px;
	padding: 12px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
}
.coind-btn:hover { background: #1d4ed8; }

/* ---------- Mensajes ---------- */
.coind-msg {
	padding: 12px 16px;
	border-radius: 6px;
	margin: 10px 0;
}
.coind-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.coind-info  { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.coind-aviso { background: #fff8e1; color: #92400e; border: 1px solid #fcd34d; }
.coind-login-hint {
	font-size: 12px;
	color: #888;
	text-align: center;
	margin: 12px 0 0;
}

/* ---------- Portal ---------- */
.coind-portal { margin: 20px 0; }
.coind-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}
.coind-header h2 { margin: 0; }
.coind-header p { margin: 4px 0 0; color: #666; }
.coind-salir {
	font-size: 14px;
	color: #dc2626;
	text-decoration: none;
	font-weight: 600;
}
.coind-salir:hover { text-decoration: underline; }

.coind-cargando {
	text-align: center;
	padding: 40px;
	color: #888;
}

/* ---------- Contrato activo ---------- */
.coind-contrato {
	display: inline-block;
	background: #f0f4ff;
	border: 1px solid #d5def5;
	color: #334155;
	border-radius: 8px;
	padding: 8px 14px;
	margin: 12px 0 4px;
	font-size: 14px;
}

/* ---------- Inducción ---------- */
.coind-induccion {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 24px;
	margin: 20px 0;
}
.coind-ind-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}
.coind-ind-header h3 { margin: 0; }
.coind-badge {
	background: #dbeafe;
	color: #1e40af;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
}
.coind-desc { color: #555; margin: 8px 0; }

/* Inducción bloqueada (pendiente de completar la anterior). */
.coind-ind-bloqueada {
	background: #f9fafb;
	border-style: dashed;
}
.coind-badge-bloqueada {
	background: #e5e7eb;
	color: #374151;
}
.coind-bloqueada-aviso {
	color: #b45309;
	font-weight: 600;
	font-size: 14px;
	margin: 10px 0;
}
.coind-contador {
	font-size: 13px;
	color: #666;
	margin: 4px 0 0;
}

/* ---------- Barra de progreso ---------- */
.coind-progress {
	height: 8px;
	background: #e5e7eb;
	border-radius: 4px;
	overflow: hidden;
	margin: 12px 0;
}
.coind-progress-fill {
	height: 100%;
	background: #2563eb;
	border-radius: 4px;
	transition: width 0.3s;
}

/* ---------- Videos ---------- */
.coind-videos {
	list-style: none;
	padding: 0;
	margin: 16px 0;
}
.coind-video {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	margin: 8px 0;
	flex-wrap: wrap;
}
.coind-video.bloqueado { opacity: 0.55; background: #f9fafb; }
.coind-video.actual    { border-color: #2563eb; background: #eff6ff; }
.coind-video.completado { border-color: #22c55e; background: #f0fdf4; }
.coind-ico { font-size: 18px; }
.coind-titulo { flex: 1; font-weight: 500; }
.coind-estado { font-size: 13px; color: #666; }

/* Miniaturas de video (mqdefault de YouTube, 16:9). El fondo con
   degradado sirve de placeholder si la imagen no carga. */
.coind-thumb-wrap {
	position: relative;
	flex: 0 0 auto;
	width: 112px;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: linear-gradient(135deg, #1a1a2e, #3b82f6);
}
.coind-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.coind-thumb-lock {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	background: rgba(17, 24, 39, 0.45);
}
/* Filas desbloqueadas: son clicables (abren el reproductor). */
.coind-video:not(.bloqueado) { cursor: pointer; }
.coind-video:not(.bloqueado):hover {
	border-color: #2563eb;
	box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}
.coind-btn-ver {
	padding: 8px 16px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
}
.coind-btn-ver:hover { background: #1d4ed8; }
/* Certificado: botón compacto con ancho automático (no ocupa todo el
   ancho de la tarjeta; NO usa .coind-btn porque esa clase es full-width
   y también la comparte el botón "Ingresar" del login). */
.coind-cert {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	width: auto;
	margin-top: 12px;
	padding: 8px 16px;
	background: #16a34a;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
}
.coind-cert:hover { background: #15803d; }

/* ---------- Modal del reproductor ---------- */
#coind-modal {
	display: none;
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	z-index: 100000;
	background: rgba(0,0,0,0.7);
}
.coind-modal-overlay {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	width: 100%;
	height: 100%;
	padding: 20px;
	box-sizing: border-box;
	overflow-y: auto;
}
.coind-modal-box {
	background: #fff;
	border-radius: 12px;
	max-width: 900px;
	width: 100%;
	overflow: hidden;
	margin: auto;
	flex-shrink: 0;
}
.coind-modal-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid #e5e7eb;
}
.coind-modal-head h3 { margin: 0; }
.coind-cerrar {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
	/* Padding explícito: sin él Astra mete su padding:17px 35px (el ✕
	   llegaba a 91×58) y con 0 la X tocaba todos los bordes del botón.
	   4/8 deja aire alrededor de la X; el hover pinta fondo suave. */
	padding: 4px 8px;
	line-height: 1;
	border-radius: 6px;
}
.coind-cerrar:hover {
	color: #dc2626;
	background: #fee2e2;
}

/* Contenedor del player: video (16:9) + barra de controles.
   La barra vive DENTRO del wrap para estar disponible en pantalla completa. */
#coind-player-wrap {
	position: relative;
	width: 100%;
	background: #000;
}
#coind-video-area {
	position: relative;
	width: 100%;
	aspect-ratio: 16/9;
	background: #000;
}
#coind-player {
	width: 100%;
	height: 100%;
}
#coind-player iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

/* Overlay invisible: cubre TODO el player, bloquea interacción con YouTube. */
.coind-yt-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10;
	cursor: default;
}

/* Barra de controles personalizada bajo el video. */
.coind-player-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 20px;
	background: #1a1a2e;
	color: #fff;
	font-size: 13px;
}
.coind-btn-play {
	background: #3b82f6;
	border: none;
	color: #fff;
	font-size: 18px;
	width: 40px;
	height: 40px;
	/* Sin padding declarado, Astra aplicaba su padding:17px 35px y con
	   border-box la caja crecía a 70×40 → border-radius:50% dibujaba un
	   ÓVALO en vez de un círculo. */
	padding: 0;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 1;
}
.coind-btn-play:hover {
	background: #2563eb;
}
.coind-btn-rewind {
	background: #374151;
	border: 1px solid #4b5563;
	color: #fff;
	font-size: 12px;
	padding: 6px 10px;
	border-radius: 20px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 1;
	white-space: nowrap;
	font-weight: 600;
}
.coind-btn-rewind:hover {
	background: #4b5563;
	border-color: #6b7280;
}
.coind-barra-mini {
	flex: 1;
	height: 8px;
	background: rgba(255,255,255,0.2);
	border-radius: 4px;
	overflow: visible;
	position: relative;
	cursor: pointer;
}
#coind-mini-fill {
	height: 100%;
	background: #3b82f6;
	transition: width 0.5s;
	border-radius: 4px;
}
.coind-mini-marker {
	position: absolute;
	top: -3px;
	width: 3px;
	height: 14px;
	background: #f59e0b;
	border-radius: 2px;
	pointer-events: none;
	transition: left 0.5s;
	box-shadow: 0 0 4px rgba(0,0,0,0.5);
}
.coind-barra-mini:hover {
	height: 10px;
}
.coind-barra-mini:hover .coind-mini-marker {
	height: 16px;
	top: -3px;
}
#coind-tiempo {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
#coind-progreso-video {
	white-space: nowrap;
	font-weight: 600;
}
.coind-btn-fs {
	background: none;
	border: 1px solid rgba(255,255,255,0.3);
	color: #fff;
	font-size: 18px;
	padding: 4px 10px;
	border-radius: 4px;
	cursor: pointer;
	line-height: 1;
}
.coind-btn-fs:hover {
	background: rgba(255,255,255,0.15);
}

/* Control de volumen (icono mute + slider) en la barra del reproductor.
   Vive en la barra → también queda visible en pantalla completa.
   En móvil lo manejan las teclas del teléfono: se oculta (ver @media). */
.coind-volumen {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}
.coind-btn-mute {
	background: none;
	border: 1px solid rgba(255,255,255,0.3);
	color: #fff;
	font-size: 16px;
	padding: 4px 8px;
	border-radius: 4px;
	cursor: pointer;
	line-height: 1;
}
.coind-btn-mute:hover {
	background: rgba(255,255,255,0.15);
}
/* Slider de volumen: UNA sola línea (pista de 4px) + bolita blanca.
   - Selector por ID: gana a `input[type="range"] { width:100% }` de Astra.
   - background transparent + margin:0 anulan la caja gris y el margin
     5.7px 0 que Astra pone a todo range: eso producía el "doble barra"
     grises apiladas. */
#coind-slider-volumen {
	-webkit-appearance: none;
	appearance: none;
	width: 80px;
	height: 16px; /* área de clic cómoda; la línea la pinta la pista */
	background: transparent;
	margin: 0;
	cursor: pointer;
	outline: none;
}
#coind-slider-volumen::-webkit-slider-runnable-track {
	width: 100%;
	height: 4px;
	background: rgba(255,255,255,0.35);
	border-radius: 2px;
	/* Astra pinta en este pseudo DOS sombras grises (2.6px) que se leían
	   como una "doble barra" justo debajo de la pista: aquí se anulan. */
	box-shadow: none;
}
#coind-slider-volumen::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 12px;
	height: 12px;
	margin-top: -4px; /* centra la bolita sobre la pista de 4px */
	background: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: none; /* Astra agrega aquí sombras amarillas (higiene) */
}
#coind-slider-volumen::-moz-range-track {
	height: 4px;
	background: rgba(255,255,255,0.35);
	border-radius: 2px;
}
#coind-slider-volumen::-moz-range-thumb {
	width: 12px;
	height: 12px;
	background: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
}
.coind-volumen.silenciado .coind-slider-volumen {
	opacity: 0.5;
}

/* Pantalla completa: el video llena el 100% y la barra de controles se
   superpone abajo (estilo YouTube). El selector de calidad sube para no
   quedar tapado por la barra. */
#coind-player-wrap:fullscreen,
#coind-player-wrap:-webkit-full-screen {
	width: 100%;
	height: 100%;
}
#coind-player-wrap:fullscreen #coind-video-area,
#coind-player-wrap:-webkit-full-screen #coind-video-area {
	position: absolute;
	inset: 0;
	aspect-ratio: auto;
}
#coind-player-wrap:fullscreen .coind-player-bar,
#coind-player-wrap:-webkit-full-screen .coind-player-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 12;
}
#coind-player-wrap:fullscreen .coind-calidad,
#coind-player-wrap:-webkit-full-screen .coind-calidad {
	bottom: 70px;
}

/* Selector de calidad: flota sobre el video (solo 720p / 1080p; 720p
   por defecto). Queda dentro del contenedor del player para seguir
   visible en pantalla completa. */
.coind-calidad {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 11;
	display: flex;
	gap: 4px;
	padding: 4px;
	background: rgba(0,0,0,0.55);
	border-radius: 6px;
}
.coind-cal-btn {
	background: none;
	border: 1px solid rgba(255,255,255,0.3);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 8px;
	border-radius: 4px;
	cursor: pointer;
	line-height: 1;
	white-space: nowrap;
}
.coind-cal-btn:hover:not(:disabled) {
	background: rgba(255,255,255,0.15);
}
.coind-cal-btn.active {
	background: #3b82f6;
	border-color: #3b82f6;
}
.coind-cal-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.coind-modal-info { padding: 12px 20px; }
.coind-ind-progreso {
	margin: 4px 0 0;
	font-size: 13px;
	color: #555;
}
.coind-aviso-ok { color: #16a34a; font-weight: 600; }
#coind-aviso { margin: 0; font-size: 14px; }

/* ============================================================
   MÓVIL (≤640px): lista de videos y barra del reproductor.
   ============================================================ */

/* Lista de videos: en pantallas angostas el flex+wrap desordenaba
   la fila (título a3 líneas, estado y botón caídos debajo de la
   miniatura). Se pasa a grid con áreas explícitas. */
@media (max-width: 640px) {
	.coind-video {
		display: grid;
		grid-template-columns: 104px 1fr;
		grid-template-areas:
			"thumb titulo"
			"thumb estado"
			"btn    btn";
		gap: 6px 10px;
		align-items: start;
		padding: 10px;
	}
	.coind-thumb-wrap {
		grid-area: thumb;
		width: 104px;
	}
	.coind-titulo {
		grid-area: titulo;
		font-size: 15px;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	.coind-estado { grid-area: estado; }
	.coind-btn-ver {
		grid-area: btn;
		width: 100%;
		padding: 14px 10px;
		font-size: 15px;
		text-align: center;
	}
	/* El emoji suelto se oculta y se conserva como prefijo del estado. */
	.coind-ico { display: none; }
	.coind-video.completado .coind-estado::before { content: "✅ "; }
	.coind-video.actual    .coind-estado::before { content: "▶️ "; }
	.coind-video.bloqueado .coind-estado::before { content: "🔒 "; }

	/* Barra del reproductor: menos separación y sin el "% visto"
	   (la mini-barra ya muestra el avance; en móvil el espacio es
	   escaso y ese texto empujaba la mini-barra a casi0px). */
	.coind-player-bar {
		gap: 8px;
		padding: 8px 10px;
	}
	#coind-progreso-video { display: none; }

	/* Volumen: en móvil se usa las teclas del teléfono. */
	.coind-volumen { display: none; }
}
